Skip to content
Back to search

pump-fun-sdk

Token creation launching, bonding curve trading, AMM migration, tiered fees, creator fee sharing, vanity keygen, MCP server, Telegram bot & live dashboards

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 12 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/nirholas/pump-fun-sdk with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/nirholas/pump-fun-sdk'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/nirholas--pump-fun-sdk/badge.svg)](/listings/nirholas--pump-fun-sdk)

HTML

<a href="/listings/nirholas--pump-fun-sdk"><img src="/api/listings/nirholas--pump-fun-sdk/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Installation

# npm
npm install @nirholas/pump-sdk

# yarn
yarn add @nirholas/pump-sdk

# pnpm
pnpm add @nirholas/pump-sdk

Peer Dependencies

The SDK requires these Solana packages (install them if not already present):

npm install @solana/web3.js @solana/spl-token @coral-xyz/anchor bn.js

Minimal Example

import { Connection, PublicKey } from "@solana/web3.js";
import { OnlinePumpSdk } from "@nirholas/pump-sdk";

// 1. Create an online SDK instance
const connection = new Connection("https://api.mainnet-beta.solana.com");
const sdk = new OnlinePumpSdk(connection);

// 2. Fetch current token state
const mint = new PublicKey("YourTokenMintAddress...");
const summary = await sdk.fetchBondingCurveSummary(mint);

console.log("Market Cap:", summary.marketCap.toString(), "lamports");
console.log("Graduated:", summary.isGraduated);
console.log("Progress:", summary.progressBps / 100, "%");

---

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 14 lines
  1. {
  2. "name": "pump-fun-sdk",
  3. "owner": {"name": "nirholas"},
  4. "description": "Plugin for the Pump protocol SDK, CLI and MCP server on Solana.",
  5. "plugins": [
  6. {
  7. "name": "pump-sdk",
  8. "source": "./plugins/pump-sdk",
  9. "description": "Inspect, quote and build transactions for Pump bonding curves and AMM pools with the pump CLI, the TypeScript SDK and an MCP server.",
  10. "category": "finance",
  11. "tags": ["solana", "pump", "bonding-curve", "sdk", "mcp"]
  12. }
  13. ]
  14. }
