The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Pump SDK MCP Server listing page.
TypeScript SDK for the Pump protocol on Solana — token creation, bonding curves, AMM pools, fee sharing, and volume rewards.
Pump SDK is the community TypeScript SDK for the 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.
The SDK never sends transactions itself. It returns TransactionInstruction[] that you compose into transactions with your preferred signing and sending strategy.
pump CLIProof the GitHub Claim Tracker bot is profitable to monitor
→ View tweet
Went mega viral
→ View tweet
just shipped a real-time PumpFun intelligence bot on Telegram
17 commands. zero cost. fully on-chain.
/price→ instant token price & bonding curve
/monitor→ live token launch feed
/cto→ creator takeover alerts
/watch→ wallet fee claim tracking
/quote→ buy/sell estimates
/graduated→ AMM graduation status
/alerts→ customize your notificationsall powered by the open-source pump-fun-sdk
The post that started it all
→ View tweet
Open-source framework for building PumpFun Telegram bots on Solana. Claim monitors, channel feeds, group trackers, whale alerts — build your own or use ours.
The SDK requires these Solana packages (install them if not already present):
pump CLIThe SDK ships with a binary. No wallet, no API key, and no configuration are needed for anything that reads the chain.
Or without installing anything: npx -p @nirholas/pump-sdk pump curve <mint>.
| Command | What it does |
|---|---|
pump curve / price / pool / global | Read curve, price, AMM pool, and protocol state |
pump quote buy|sell | Price a trade offline: output, fees, effective price, impact |
pump buy / sell | Trade, auto-routing between the bonding curve and PumpAMM |
pump create | Launch a token, optionally with an atomic first buy |
pump vanity | Grind a ...pump mint address |
pump fees / incentives | Check and claim creator fees and volume rewards |
pump watch | Live-refreshing dashboard, or a JSON price feed |
pump events | Decode the Pump events in any transaction |
pump pda | Derive any Pump program address |
pump doctor / config | Diagnose and configure |
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.
Scriptable. Every command takes --json and writes nothing else to stdout in that mode:
Full reference: docs/cli.md. Ten-minute walkthrough: tutorial 45.
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.
| Range | Category |
|---|---|
| 01-10 | Token Lifecycle: create, buy, sell, mayhem mode, cashback |
| 11-20 | Curve Math & Fees: offline quotes, tiers, price impact |
| 21-30 | Accounts & Events: every PDA, every decoder |
| 31-40 | Live Data: mainnet reads, batching, WebSocket feeds |
| 41-50 | AMM & Advanced: pools, liquidity, fee sharing, incentives, vanity mints |
Full catalog: docs/examples.md · Browse: examples/ · Tutorials: tutorials/examples/
Warning: Do NOT use
createInstruction— it is deprecated (v1). Always usecreateV2Instruction.
...pump Vanity MintMint addresses ending in pump (like the ones on pump.fun) are produced by
grinding keypairs off-chain. The SDK exposes this as a first-class helper —
swap Keypair.generate() for generateVanityMint() and the rest of the
flow is unchanged.
Supports prefix, suffix, caseInsensitive, maxAttempts, onProgress,
and AbortSignal. For patterns longer than 4 characters, use the
multi-threaded Rust generator at rust/. See
Tutorial 13: Vanity Mints for the full
end-to-end flow and a runnable devnet example.
Note:
fetchBuyStateauto-detects whether the token uses SPL Token or Token-2022 and returnstokenProgramaccordingly. Always spread...buyStateintobuyInstructionsto ensure the correct program is used.
Note:
fetchSellStatereturnstokenProgram(auto-detected from the mint). Always spread...sellStateintosellInstructions.
Warning: Shares must total exactly 10,000 BPS. The SDK throws
InvalidShareTotalErrorotherwise. Maximum 10 shareholders.
See docs/api-reference.md for the complete API documentation with full TypeScript signatures, parameters, and examples.
| Class | Description |
|---|---|
PumpSdk | Offline instruction builder — no RPC connection required |
OnlinePumpSdk | Extends PumpSdk with RPC fetchers for account state |
PUMP_SDK | Pre-instantiated singleton of PumpSdk |
| Function | Returns | Description |
|---|---|---|
getBuyTokenAmountFromSolAmount(...) | BN | Tokens received for a given SOL amount |
getBuySolAmountFromTokenAmount(...) | BN | SOL cost for a given token amount |
getSellSolAmountFromTokenAmount(...) | BN | SOL received for selling tokens |
bondingCurveMarketCap(...) | BN | Current market cap in lamports |
newBondingCurve(global) | BondingCurve | Fresh bonding curve from global config |
| Function | Returns | Description |
|---|---|---|
calculateBuyPriceImpact(...) | PriceImpactResult | Price impact for a buy trade |
calculateSellPriceImpact(...) | PriceImpactResult | Price impact for a sell trade |
getGraduationProgress(...) | GraduationProgress | Bonding curve completion percentage |
getTokenPrice(...) | TokenPriceInfo | Current buy/sell price per token |
getBondingCurveSummary(...) | BondingCurveSummary | Complete bonding curve overview |
| Function | Returns | Description |
|---|---|---|
getFee(...) | BN | Fee amount for a trade |
computeFeesBps(...) | CalculatedFeesBps | Current fee basis points (protocol + creator) |
calculateFeeTier(...) | Fees | Fee tier for a given market cap |
| Function | Returns | Description |
|---|---|---|
totalUnclaimedTokens(...) | BN | Unclaimed $PUMP reward tokens |
currentDayTokens(...) | BN | Tokens earned today |
| Program | ID | Purpose |
|---|---|---|
| Pump | 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P | Bonding curve creation, buying, selling, migration |
| PumpAMM | pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA | Graduated AMM pools — trading, liquidity, fees |
| PumpFees | pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ | Fee sharing config and social fee PDAs |
The SDK has no required environment variables. You configure it via the constructor:
| Parameter | Type | Required | Description |
|---|---|---|---|
connection | Connection | Only for OnlinePumpSdk | Solana RPC connection |
| Constant | Value | Description |
|---|---|---|
PUMP_PROGRAM_ID | 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P | Main Pump program |
PUMP_AMM_PROGRAM_ID | pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA | AMM program |
PUMP_FEE_PROGRAM_ID | pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ | Fee program |
PUMP_TOKEN_MINT | pumpCmXqMfrsAkQ5r49WcJnRayYRqmXz6ae8H7H9Dfn | $PUMP token mint |
MAX_SHAREHOLDERS | 10 | Maximum shareholders in fee sharing |
ONE_BILLION_SUPPLY | 1000000000000000 | 1B tokens with 6 decimals |
BONDING_CURVE_NEW_SIZE | 151 | Bonding curve account size in bytes |
The SDK defines typed errors for fee sharing validation:
| Error | Cause | Fix |
|---|---|---|
NoShareholdersError | Empty shareholders array | Provide at least 1 shareholder |
TooManyShareholdersError | More than 10 shareholders | Reduce to ≤ 10 shareholders |
ZeroShareError | A shareholder has 0 or negative BPS | Set all shares to positive values |
InvalidShareTotalError | Shares don't sum to 10,000 BPS | Ensure shares total exactly 10,000 |
DuplicateShareholderError | Same address appears twice | Remove duplicate addresses |
ShareCalculationOverflowError | BPS sum exceeds safe integer range | Check share values |
PoolRequiredForGraduatedError | pool is null for a graduated coin | Pass the pool address from fetchPool() |
Warning: Never use JavaScript
numberfor token or lamport amounts. Always useBNfrom bn.js. JavaScript numbers lose precision above 2^53.
Warning: Check
bondingCurve.completebefore trading. Iftrue, the token has graduated to AMM — useammBuyInstruction/ammSellInstructioninstead.
Warning:
createInstructionis deprecated. UsecreateV2Instructionfor all new token creation.
Q: Do I need an RPC connection to use the SDK?
No. PumpSdk (and the PUMP_SDK singleton) builds instructions offline. Only use OnlinePumpSdk when you need to fetch on-chain state.
Q: How do I know if a token has graduated to AMM?
Check bondingCurve.complete === true or use sdk.isGraduated(mint). Graduated tokens trade on PumpAMM, not the bonding curve.
Q: What is slippage in buy/sell instructions?
A decimal fraction (e.g., 0.05 = 5%). The SDK adjusts maxSolCost (buy) or minSolOutput (sell) to protect against price movement.
Q: Why do amounts use BN instead of number?
Solana token amounts (lamports, token units) regularly exceed JavaScript's safe integer limit (2^53). BN provides arbitrary-precision arithmetic.
Q: What's the difference between Pump and PumpAMM programs? Pump handles the bonding curve phase (creation → graduation). PumpAMM handles post-graduation trading with constant-product AMM pools.
Q: How does fee sharing work? 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%).
Q: What is Mayhem Mode?
A special token creation mode with randomized bonding curve parameters. Tokens created with mayhemMode: true have unpredictable pricing dynamics.
Q: Can I use the SDK in the browser? Yes. The SDK has no Node.js-specific dependencies. The ESM build works in modern browsers with a bundler.
See docs/architecture.md for detailed system design, data flow diagrams, and module explanations.
We welcome contributions! See CONTRIBUTING.md for:
@solana/web3.js@coral-xyz/anchorFull documentation site: https://nirholas.github.io/pump-fun-sdk/