{"id":28410589,"url":"https://github.com/bitman09/pumpfun-buy-sell-bot","last_synced_at":"2026-01-22T12:51:59.478Z","repository":{"id":266302680,"uuid":"897966407","full_name":"bitman09/pumpfun-buy-sell-bot","owner":"bitman09","description":"The #Solana #Pump.fun #trading #bot is an advanced automated tool designed for seamless #buy-#sell execution, optimizing real-time #trading efficiency and profitability on the #Pumpfun platform.","archived":false,"fork":false,"pushed_at":"2025-05-15T07:51:25.000Z","size":19,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-21T21:36:17.573Z","etag":null,"topics":["buy-sell","pump-fun","pumpfun-trading-bot","realtime-trading","solana","solana-trade-bot","trading-bot"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitman09.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-03T14:54:24.000Z","updated_at":"2025-05-15T07:51:29.000Z","dependencies_parsed_at":"2024-12-03T16:19:45.570Z","dependency_job_id":"97640845-74ff-43ce-be88-a4d8a8b465fd","html_url":"https://github.com/bitman09/pumpfun-buy-sell-bot","commit_stats":null,"previous_names":["bitman310/pumpfun-buy-sell-bot","bitman09/pumpfun-buy-sell-bot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bitman09/pumpfun-buy-sell-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitman09%2Fpumpfun-buy-sell-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitman09%2Fpumpfun-buy-sell-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitman09%2Fpumpfun-buy-sell-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitman09%2Fpumpfun-buy-sell-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitman09","download_url":"https://codeload.github.com/bitman09/pumpfun-buy-sell-bot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitman09%2Fpumpfun-buy-sell-bot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269713883,"owners_count":24463244,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["buy-sell","pump-fun","pumpfun-trading-bot","realtime-trading","solana","solana-trade-bot","trading-bot"],"created_at":"2025-06-02T11:36:08.984Z","updated_at":"2026-01-22T12:51:54.455Z","avatar_url":"https://github.com/bitman09.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# pumpfun-buy-sell-bot\nAn automated Solana Pump.fun bot designed for seamless buy-and-sell execution, maximizing efficiency and profitability in real-time trading.\n\n\n## Contact Info\nIf you need more technical support and development inquires, you can contact below.\n\nLinkedIn: [@dias-ishbulatov](https://www.linkedin.com/in/dias-ishbulatov)\n\nTelegram: [@bitman09](https://t.me/@bitman09)\n\n\n\n## **Installation:**\n\n```bash\n# Clone the repository \ngit clone https://github.com/bitman09/pumpfun-buy-sell-bot.git\n\n# Install dependencies \ncd pumpfun-buy-sell-bot\nnpm install \n```\n\n### Core Functionality \n\n**BondingCurveAccount:**\n```javascript\n  getBuyPrice(amount: bigint): bigint {\n    if (this.complete) {\n      throw new Error(\"Curve is complete\");\n    }\n\n    if (amount \u003c= 0n) {\n      return 0n;\n    }\n\n    // Calculate the product of virtual reserves\n    let n = this.virtualSolReserves * this.virtualTokenReserves;\n\n    // Calculate the new virtual sol reserves after the purchase\n    let i = this.virtualSolReserves + amount;\n\n    // Calculate the new virtual token reserves after the purchase\n    let r = n / i + 1n;\n\n    // Calculate the amount of tokens to be purchased\n    let s = this.virtualTokenReserves - r;\n\n    // Return the minimum of the calculated tokens and real token reserves\n    return s \u003c this.realTokenReserves ? s : this.realTokenReserves;\n  }\n\n  getSellPrice(amount: bigint, feeBasisPoints: bigint): bigint {\n    if (this.complete) {\n      throw new Error(\"Curve is complete\");\n    }\n\n    if (amount \u003c= 0n) {\n      return 0n;\n    }\n\n    // Calculate the proportional amount of virtual sol reserves to be received\n    let n =\n      (amount * this.virtualSolReserves) / (this.virtualTokenReserves + amount);\n\n    // Calculate the fee amount in the same units\n    let a = (n * feeBasisPoints) / 10000n;\n\n    // Return the net amount after deducting the fee\n    return n - a;\n  }\n```\n\n\n**Events:**\n```javascript\nexport function toCreateEvent(event: CreateEvent): CreateEvent {\n  return {\n    name: event.name,\n    symbol: event.symbol,\n    uri: event.uri,\n    mint: new PublicKey(event.mint),\n    bondingCurve: new PublicKey(event.bondingCurve),\n    user: new PublicKey(event.user),\n  };\n}\n\nexport function toCompleteEvent(event: CompleteEvent): CompleteEvent {\n  return {\n    user: new PublicKey(event.user),\n    mint: new PublicKey(event.mint),\n    bondingCurve: new PublicKey(event.bondingCurve),\n    timestamp: event.timestamp,\n  };\n}\n\nexport function toTradeEvent(event: TradeEvent): TradeEvent {\n  return {\n    mint: new PublicKey(event.mint),\n    solAmount: BigInt(event.solAmount),\n    tokenAmount: BigInt(event.tokenAmount),\n    isBuy: event.isBuy,\n    user: new PublicKey(event.user),\n    timestamp: Number(event.timestamp),\n    virtualSolReserves: BigInt(event.virtualSolReserves),\n    virtualTokenReserves: BigInt(event.virtualTokenReserves),\n    realSolReserves: BigInt(event.realSolReserves),\n    realTokenReserves: BigInt(event.realTokenReserves),\n  };\n}\n\nexport function toSetParamsEvent(event: SetParamsEvent): SetParamsEvent {\n  return {\n    feeRecipient: new PublicKey(event.feeRecipient),\n    initialVirtualTokenReserves: BigInt(event.initialVirtualTokenReserves),\n    initialVirtualSolReserves: BigInt(event.initialVirtualSolReserves),\n    initialRealTokenReserves: BigInt(event.initialRealTokenReserves),\n    tokenTotalSupply: BigInt(event.tokenTotalSupply),\n    feeBasisPoints: BigInt(event.feeBasisPoints),\n  };\n}\n```\n\n**Global Account:**\n```javascript\nexport class GlobalAccount {\n  public discriminator: bigint;\n  public initialized: boolean = false;\n  public authority: PublicKey;\n  public feeRecipient: PublicKey;\n  public initialVirtualTokenReserves: bigint;\n  public initialVirtualSolReserves: bigint;\n  public initialRealTokenReserves: bigint;\n  public tokenTotalSupply: bigint;\n  public feeBasisPoints: bigint;\n\n  constructor(\n    discriminator: bigint,\n    initialized: boolean,\n    authority: PublicKey,\n    feeRecipient: PublicKey,\n    initialVirtualTokenReserves: bigint,\n    initialVirtualSolReserves: bigint,\n    initialRealTokenReserves: bigint,\n    tokenTotalSupply: bigint,\n    feeBasisPoints: bigint\n  ) {\n    this.discriminator = discriminator;\n    this.initialized = initialized;\n    this.authority = authority;\n    this.feeRecipient = feeRecipient;\n    this.initialVirtualTokenReserves = initialVirtualTokenReserves;\n    this.initialVirtualSolReserves = initialVirtualSolReserves;\n    this.initialRealTokenReserves = initialRealTokenReserves;\n    this.tokenTotalSupply = tokenTotalSupply;\n    this.feeBasisPoints = feeBasisPoints;\n  }\n\n  getInitialBuyPrice(amount: bigint): bigint {\n    if (amount \u003c= 0n) {\n      return 0n;\n    }\n\n    let n = this.initialVirtualSolReserves * this.initialVirtualTokenReserves;\n    let i = this.initialVirtualSolReserves + amount;\n    let r = n / i + 1n;\n    let s = this.initialVirtualTokenReserves - r;\n    return s \u003c this.initialRealTokenReserves\n      ? s\n      : this.initialRealTokenReserves;\n  }\n\n  public static fromBuffer(buffer: Buffer): GlobalAccount {\n    const structure: Layout\u003cGlobalAccount\u003e = struct([\n      u64(\"discriminator\"),\n      bool(\"initialized\"),\n      publicKey(\"authority\"),\n      publicKey(\"feeRecipient\"),\n      u64(\"initialVirtualTokenReserves\"),\n      u64(\"initialVirtualSolReserves\"),\n      u64(\"initialRealTokenReserves\"),\n      u64(\"tokenTotalSupply\"),\n      u64(\"feeBasisPoints\"),\n    ]);\n\n    let value = structure.decode(buffer);\n    return new GlobalAccount(\n      BigInt(value.discriminator),\n      value.initialized,\n      value.authority,\n      value.feeRecipient,\n      BigInt(value.initialVirtualTokenReserves),\n      BigInt(value.initialVirtualSolReserves),\n      BigInt(value.initialRealTokenReserves),\n      BigInt(value.tokenTotalSupply),\n      BigInt(value.feeBasisPoints)\n    );\n  }\n}\n```\n\n...........\n\nAlso There are many other part of the project!!!\n\n## Main Part of Project\n\n### Index.ts\n\n```javascript\nconst main = async () =\u003e {\n  try {\n    console.log(\n      (await connection.getBalance(mainKp.publicKey)) / 10 ** 9,\n      \"SOL in main keypair\"\n    );\n\n    console.log(mintAddress);\n\n    try {\n      const tokenBuyix = await makeBuyIx(\n        mainKp,\n        Math.floor(SWAP_AMOUNT * 10 ** 9)\n      );\n\n      if (!tokenBuyix) {\n        console.log(\"Token buy instruction not retrieved\");\n        return;\n      }\n      const tx = new Transaction().add(\n        ComputeBudgetProgram.setComputeUnitPrice({\n          microLamports: 100_000,\n        }),\n        ComputeBudgetProgram.setComputeUnitLimit({\n          units: 200_000,\n        }),\n        ...tokenBuyix\n      );\n\n      tx.feePayer = mainKp.publicKey;\n      tx.recentBlockhash = (await connection.getLatestBlockhash()).blockhash;\n\n      console.log(await connection.simulateTransaction(tx));\n\n      const signature = await sendAndConfirmTransaction(\n        connection,\n        tx,\n        [mainKp],\n        { skipPreflight: true, commitment: commitment }\n      );\n\n      console.log(`Buy Tokens : https://solscan.io/tx/${signature}`);\n    } catch (error) {\n    }\n\n    try {\n      const tokenAccount = await getAssociatedTokenAddress(\n        mintAddress,\n        mainKp.publicKey\n      );\n\n      const tokenBalance = (\n        await connection.getTokenAccountBalance(tokenAccount)\n      ).value.amount;\n\n      if (tokenBalance) {\n        const tokenSellix = await makeSellIx(mainKp, Number(tokenBalance));\n        console.log(tokenSellix);\n        if (!tokenSellix) {\n          console.log(\"Token buy instruction not retrieved\");\n          return;\n        }\n\n        const tx = new Transaction().add(\n          ComputeBudgetProgram.setComputeUnitPrice({\n            microLamports: 100_000,\n          }),\n          ComputeBudgetProgram.setComputeUnitLimit({\n            units: 200_000,\n          }),\n          tokenSellix\n        );\n\n        tx.feePayer = mainKp.publicKey;\n        tx.recentBlockhash = (await connection.getLatestBlockhash()).blockhash;\n\n        console.log(await connection.simulateTransaction(tx));\n\n        const signature = await sendAndConfirmTransaction(\n          connection,\n          tx,\n          [mainKp],\n          { skipPreflight: true, commitment: commitment }\n        );\n\n        console.log(`Sell Tokens : https://solscan.io/tx/${signature}`);\n      }\n    } catch (error) {\n    }\n  } catch (error) {\n    console.log(\"Token trading error\");\n  }\n};\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitman09%2Fpumpfun-buy-sell-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitman09%2Fpumpfun-buy-sell-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitman09%2Fpumpfun-buy-sell-bot/lists"}