README.md · README · 668 lines
  1. <p align="center">
  2. <h1 align="center">Pump SDK</h1>
  3. <p align="center">
  4. TypeScript SDK for the Pump protocol on Solana — token creation, bonding curves, AMM pools, fee sharing, and volume rewards.
  5. </p>
  6. </p>
  7. <p align="center">
  8. <a href="https://www.npmjs.com/package/@nirholas/pump-sdk"><img src="https://img.shields.io/npm/v/@nirholas/pump-sdk.svg?style=flat-square&color=blue" alt="npm version" /></a>
  9. <a href="https://github.com/nirholas/pump-fun-sdk/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@nirholas/pump-sdk.svg?style=flat-square" alt="license" /></a>
  10. <a href="https://www.npmjs.com/package/@nirholas/pump-sdk"><img src="https://img.shields.io/npm/dm/@nirholas/pump-sdk.svg?style=flat-square" alt="downloads" /></a>
  11. <img src="https://img.shields.io/badge/TypeScript-5.0+-blue?style=flat-square&logo=typescript" alt="TypeScript" />
  12. <img src="https://img.shields.io/badge/Solana-1.98+-purple?style=flat-square&logo=solana" alt="Solana" />
  13. </p>
  14. ## What is Pump SDK?
  15. Pump SDK is the community TypeScript SDK for the [Pump.fun](https://pump.fun) protocol on Solana. It provides **offline-first instruction builders** for every on-chain operation — token creation, bonding curve trading, AMM pool management, tiered fee configuration, creator fee sharing, volume-based token incentives, and social referral fees.
  16. The SDK never sends transactions itself. It returns `TransactionInstruction[]` that you compose into transactions with your preferred signing and sending strategy.
  17. **Docs: https://sdk.pumpk.it/** · [Getting started](docs/getting-started.md) · [Examples](docs/examples.md)
  18. ---
  19. ## 📋 Table of Contents
  20. - [Quick Start](#-quick-start)
  21. - [The `pump` CLI](#-the-pump-cli)
  22. - [50 Runnable Examples](#-50-runnable-examples)
  23. - [Usage Examples](#-usage-examples)
  24. - [Create a Token](#create-a-token)
  25. - [Create a Token With a `...pump` Vanity Mint](#create-a-token-with-a-pump-vanity-mint)
  26. - [Buy Tokens on the Bonding Curve](#buy-tokens-on-the-bonding-curve)
  27. - [Sell Tokens](#sell-tokens)
  28. - [Check Graduation Progress](#check-graduation-progress)
  29. - [Set Up Fee Sharing](#set-up-fee-sharing)
  30. - [API Reference](#-api-reference)
  31. - [On-Chain Programs](#-on-chain-programs)
  32. - [Configuration](#-configuration)
  33. - [Error Handling](#-error-handling)
  34. - [FAQ](#-faq)
  35. - [Architecture](#-architecture)
  36. - [Contributing](#-contributing)
  37. - [License](#-license)
  38. - [Acknowledgments](#-acknowledgments)
  39. ---
  40. ## 🚀 Live Demos & Resources
  41. - **[Token Launchpad](https://sdk.pumpk.it/live/launchpad)**: launch and trade real Pump tokens from your browser, built entirely on this SDK
  42. - **[SDK Docs & Live Dashboards](https://sdk.pumpk.it)** (trades, launches, vanity: [sdk.pumpk.it/live](https://sdk.pumpk.it/live/))
  43. - **[pump.fun UI Template](https://demo.pumpk.it)**
  44. - **[DeFi Agents API](https://agents.pumpk.it)**
  45. - **[PumpKit](https://github.com/nirholas/pumpkit)**
  46. - **[PumpKit Site](https://pumpk.it)**
  47. - **[Telegram PumpFun Github Claim Tracker Bot](https://t.me/pumpfunclaims)**
  48. - **[Pump.fun GitHub Claims — dedicated repository](https://github.com/nirholas/pumpfun-github-claims)** · [Product and notification rules](docs/github-claims-product.md)
  49. > A GitHub social-fee withdrawal is real on-chain activity, not automatic proof
  50. > that a developer created or endorses a coin. Claim cards distinguish verified
  51. > repository/creator-wallet relationships, identity mismatches, unverified
  52. > links, and unresolved pooled withdrawals. See the notification rules above.
  53. - **[Telegram PumpFun Graduation/Migration Tracker Bot](https://t.me/trackpumpfun)**
  54. - **[Pumpfun Claim Tracker](https://t.me/pfclaimsbot)** (best bot — currently offline while building)
  55. ## 📈 Proof & Virality
  56. **Proof the GitHub Claim Tracker bot is profitable to monitor**
  57. [→ View tweet](https://x.com/nichxbt/status/2033377591592444056)
  58. **Went mega viral**
  59. [→ View tweet](https://x.com/RoundtableSpace/status/2027417189918064915)
  60. > **just shipped a real-time PumpFun intelligence bot on Telegram**
  61. >
  62. > 17 commands. zero cost. fully on-chain.
  63. >
  64. > `/price` → instant token price & bonding curve
  65. > `/monitor` → live token launch feed
  66. > `/cto` → creator takeover alerts
  67. > `/watch` → wallet fee claim tracking
  68. > `/quote` → buy/sell estimates
  69. > `/graduated` → AMM graduation status
  70. > `/alerts` → customize your notifications
  71. >
  72. > all powered by the open-source **pump-fun-sdk**
  73. [→ View original post](https://x.com/nichxbt/status/2027304823712817503)
  74. **The post that started it all**
  75. [→ View tweet](https://x.com/nichxbt/status/2027087471683698811)
  76. # Looking for more? Check out PumpKit 💊💚
  77. > Open-source framework for building PumpFun Telegram bots on Solana. Claim monitors, channel feeds, group trackers, whale alerts — build your own or use ours.
  78. >
  79. > [PumpKit Web App + Documentation](https://pumpk.it)
  80. ---
  81. ## 🚀 Quick Start
  82. ### Installation
  83. ```bash
  84. # npm
  85. npm install @nirholas/pump-sdk
  86. # yarn
  87. yarn add @nirholas/pump-sdk
  88. # pnpm
  89. pnpm add @nirholas/pump-sdk
  90. ```
  91. ### Peer Dependencies
  92. The SDK requires these Solana packages (install them if not already present):
  93. ```bash
  94. npm install @solana/web3.js @solana/spl-token @coral-xyz/anchor bn.js
  95. ```
  96. ### Minimal Example
  97. ```typescript
  98. import { Connection, PublicKey } from "@solana/web3.js";
  99. import { OnlinePumpSdk } from "@nirholas/pump-sdk";
  100. // 1. Create an online SDK instance
  101. const connection = new Connection("https://api.mainnet-beta.solana.com");
  102. const sdk = new OnlinePumpSdk(connection);
  103. // 2. Fetch current token state
  104. const mint = new PublicKey("YourTokenMintAddress...");
  105. const summary = await sdk.fetchBondingCurveSummary(mint);
  106. console.log("Market Cap:", summary.marketCap.toString(), "lamports");
  107. console.log("Graduated:", summary.isGraduated);
  108. console.log("Progress:", summary.progressBps / 100, "%");
  109. ```
  110. ---
  111. ## 💻 The `pump` CLI
  112. The SDK ships with a binary. No wallet, no API key, and no configuration are needed for anything that reads the chain.
  113. ```bash
  114. npm install -g @nirholas/pump-sdk
  115. pump curve <mint> # price, market cap, graduation meter, fee tier
  116. pump quote buy <mint> --sol 1 # what 1 SOL really buys, after fees and impact
  117. pump watch <mint> # live dashboard
  118. pump doctor # check your RPC, wallet, and balance in one shot
  119. ```
  120. Or without installing anything: `npx -p @nirholas/pump-sdk pump curve <mint>`.
  121. ```
  122. FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump live on the bonding curve
  123. ────────────────────────────────────────────────────────────
  124. Market cap 93.705347 SOL
  125. Buy price 0.000000096 SOL per token
  126. Sell price 0.000000091 SOL per token
  127. Trading fee 1.25% 0.95% protocol + 0.3% creator
  128. Graduation ███████████████░░░░░░░░░ 61.39%
  129. SOL to graduate 60.684661 SOL
  130. SOL in curve 24.921536 SOL
  131. Tokens left 306.21M of 793.1M
  132. ```
  133. | Command | What it does |
  134. |---|---|
  135. | `pump curve` / `price` / `pool` / `global` | Read curve, price, AMM pool, and protocol state |
  136. | `pump quote buy\|sell` | Price a trade offline: output, fees, effective price, impact |
  137. | `pump buy` / `sell` | Trade, auto-routing between the bonding curve and PumpAMM |
  138. | `pump create` | Launch a token, optionally with an atomic first buy |
  139. | `pump vanity` | Grind a `...pump` mint address |
  140. | `pump fees` / `incentives` | Check and claim creator fees and volume rewards |
  141. | `pump watch` | Live-refreshing dashboard, or a JSON price feed |
  142. | `pump events` | Decode the Pump events in any transaction |
  143. | `pump pda` | Derive any Pump program address |
  144. | `pump doctor` / `config` | Diagnose and configure |
  145. **Safe by construction.** Reads never load a keypair. Every trade is simulated before anything is sent, prints exactly what is about to happen, and waits for an explicit yes. `--simulate` sends nothing; `--yes` is the scripting escape hatch; a piped command with neither refuses rather than spending funds unattended.
  146. **Scriptable.** Every command takes `--json` and writes nothing else to stdout in that mode:
  147. ```bash
  148. pump curve <mint> --json | jq .marketCapSol
  149. pump watch <mint> --json --interval 10 | jq -r '"\(.at) \(.marketCapSol) SOL"'
  150. pump events <sig> --json | jq '.events[] | select(.type=="trade")'
  151. ```
  152. Full reference: **[docs/cli.md](docs/cli.md)**. Ten-minute walkthrough: **[tutorial 45](tutorials/45-cli-quickstart.md)**.
  153. ---
  154. ## 🧪 50 Runnable Examples
  155. The repo ships fifty tested, runnable examples covering the entire SDK surface. Each one runs with a single command, exports its logic for offline testing, and has a matching step-by-step tutorial.
  156. ```bash
  157. git clone https://github.com/nirholas/pump-fun-sdk && cd pump-fun-sdk && npm install
  158. npm run example # list all 50
  159. npm run example 11 # offline buy quotes
  160. npm run test:examples # run every example's test suite offline
  161. ```
  162. | Range | Category |
  163. |-------|----------|
  164. | 01-10 | Token Lifecycle: create, buy, sell, mayhem mode, cashback |
  165. | 11-20 | Curve Math & Fees: offline quotes, tiers, price impact |
  166. | 21-30 | Accounts & Events: every PDA, every decoder |
  167. | 31-40 | Live Data: mainnet reads, batching, WebSocket feeds |
  168. | 41-50 | AMM & Advanced: pools, liquidity, fee sharing, incentives, vanity mints |
  169. Full catalog: [docs/examples.md](docs/examples.md) · Browse: [examples/](examples/) · Tutorials: [tutorials/examples/](tutorials/examples/)
  170. ---
  171. ## 📖 Usage Examples
  172. ### Create a Token
  173. ```typescript
  174. import { Keypair } from "@solana/web3.js";
  175. import { PUMP_SDK } from "@nirholas/pump-sdk";
  176. const mintKeypair = Keypair.generate();
  177. const creator = wallet.publicKey;
  178. const createIx = await PUMP_SDK.createV2Instruction({
  179. mint: mintKeypair.publicKey,
  180. name: "My Token",
  181. symbol: "MYTKN",
  182. uri: "https://arweave.net/metadata.json",
  183. creator,
  184. user: creator,
  185. mayhemMode: false,
  186. });
  187. // createIx is a TransactionInstruction — add to a Transaction and send
  188. ```
  189. > **Warning**: Do NOT use `createInstruction` — it is deprecated (v1). Always use `createV2Instruction`.
  190. ### Create a Holder-Reward Token
  191. Set `holderReward: true` to direct creator fees to the protocol-derived holder
  192. rewards PDA. Pump.fun distributes those fees to holders automatically; holders
  193. do not need to submit claims.
  194. ```typescript
  195. const createIx = await PUMP_SDK.createV2Instruction({
  196. mint: mintKeypair.publicKey,
  197. name: "Holder Helper",
  198. symbol: "HOLD",
  199. uri: "https://example.com/holder-helper.json",
  200. creator: wallet.publicKey,
  201. user: wallet.publicKey,
  202. mayhemMode: false,
  203. holderReward: true,
  204. });
  205. ```
  206. For an atomic launch and initial buy, pass the same flag to
  207. `createV2AndBuyInstructions`; the SDK routes the buy through
  208. `creatorVaultPda(holderRewardsPda(mint))`. Run the complete broadcast-free demo
  209. with `npm run example 51`.
  210. New cashback launches are deprecated and rejected. Existing cashback coins
  211. remain tradeable and accrued cashback remains claimable.
  212. ### Create a Token With a `...pump` Vanity Mint
  213. Mint addresses ending in `pump` (like the ones on pump.fun) are produced by
  214. grinding keypairs off-chain. The SDK exposes this as a first-class helper —
  215. swap `Keypair.generate()` for `generateVanityMint()` and the rest of the
  216. flow is unchanged.
  217. ```typescript
  218. import { generateVanityMint, PUMP_SDK } from "@nirholas/pump-sdk";
  219. // Grind until we find a mint whose address ends in "pump" (~11M attempts, ~1–4 min in Node)
  220. const { keypair: mintKeypair } = await generateVanityMint({ suffix: "pump" });
  221. const createIx = await PUMP_SDK.createV2Instruction({
  222. mint: mintKeypair.publicKey, // ← ends in "pump"
  223. name: "My Token",
  224. symbol: "MYTKN",
  225. uri: "https://arweave.net/metadata.json",
  226. creator: wallet.publicKey,
  227. user: wallet.publicKey,
  228. mayhemMode: false,
  229. });
  230. // Sign the transaction with BOTH the payer and the mint keypair.
  231. // tx.sign([wallet, mintKeypair]);
  232. ```
  233. Supports `prefix`, `suffix`, `caseInsensitive`, `maxAttempts`, `onProgress`,
  234. and `AbortSignal`. For patterns longer than 4 characters, use the
  235. multi-threaded Rust generator at [`rust/`](rust/). See
  236. [Tutorial 13: Vanity Mints](tutorials/13-vanity-addresses.md) for the full
  237. end-to-end flow and a runnable devnet example.
  238. ### Buy Tokens on the Bonding Curve
  239. ```typescript
  240. import { Connection, PublicKey } from "@solana/web3.js";
  241. import BN from "bn.js";
  242. import { getBuyTokenAmountFromSolAmount, OnlinePumpSdk } from "@nirholas/pump-sdk";
  243. const connection = new Connection("https://api.mainnet-beta.solana.com");
  244. const sdk = new OnlinePumpSdk(connection);
  245. const mint = new PublicKey("TokenMintAddress...");
  246. const user = wallet.publicKey;
  247. // Fetch all required state in parallel — buyState includes tokenProgram (auto-detected)
  248. const [buyState, global, feeConfig] = await Promise.all([
  249. sdk.fetchBuyState(mint, user),
  250. sdk.fetchGlobal(),
  251. sdk.fetchFeeConfig(),
  252. ]);
  253. assert(!buyState.bondingCurve.complete, "Token has already graduated to AMM");
  254. // Calculate expected tokens for 0.1 SOL
  255. const solAmount = new BN(100_000_000); // 0.1 SOL in lamports
  256. const expectedTokens = getBuyTokenAmountFromSolAmount({
  257. global,
  258. feeConfig,
  259. mintSupply: buyState.bondingCurve.tokenTotalSupply,
  260. bondingCurve: buyState.bondingCurve,
  261. amount: solAmount,
  262. });
  263. // buyState spreads: bondingCurveAccountInfo, bondingCurve, associatedUserAccountInfo, tokenProgram
  264. const buyIxs = await sdk.buyInstructions({
  265. ...buyState,
  266. mint,
  267. user,
  268. amount: expectedTokens,
  269. solAmount,
  270. slippage: 0.05, // 5% slippage tolerance
  271. });
  272. // buyIxs is TransactionInstruction[] — compose into a VersionedTransaction and send
  273. ```
  274. > **Note**: `fetchBuyState` auto-detects whether the token uses SPL Token or Token-2022 and returns `tokenProgram` accordingly. Always spread `...buyState` into `buyInstructions` to ensure the correct program is used.
  275. ### Sell Tokens
  276. ```typescript
  277. import BN from "bn.js";
  278. import { getSellSolAmountFromTokenAmount, OnlinePumpSdk } from "@nirholas/pump-sdk";
  279. const sdk = new OnlinePumpSdk(connection);
  280. // Fetch required state in parallel
  281. // Pass buyState.tokenProgram if you have it to avoid a second mint account fetch
  282. const [sellState, global, feeConfig] = await Promise.all([
  283. sdk.fetchSellState(mint, user),
  284. sdk.fetchGlobal(),
  285. sdk.fetchFeeConfig(),
  286. ]);
  287. const tokenAmount = new BN(1_000_000_000); // amount in raw units (6 decimals)
  288. const expectedSol = getSellSolAmountFromTokenAmount({
  289. global,
  290. feeConfig,
  291. mintSupply: sellState.bondingCurve.tokenTotalSupply,
  292. bondingCurve: sellState.bondingCurve,
  293. amount: tokenAmount,
  294. });
  295. // sellState spreads: bondingCurveAccountInfo, bondingCurve, tokenProgram
  296. const sellIxs = await sdk.sellInstructions({
  297. ...sellState,
  298. mint,
  299. user,
  300. amount: tokenAmount,
  301. solAmount: expectedSol,
  302. slippage: 0.05,
  303. });
  304. ```
  305. > **Note**: `fetchSellState` returns `tokenProgram` (auto-detected from the mint). Always spread `...sellState` into `sellInstructions`.
  306. ### Check Graduation Progress
  307. ```typescript
  308. import { OnlinePumpSdk } from "@nirholas/pump-sdk";
  309. const sdk = new OnlinePumpSdk(connection);
  310. const progress = await sdk.fetchGraduationProgress(mint);
  311. console.log(`Progress: ${progress.progressBps / 100}%`);
  312. console.log(`Graduated: ${progress.isGraduated}`);
  313. console.log(`Tokens remaining: ${progress.tokensRemaining.toString()}`);
  314. console.log(`SOL accumulated: ${progress.solAccumulated.toString()}`);
  315. ```
  316. ### Set Up Fee Sharing
  317. ```typescript
  318. import { PublicKey } from "@solana/web3.js";
  319. import { PUMP_SDK } from "@nirholas/pump-sdk";
  320. // Create a fee sharing config (creator only, before or after graduation)
  321. const createConfigIx = await PUMP_SDK.createFeeSharingConfig({
  322. creator: wallet.publicKey,
  323. mint: tokenMint,
  324. pool: null, // null for pre-graduation tokens
  325. });
  326. // Update shareholders (must total exactly 10,000 BPS = 100%)
  327. const updateIx = await PUMP_SDK.updateFeeShares({
  328. authority: wallet.publicKey,
  329. mint: tokenMint,
  330. currentShareholders: [wallet.publicKey],
  331. newShareholders: [
  332. { address: wallet.publicKey, shareBps: 7000 }, // 70%
  333. { address: new PublicKey("Partner..."), shareBps: 3000 }, // 30%
  334. ],
  335. });
  336. ```
  337. > **Warning**: Shares must total **exactly** 10,000 BPS. The SDK throws `InvalidShareTotalError` otherwise. Maximum 10 shareholders.
  338. ---
  339. ## 📚 API Reference
  340. See [docs/api-reference.md](./docs/api-reference.md) for the complete API documentation with full TypeScript signatures, parameters, and examples.
  341. ### Core Classes
  342. | Class | Description |
  343. |-------|-------------|
  344. | `PumpSdk` | Offline instruction builder — no RPC connection required |
  345. | `OnlinePumpSdk` | Extends `PumpSdk` with RPC fetchers for account state |
  346. | `PUMP_SDK` | Pre-instantiated singleton of `PumpSdk` |
  347. ### Bonding Curve Functions
  348. | Function | Returns | Description |
  349. |----------|---------|-------------|
  350. | `getBuyTokenAmountFromSolAmount(...)` | `BN` | Tokens received for a given SOL amount |
  351. | `getBuySolAmountFromTokenAmount(...)` | `BN` | SOL cost for a given token amount |
  352. | `getSellSolAmountFromTokenAmount(...)` | `BN` | SOL received for selling tokens |
  353. | `bondingCurveMarketCap(...)` | `BN` | Current market cap in the quote mint's base units |
  354. | `newBondingCurve(global, quoteMint?, ...)` | `BondingCurve` | Fresh bonding curve from global config, for any quote mint |
  355. | `getBuyV3QuoteAmountFromTokenAmount(...)` | `BN` | `buy_v3` cost, including the post-completion leg of a synthetic migration |
  356. | `getBuyV3TokenAmountFromQuoteAmount(...)` | `BN` | Tokens `buy_exact_quote_in_v3` buys for a quote budget |
  357. | `pumpQuoteReserves(global, quote)` | `{ virtualQuoteReserves, depth }` | Starting reserves `create_v2` derives for a coin quoted in a pump coin |
  358. ### Analytics Functions
  359. | Function | Returns | Description |
  360. |----------|---------|-------------|
  361. | `calculateBuyPriceImpact(...)` | `PriceImpactResult` | Price impact for a buy trade |
  362. | `calculateSellPriceImpact(...)` | `PriceImpactResult` | Price impact for a sell trade |
  363. | `getGraduationProgress(...)` | `GraduationProgress` | Bonding curve completion percentage |
  364. | `getTokenPrice(...)` | `TokenPriceInfo` | Current buy/sell price per token |
  365. | `getBondingCurveSummary(...)` | `BondingCurveSummary` | Complete bonding curve overview |
  366. ### Fee Functions
  367. | Function | Returns | Description |
  368. |----------|---------|-------------|
  369. | `getFee(...)` | `BN` | Fee amount for a trade |
  370. | `computeFeesBps(...)` | `CalculatedFeesBps` | Current fee basis points (protocol + creator) |
  371. | `calculateFeeTier(...)` | `Fees` | Fee tier for a given market cap |
  372. | `selectCurveFeeSchedule(...)` | `Fees` | Fee schedule by quote mint (SOL-like tiers, stable tiers, or exotic flat fees) |
  373. ### October 2026 Program Upgrade (3.0.0)
  374. | Builder | Description |
  375. |---------|-------------|
  376. | `buyV3Instructions` / `buyExactQuoteInV3Instructions` / `sellV3Instructions` | v3 curve trades for SOL and token-quoted curves; fees stay on the curve for a sweep |
  377. | `buyV2Instructions` / `buyExactQuoteInV2Instructions` / `sellV2Instructions` | v2 curve trades that pay fees out in the trade; the lane for cashback coins |
  378. | `ammBuyV2Instruction` / `ammBuyExactQuoteInV2Instruction` / `ammSellV2Instruction` | PumpSwap v2 trades; fees stay in the pool for a sweep |
  379. | `multiHopSwapInstructions` | One exact-input route through pump pools and pump-coin quoted curves |
  380. | `sweepCreatorFeeInstruction` / `ammSweepCreatorFeeInstruction` (and the protocol variants) | Pay fees left by v3 / v2 trades out to the creator vault or protocol recipients |
  381. | `OnlinePumpSdk.creatorFeeSweepInstructions(mint, payer)` | Exactly the sweeps a coin needs before a distribution, CTO or fee-share change |
  382. | `createV2Instruction({ quoteMint, pumpQuote, ... })` | Launch a coin quoted in a whitelisted, `QuoteControl`-listed, or pump coin mint |
  383. Program guides for each are in [docs/pump-official/docs/instructions](./docs/pump-official/docs/instructions); the SDK side is in [docs/api-reference.md](./docs/api-reference.md), [docs/amm-trading.md](./docs/amm-trading.md) and [docs/bonding-curve-math.md](./docs/bonding-curve-math.md). Upgrading from 2.x: see the 3.0.0 entry in [CHANGELOG.md](./CHANGELOG.md).
  384. ### Token Incentive Functions
  385. | Function | Returns | Description |
  386. |----------|---------|-------------|
  387. | `totalUnclaimedTokens(...)` | `BN` | Unclaimed $PUMP reward tokens |
  388. | `currentDayTokens(...)` | `BN` | Tokens earned today |
  389. ---
  390. ## 🔗 On-Chain Programs
  391. | Program | ID | Purpose |
  392. |---------|----|---------|
  393. | **Pump** | `6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P` | Bonding curve creation, buying, selling, migration |
  394. | **PumpAMM** | `pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA` | Graduated AMM pools — trading, liquidity, fees |
  395. | **PumpFees** | `pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ` | Fee sharing config and social fee PDAs |
  396. ---
  397. ## 🔧 Configuration
  398. ### Constructor
  399. The SDK has no required environment variables. You configure it via the constructor:
  400. | Parameter | Type | Required | Description |
  401. |-----------|------|----------|-------------|
  402. | `connection` | `Connection` | Only for `OnlinePumpSdk` | Solana RPC connection |
  403. ### Key Constants
  404. | Constant | Value | Description |
  405. |----------|-------|-------------|
  406. | `PUMP_PROGRAM_ID` | `6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P` | Main Pump program |
  407. | `PUMP_AMM_PROGRAM_ID` | `pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA` | AMM program |
  408. | `PUMP_FEE_PROGRAM_ID` | `pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ` | Fee program |
  409. | `PUMP_TOKEN_MINT` | `pumpCmXqMfrsAkQ5r49WcJnRayYRqmXz6ae8H7H9Dfn` | $PUMP token mint |
  410. | `MAX_SHAREHOLDERS` | `10` | Maximum shareholders in fee sharing |
  411. | `ONE_BILLION_SUPPLY` | `1000000000000000` | 1B tokens with 6 decimals |
  412. | `BONDING_CURVE_NEW_SIZE` | `151` | Bonding curve account size in bytes |
  413. ---
  414. ## ⚠️ Error Handling
  415. The SDK defines typed errors for fee sharing validation:
  416. | Error | Cause | Fix |
  417. |-------|-------|-----|
  418. | `NoShareholdersError` | Empty shareholders array | Provide at least 1 shareholder |
  419. | `TooManyShareholdersError` | More than 10 shareholders | Reduce to ≤ 10 shareholders |
  420. | `ZeroShareError` | A shareholder has 0 or negative BPS | Set all shares to positive values |
  421. | `InvalidShareTotalError` | Shares don't sum to 10,000 BPS | Ensure shares total exactly 10,000 |
  422. | `DuplicateShareholderError` | Same address appears twice | Remove duplicate addresses |
  423. | `ShareCalculationOverflowError` | BPS sum exceeds safe integer range | Check share values |
  424. | `PoolRequiredForGraduatedError` | `pool` is null for a graduated coin | Pass the pool address from `fetchPool()` |
  425. ### Common Pitfalls
  426. > **Warning**: Never use JavaScript `number` for token or lamport amounts. Always use `BN` from bn.js. JavaScript numbers lose precision above 2^53.
  427. > **Warning**: Check `bondingCurve.complete` before trading. If `true`, the token has graduated to AMM — use `ammBuyInstruction`/`ammSellInstruction` instead.
  428. > **Warning**: `createInstruction` is deprecated. Use `createV2Instruction` for all new token creation.
  429. ---
  430. ## ❓ FAQ
  431. **Q: Do I need an RPC connection to use the SDK?**
  432. No. `PumpSdk` (and the `PUMP_SDK` singleton) builds instructions offline. Only use `OnlinePumpSdk` when you need to fetch on-chain state.
  433. **Q: How do I know if a token has graduated to AMM?**
  434. Check `bondingCurve.complete === true` or use `sdk.isGraduated(mint)`. Graduated tokens trade on PumpAMM, not the bonding curve.
  435. **Q: What is `slippage` in buy/sell instructions?**
  436. A decimal fraction (e.g., `0.05` = 5%). The SDK adjusts `maxSolCost` (buy) or `minSolOutput` (sell) to protect against price movement.
  437. **Q: Why do amounts use `BN` instead of `number`?**
  438. Solana token amounts (lamports, token units) regularly exceed JavaScript's safe integer limit (2^53). `BN` provides arbitrary-precision arithmetic.
  439. **Q: What's the difference between Pump and PumpAMM programs?**
  440. Pump handles the bonding curve phase (creation → graduation). PumpAMM handles post-graduation trading with constant-product AMM pools.
  441. **Q: How does fee sharing work?**
  442. Token creators can split their creator fees among up to 10 shareholders. Each shareholder gets a share in basis points (1/10,000). The total must equal exactly 10,000 BPS (100%).
  443. **Q: What is Mayhem Mode?**
  444. A special token creation mode with randomized bonding curve parameters. Tokens created with `mayhemMode: true` have unpredictable pricing dynamics.
  445. **Q: Can I use the SDK in the browser?**
  446. Yes. The SDK has no Node.js-specific dependencies. The ESM build works in modern browsers with a bundler.
  447. ---
  448. ## 🏗️ Architecture
  449. See [docs/architecture.md](./docs/architecture.md) for detailed system design, data flow diagrams, and module explanations.
  450. ---
  451. ## 🤝 Contributing
  452. We welcome contributions! See [CONTRIBUTING.md](./CONTRIBUTING.md) for:
  453. - Development setup
  454. - Branch naming and commit conventions
  455. - Testing requirements
  456. - PR process
  457. ---
  458. ## 📄 License
  459. [Apache-2.0](./LICENSE) © [nirholas](https://github.com/nirholas)
  460. ---
  461. ## 🙏 Acknowledgments
  462. - **[Pump.fun](https://pump.fun)** — The protocol this SDK interfaces with
  463. - **[Solana Labs](https://solana.com)** — Blockchain infrastructure and `@solana/web3.js`
  464. - **[Coral (Anchor)](https://www.anchor-lang.com/)** — IDL-based program interaction via `@coral-xyz/anchor`
  465. - **[bn.js](https://github.com/indutny/bn.js)** — Arbitrary-precision arithmetic for financial math
  466. - **[@pump-fun/pump-swap-sdk](https://www.npmjs.com/package/@pump-fun/pump-swap-sdk)** — AMM swap integration
  467. ## Documentation
  468. Full documentation site: **https://sdk.pumpk.it**
  469. - [Getting started](docs/getting-started.md) covers install and first run.
  470. - [Examples](docs/examples.md) has copy-paste snippets.
  471. ## Star History
  472. [![Star History Chart](https://api.star-history.com/svg?repos=nirholas/pump-fun-sdk&type=Date)](https://www.star-history.com/#nirholas/pump-fun-sdk&Date)
  473. <!-- three.ws:growth -->
  474. ## Support the project
  475. If pump-fun-sdk saves you time, **[star it on GitHub](https://github.com/nirholas/pump-fun-sdk)**. Stars are how other developers and AI agents find the repositories worth trusting, and they cost you one click.
  476. Know someone who would use it? [Post on X](https://twitter.com/intent/tweet?text=pump-fun-sdk%3A%20Token%20creation%20launching%2C%20bonding%20curve%20trading%2C%20AMM%20migration%2C%20tiered%20fees%2C%20creator%20fee%20sharing&url=https%3A%2F%2Fgithub.com%2Fnirholas%2Fpump-fun-sdk) · [Share on Bluesky](https://bsky.app/intent/compose?text=pump-fun-sdk%3A%20Token%20creation%20launching%2C%20bonding%20curve%20trading%2C%20AMM%20migration%2C%20tiered%20fees%2C%20creator%20fee%20sharing%20https%3A%2F%2Fgithub.com%2Fnirholas%2Fpump-fun-sdk) · [Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fgithub.com%2Fnirholas%2Fpump-fun-sdk) · [Submit to Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fgithub.com%2Fnirholas%2Fpump-fun-sdk&t=pump-fun-sdk%3A%20Token%20creation%20launching%2C%20bonding%20curve%20trading%2C%20AMM%20migration%2C%20tiered%20fees%2C%20creator%20fee%20sharing) · [Share on Reddit](https://www.reddit.com/submit?url=https%3A%2F%2Fgithub.com%2Fnirholas%2Fpump-fun-sdk&title=pump-fun-sdk%3A%20Token%20creation%20launching%2C%20bonding%20curve%20trading%2C%20AMM%20migration%2C%20tiered%20fees%2C%20creator%20fee%20sharing)
  477. ## Built for AI agents too
  478. Coding agents and LLM tooling can read this repo directly: [AGENTS.md](./AGENTS.md), [llms.txt](./llms.txt), [llms-full.txt](./llms-full.txt). Point an agent at `https://github.com/nirholas/pump-fun-sdk` and it has the context it needs.
  479. ## More from the same author
  480. - [All repositories by nirholas](https://github.com/nirholas/nirholas#readme): the full catalog, grouped by topic
  481. - [three.ws](https://three.ws): the platform for 3D AI agents with Solana wallets, a skill marketplace and x402 payments
  482. - Questions or ideas: [open an issue](https://github.com/nirholas/pump-fun-sdk/issues) or [start a discussion](https://github.com/nirholas/pump-fun-sdk/discussions)
  483. ## Contributors
  484. [![Contributors](https://contrib.rocks/image?repo=nirholas/pump-fun-sdk)](https://github.com/nirholas/pump-fun-sdk/graphs/contributors)
  485. <!-- /three.ws:growth -->
  486. <!-- nirholas:watermark -->
  487. ---
  488. <p align="center">
  489. Built by <a href="https://github.com/nirholas"><b>nirholas</b></a> · <a href="https://x.com/nichxbt">@nichxbt</a> · <a href="https://github.com/nirholas">github.com/nirholas</a>
  490. </p>
  491. <!-- /nirholas:watermark -->

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.