Skip to content

livebythecode-dev/pump-fun-sdk

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

459 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—   β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—  β–ˆβ–ˆβ•—
β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—    β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β–ˆβ–ˆβ–ˆβ–ˆβ•”β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• 
β–ˆβ–ˆβ•”β•β•β•β• β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•     β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•— 
β–ˆβ–ˆβ•‘     β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β•šβ•β• β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘         β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•—
β•šβ•β•      β•šβ•β•β•β•β•β• β•šβ•β•     β•šβ•β•β•šβ•β•         β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β• β•šβ•β•  β•šβ•β•

Pump SDK β€” A Community Solana SDK for the Pump Protocol

A community TypeScript SDK for the Pump protocol on Solana

Token Creation Β Β·Β  Bonding Curves Β Β·Β  AMM Trading Β Β·Β  Liquidity Β Β·Β  Fee Sharing Β Β·Β  Cashback Β Β·Β  Social Fees
Create, trade, provide liquidity, and manage fees β€” all from TypeScript.
Now with real-time WebSocket relay, live dashboards, Telegram bot, and social fee integrations.

npm versionΒ  npm downloadsΒ  MIT LicenseΒ  Stars

SolanaΒ  TypeScriptΒ  MCP ServerΒ  Rust CLIΒ  WebSocket RelayΒ  Telegram BotΒ  Live Dashboards


Docs Β Β·Β  npm Β Β·Β  API Ref Β Β·Β  Examples Β Β·Β  Tutorials Β Β·Β  MCP Server Β Β·Β  Telegram Bot Β Β·Β  Live Dashboard


⚑ See it in action

Pump SDK β€” create tokens, buy on bonding curve, submit transactions

πŸ“– Table of Contents


πŸ† Why Pump SDK?

Pump SDK Manual RPC Generic DEX SDKs
Bonding curve mathβœ… Built-in❌ DIY❌ Not supported
Token graduationβœ… Automatic❌ DIY❌ Not supported
AMM liquidityβœ… Deposit & withdraw❌ DIY⚠️ Limited
Fee sharingβœ… Up to 10 shareholders❌ DIY❌ Not supported
Cashback rewardsβœ… Pump + AMM❌ DIY❌ Not supported
Social fee PDAsβœ… Create & claim❌ DIY❌ Not supported
Volume rewardsβœ… Track & claim❌ DIY❌ Not supported
Offline modeβœ… No connection needed❌ Always online⚠️ Partial
TypeScript typesβœ… Full IDL types❌ None⚠️ Partial
Analyticsβœ… Price impact, graduation❌ DIY⚠️ Partial
MCP serverβœ… 53 tools for AI agents❌❌
Real-time feedβœ… WebSocket relay❌ DIY❌
Telegram botβœ… Claims + CTO + API❌❌
DeFi agentsβœ… 43 agent definitions❌❌
x402 paymentsβœ… HTTP 402 + USDC❌❌
Tutorialsβœ… 19 guides❌❌
4 programsβœ… Pump + AMM + Fees + Mayhem⚠️ Manual❌ Not supported

✨ Features

πŸš€ Token Creation

  • Launch tokens on bonding curves with one instruction
  • Create + buy atomically in a single transaction
  • Mayhem mode for alternate routing
  • Cashback opt-in at creation time

πŸ“ˆ Trading

  • Buy & sell on bonding curves with slippage protection
  • AMM buy, sell, exact-quote-in for graduated tokens
  • Buy with exact SOL input (buyExactSolIn)
  • Automatic graduated token detection

πŸ’± AMM Liquidity

  • Deposit into graduated AMM pools
  • Withdraw liquidity with min-amount guards
  • Migrate pool creator between wallets
  • Transfer creator fees from AMM β†’ Pump vault

πŸ’° Fee System

  • Collect creator fees across both programs
  • Split fees among up to 10 shareholders
  • Market-cap-based fee tiers (upsert dynamically)
  • Transfer, revoke, or reset fee-sharing authority

🎁 Rewards & Cashback

  • Volume rewards β€” earn tokens from trading SOL
  • Cashback β€” claim on both Pump and AMM programs
  • Social fee PDAs β€” per-user/platform fee accounts
  • Track daily & cumulative rewards

πŸ”§ Developer Experience

  • Offline SDK β€” no connection needed for instructions
  • Online SDK β€” fetch state + build transactions
  • 42 instruction builders, full TypeScript types via Anchor IDL
  • 53 MCP tools for AI assistant integration

πŸ“Š Analytics

  • Price impact calculation (buy & sell)
  • Graduation progress tracking
  • Token price quoting
  • Bonding curve summaries

πŸ“‘ Real-Time & Payments

  • WebSocket relay for live token launches
  • Live trading dashboards with analytics
  • Telegram bot: fee claims, CTO, whale, graduation alerts
  • x402 HTTP 402 micropayments (Solana USDC)
  • Lair: unified DeFi intelligence bot platform
  • 19 hands-on tutorials covering every feature

πŸ“¦ Installation

npm
npm install @pump-fun/pump-sdk
yarn
yarn add @pump-fun/pump-sdk
pnpm
pnpm add @pump-fun/pump-sdk

Peer Dependencies

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

πŸš€ Quick Start

import { Connection, Keypair, Transaction, sendAndConfirmTransaction } from "@solana/web3.js";
import BN from "bn.js";
import {
  OnlinePumpSdk,
  PUMP_SDK,
  getBuyTokenAmountFromSolAmount,
} from "@pump-fun/pump-sdk";

// 1. Connect
const connection = new Connection("https://api.devnet.solana.com", "confirmed");
const sdk = new OnlinePumpSdk(connection);

// 2. Create a token and buy in one transaction
const mint = Keypair.generate();
const global = await sdk.fetchGlobal();
const feeConfig = await sdk.fetchFeeConfig();
const solAmount = new BN(0.5 * 1e9); // 0.5 SOL

const tokenAmount = getBuyTokenAmountFromSolAmount({
  global, feeConfig, mintSupply: null, bondingCurve: null, amount: solAmount,
});

const instructions = await PUMP_SDK.createV2AndBuyInstructions({
  global,
  mint: mint.publicKey,
  name: "My Token",
  symbol: "MTK",
  uri: "https://example.com/metadata.json",
  creator: wallet.publicKey,
  user: wallet.publicKey,
  amount: tokenAmount,
  solAmount,
  mayhemMode: false,
});

// 3. Send it
const tx = new Transaction().add(...instructions);
const sig = await sendAndConfirmTransaction(connection, tx, [wallet, mint]);
console.log("Created & bought:", sig);

Tip

πŸ€– AI Coding Assistants: Building on Pump protocol?

  • npm install @pump-fun/pump-sdk β€” Token creation, trading, fee sharing
  • Works with Claude, GPT, Cursor via MCP server
  • See AGENTS.md for integration instructions

πŸ”„ Token Lifecycle

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     Bonding Curve        β”‚    graduation           β”‚      AMM Pool         β”‚
β”‚     (Pump Program)       β”‚ ─────────────────────►  β”‚      (PumpAMM Program β”‚
β”‚                          β”‚   complete = true       β”‚                       β”‚
β”‚  β€’ createV2              β”‚                         β”‚  β€’ Pool-based swap    β”‚
β”‚  β€’ buy / sell            β”‚                         β”‚  β€’ LP fees            β”‚
β”‚  β€’ Price discovery       β”‚                         β”‚  β€’ Graduated trading  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Phase What Happens SDK Method
1. Create Token starts on a bonding curve createV2Instruction()
2. Trade Users buy & sell; price follows the curve buyInstructions() / sellInstructions()
3. Graduate bondingCurve.complete becomes true Auto-detected
4. Migrate Token moves to an AMM pool migrateInstruction()
5. AMM Trade Pool-based buy & sell ammBuyInstruction() / ammSellInstruction()
6. LP Deposit/withdraw liquidity ammDepositInstruction() / ammWithdrawInstruction()
7. Fees Collect & share creator fees collectCoinCreatorFeeInstructions()
8. Rewards Volume rewards + cashback claimTokenIncentivesBothPrograms()

πŸ’» Usage

Buy and sell transaction flow

Create a Token

import { Keypair } from "@solana/web3.js";
import { PUMP_SDK } from "@pump-fun/pump-sdk";

const mint = Keypair.generate();

const instruction = await PUMP_SDK.createV2Instruction({
  mint: mint.publicKey,
  name: "My Token",
  symbol: "MTK",
  uri: "https://example.com/metadata.json",
  creator: wallet.publicKey,
  user: wallet.publicKey,
  mayhemMode: false,
});
Create + Buy atomically
import BN from "bn.js";
import { getBuyTokenAmountFromSolAmount } from "@pump-fun/pump-sdk";

const global = await sdk.fetchGlobal();
const feeConfig = await sdk.fetchFeeConfig();
const solAmount = new BN(0.5 * 1e9); // 0.5 SOL

const tokenAmount = getBuyTokenAmountFromSolAmount({
  global, feeConfig, mintSupply: null, bondingCurve: null, amount: solAmount,
});

const instructions = await PUMP_SDK.createV2AndBuyInstructions({
  global,
  mint: mint.publicKey,
  name: "My Token",
  symbol: "MTK",
  uri: "https://example.com/metadata.json",
  creator: wallet.publicKey,
  user: wallet.publicKey,
  amount: tokenAmount,
  solAmount,
  mayhemMode: false,
});

const tx = new Transaction().add(...instructions);
const sig = await sendAndConfirmTransaction(connection, tx, [wallet, mint]);

Buy Tokens

import BN from "bn.js";
import { getBuyTokenAmountFromSolAmount, PUMP_SDK } from "@pump-fun/pump-sdk";

const mint = new PublicKey("...");
const user = wallet.publicKey;
const solAmount = new BN(0.1 * 1e9); // 0.1 SOL

const global = await sdk.fetchGlobal();
const feeConfig = await sdk.fetchFeeConfig();
const { bondingCurveAccountInfo, bondingCurve, associatedUserAccountInfo } =
  await sdk.fetchBuyState(mint, user);

const tokenAmount = getBuyTokenAmountFromSolAmount({
  global, feeConfig,
  mintSupply: bondingCurve.tokenTotalSupply,
  bondingCurve, amount: solAmount,
});

const instructions = await PUMP_SDK.buyInstructions({
  global, bondingCurveAccountInfo, bondingCurve, associatedUserAccountInfo,
  mint, user, solAmount, amount: tokenAmount,
  slippage: 2, // 2% slippage tolerance
});

Sell Tokens

import { getSellSolAmountFromTokenAmount, PUMP_SDK } from "@pump-fun/pump-sdk";

const { bondingCurveAccountInfo, bondingCurve } = await sdk.fetchSellState(mint, user);
const sellAmount = new BN(15_828);

const instructions = await PUMP_SDK.sellInstructions({
  global, bondingCurveAccountInfo, bondingCurve, mint, user,
  amount: sellAmount,
  solAmount: getSellSolAmountFromTokenAmount({
    global, feeConfig,
    mintSupply: bondingCurve.tokenTotalSupply,
    bondingCurve, amount: sellAmount,
  }),
  slippage: 1,
});

Creator Fees

// Check accumulated fees across both programs
const balance = await sdk.getCreatorVaultBalanceBothPrograms(wallet.publicKey);
console.log("Creator fees:", balance.toString(), "lamports");

// Collect fees
const instructions = await sdk.collectCoinCreatorFeeInstructions(wallet.publicKey);
Fee Sharing β€” split fees among shareholders

Split creator fees among up to 10 shareholders. See the full Fee Sharing Guide.

import { PUMP_SDK, isCreatorUsingSharingConfig } from "@pump-fun/pump-sdk";

// 1. Create a sharing config
const ix = await PUMP_SDK.createFeeSharingConfig({ creator: wallet.publicKey, mint, pool: null });

// 2. Set shareholders (shares must total 10,000 bps = 100%)
const ix2 = await PUMP_SDK.updateFeeShares({
  authority: wallet.publicKey,
  mint,
  currentShareholders: [],
  newShareholders: [
    { address: walletA, shareBps: 5000 }, // 50%
    { address: walletB, shareBps: 3000 }, // 30%
    { address: walletC, shareBps: 2000 }, // 20%
  ],
});

// 3. Check & distribute
const result = await sdk.getMinimumDistributableFee(mint);
if (result.canDistribute) {
  const { instructions } = await sdk.buildDistributeCreatorFeesInstructions(mint);
  const tx = new Transaction().add(...instructions);
}
Token Incentives β€” earn rewards from trading volume

Earn token rewards based on SOL trading volume. See the full Token Incentives Guide.

import { PUMP_SDK } from "@pump-fun/pump-sdk";

// Initialize volume tracking (one-time)
const ix = await PUMP_SDK.initUserVolumeAccumulator({
  payer: wallet.publicKey,
  user: wallet.publicKey,
});

// Check unclaimed rewards
const rewards = await sdk.getTotalUnclaimedTokensBothPrograms(wallet.publicKey);
console.log("Unclaimed rewards:", rewards.toString());

// Claim rewards
const instructions = await sdk.claimTokenIncentivesBothPrograms(
  wallet.publicKey, wallet.publicKey,
);
AMM Trading β€” buy & sell graduated tokens

After a token graduates to the AMM, use pool-based trading:

import { PUMP_SDK, canonicalPumpPoolPda } from "@pump-fun/pump-sdk";

const pool = canonicalPumpPoolPda(mint);

// Buy on AMM
const buyIx = await PUMP_SDK.ammBuyInstruction({
  pool,
  user: wallet.publicKey,
  baseAmountOut: new BN(1_000_000), // tokens to receive
  maxQuoteAmountIn: new BN(0.1 * 1e9), // max SOL to spend
});

// Sell on AMM
const sellIx = await PUMP_SDK.ammSellInstruction({
  pool,
  user: wallet.publicKey,
  baseAmountIn: new BN(1_000_000), // tokens to sell
  minQuoteAmountOut: new BN(0.05 * 1e9), // min SOL to receive
});

// Deposit liquidity
const depositIx = await PUMP_SDK.ammDepositInstruction({
  pool,
  user: wallet.publicKey,
  baseTokenAmount: new BN(10_000_000),
  quoteTokenAmount: new BN(1 * 1e9),
  minLpTokenAmount: new BN(1),
});

// Withdraw liquidity
const withdrawIx = await PUMP_SDK.ammWithdrawInstruction({
  pool,
  user: wallet.publicKey,
  lpTokenAmount: new BN(100_000),
  minBaseTokenAmount: new BN(1),
  minQuoteTokenAmount: new BN(1),
});
Cashback β€” claim trading rebates

Claim cashback rewards accrued from trading with cashback-enabled tokens:

// Claim from Pump program
const pumpCashback = await PUMP_SDK.claimCashbackInstruction({
  user: wallet.publicKey,
});

// Claim from AMM program
const ammCashback = await PUMP_SDK.ammClaimCashbackInstruction({
  user: wallet.publicKey,
});
Social Fee PDAs β€” platform-aware fee accounts

Create and claim social fee PDAs for platform integrations:

// Create a social fee PDA for a user on a platform
const createSocialFee = await PUMP_SDK.createSocialFeePdaInstruction({
  payer: wallet.publicKey,
  userId: "user123",
  platform: "twitter",
});

// Claim social fee PDA
const claimSocialFee = await PUMP_SDK.claimSocialFeePdaInstruction({
  claimAuthority: wallet.publicKey,
  recipient: wallet.publicKey,
  userId: "user123",
  platform: "twitter",
});

πŸ“Š Analytics

Offline pure functions for price analysis β€” no RPC calls needed.

import {
  calculateBuyPriceImpact,
  calculateSellPriceImpact,
  getGraduationProgress,
  getTokenPrice,
  getBondingCurveSummary,
} from "@pump-fun/pump-sdk";

// Price impact of buying 1 SOL worth
const impact = calculateBuyPriceImpact({
  global, feeConfig, mintSupply: bondingCurve.tokenTotalSupply,
  bondingCurve, solAmount: new BN(1e9),
});
console.log(`Impact: ${impact.impactBps} bps, tokens: ${impact.outputAmount}`);

// How close to graduation?
const progress = getGraduationProgress(global, bondingCurve);
console.log(`${(progress.progressBps / 100).toFixed(1)}% graduated`);

// Current price per token
const price = getTokenPrice({ global, feeConfig, mintSupply: bondingCurve.tokenTotalSupply, bondingCurve });
console.log(`Buy: ${price.buyPricePerToken} lamports/token`);

// Full summary in one call
const summary = getBondingCurveSummary({ global, feeConfig, mintSupply: bondingCurve.tokenTotalSupply, bondingCurve });

πŸ—οΈ Architecture

Bonding curve price mechanics

The SDK is split into two layers:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        Your Application                          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚      PumpSdk (Offline)       β”‚      OnlinePumpSdk (Online)       β”‚
β”‚                              β”‚                                   β”‚
β”‚  β€’ 42 instruction builders   β”‚  β€’ Fetch on-chain state           β”‚
β”‚  β€’ Decode accounts           β”‚  β€’ Simulate transactions          β”‚
β”‚  β€’ Pure computation          β”‚  β€’ *BothPrograms variants         β”‚
β”‚  β€’ No connection needed      β”‚  β€’ Wraps PumpSdk + Connection     β”‚
β”‚                              β”‚                                   β”‚
β”‚  Export: PUMP_SDK singleton   β”‚  Export: OnlinePumpSdk class      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  bondingCurve.ts β”‚ analytics.ts β”‚ fees.ts β”‚ pda.ts β”‚ state.ts β”‚ tokenIncentives.ts β”‚
β”‚  tokenIncentives.ts β”‚ errors.ts                                  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚     Anchor IDLs: pump β”‚ pump_amm β”‚ pump_fees β”‚ mayhem            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Module map
src/
β”œβ”€β”€ index.ts            # Public API β€” re-exports everything
β”œβ”€β”€ sdk.ts              # PumpSdk β€” 42 instruction builders, 14 account decoders, 27 event decoders
β”œβ”€β”€ onlineSdk.ts        # OnlinePumpSdk β€” fetchers + BothPrograms aggregators
β”œβ”€β”€ bondingCurve.ts     # Pure math for price quoting
β”œβ”€β”€ analytics.ts        # Price impact, graduation progress, token price, bonding curve summary
β”œβ”€β”€ fees.ts             # Fee tier calculation logic
β”œβ”€β”€ errors.ts           # Custom error classes
β”œβ”€β”€ pda.ts              # PDA derivation helpers (incl. socialFeePda)
β”œβ”€β”€ state.ts            # 40+ TypeScript types for on-chain accounts & events
β”œβ”€β”€ tokenIncentives.ts  # Volume-based reward calculations
└── idl/                # Anchor IDLs for all three programs
    β”œβ”€β”€ pump.ts / pump.json           # 29 instructions
    β”œβ”€β”€ pump_amm.ts / pump_amm.json   # 25 instructions
    └── pump_fees.ts / pump_fees.json # 17 instructions

πŸ”— Programs

The SDK interacts with four on-chain Solana programs:

Program Address Purpose
Pump 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P Token creation, bonding curve buy/sell
PumpAMM pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA AMM pools for graduated tokens
PumpFees pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ Fee sharing configuration & distribution
Mayhem MAyhSmzXzV1pTf7LsNkrNwkWKTo4ougAJ1PPg47MD4e Alternate routing mode

πŸ“‘ WebSocket Relay Server

The WebSocket relay server connects to PumpFun's API, parses new token launches, and broadcasts structured events to browser clients.

cd websocket-server && npm install && npm run dev

Architecture: PumpFun API ◀── SolanaMonitor ──▢ Relay Server (:3099/ws) ──▢ Browsers

Production: wss://pump-fun-websocket-production.up.railway.app/ws

See websocket-server/README.md for setup, message format, and deployment.


πŸ“Š Live Dashboards

Two standalone dashboards in live/ for real-time PumpFun monitoring β€” powered by the WebSocket relay:

Dashboard File Description
Token Launches live/index.html Decodes full Anchor CreateEvent data β€” name, symbol, creator, market cap
Trades live/trades.html Real-time buy/sell feed with analytics, volume charts, whale detection

Both support multi-endpoint failover and custom RPC endpoint input.


πŸ€– MCP Server

The included MCP server exposes 53 tools to AI assistants like Claude, GPT, and Cursor β€” covering the full Pump protocol plus wallet operations.

cd mcp-server && npm install && npm run build
Full tool reference (53 tools)
Category Tools
Wallet generate_keypair, generate_vanity, sign_message, verify_signature, validate_address, estimate_vanity_time, restore_keypair
Price Quoting quote_buy, quote_sell, quote_buy_cost
Bonding Curve get_market_cap, get_bonding_curve
Token Lifecycle build_create_token, build_create_and_buy, build_buy, build_sell, build_sell_all, build_buy_exact_sol, build_migrate
Fee System calculate_fees, get_fee_tier, build_create_fee_sharing, build_update_fee_shares, build_distribute_fees, get_creator_vault_balance, build_collect_creator_fees
Social Fees build_create_social_fee, build_claim_social_fee, build_reset_fee_sharing, build_transfer_fee_authority, build_revoke_fee_authority
Token Incentives build_init_volume_tracker, build_claim_incentives, get_unclaimed_rewards, get_volume_stats
Analytics get_price_impact, get_graduation_progress, get_token_price, get_token_summary, is_graduated, get_token_balance
AMM Trading build_amm_buy, build_amm_sell, build_amm_buy_exact_quote
AMM Liquidity build_amm_deposit, build_amm_withdraw
Cashback build_claim_cashback, build_amm_claim_cashback
Creator build_migrate_creator
State / PDAs derive_pda, fetch_global_state, fetch_fee_config, get_program_ids

Deploys to Railway, Cloudflare Workers, or Vercel. See mcp-server/README.md for setup.


πŸ“‘ Telegram Bot + API

The included Telegram bot monitors PumpFun activity on Solana with real-time notifications:

  • Fee claims & cashback β€” Track creator fee claims and cashback rewards for watched wallets
  • CTO alerts β€” Detect creator fee redirection (creator takeover) events
  • Token launch monitor β€” Real-time detection of new token mints with cashback coin flag
  • πŸŽ“ Graduation alerts β€” Notifies when a token completes its bonding curve or migrates to PumpAMM
  • πŸ‹ Whale trade alerts β€” Configurable SOL threshold for large buy/sell notifications with progress bar
  • πŸ’Ž Fee distribution alerts β€” Tracks creator fee distributions to shareholders with share breakdown

10 commands:

Command Description
/start Welcome message and quick start
/help Full command reference
/watch <address> Watch a wallet for fee claims
/unwatch <address> Stop watching a wallet
/list Show all watched wallets
/status Connection health and uptime
/cto [mint|wallet] Query Creator Takeover events
/alerts [type] [on|off] Toggle launch, graduation, whale, fee alerts
/monitor Start the event monitor
/stopmonitor Stop the event monitor

Also ships a REST API for programmatic access: per-client watches, paginated claim queries, SSE streaming, and HMAC-signed webhooks.

# Bot only
cd telegram-bot && npm install && npm run dev

# Bot + API
npm run dev:full

# API only (no Telegram)
npm run api

See telegram-bot/README.md for setup and API reference.


🌐 PumpOS Web Desktop

The website is a static HTML/CSS/JS web desktop (PumpOS) featuring:

  • 169 Pump-Store apps β€” DeFi dashboards, trading tools, charts, wallets, Pump SDK tools, and more
  • Live trades dashboard β€” real-time token launches and trades via WebSocket relay
  • PWA support β€” service worker (sw.js), installable web manifest, offline capability
  • Wallet connect β€” in-browser Solana wallet management
  • Smart money tracking β€” on-chain whale and smart money analytics
  • Command palette β€” keyboard-driven navigation and search
  • Plugin system β€” extensible via plugin-demo.html
  • BIOS boot screen β€” animated startup sequence at bios.html
  • Built-in API β€” serverless endpoints for coins, market data, and portfolio
  • Bonding curve calculator β€” interactive constant-product AMM price simulation
  • Fee tier explorer β€” visualize market-cap-based tiered fee schedules
  • Token launch simulator β€” animated token lifecycle from creation to graduation
  • SDK API reference β€” interactive documentation for all 42 SDK methods
website/
β”œβ”€β”€ index.html          # PumpOS desktop shell
β”œβ”€β”€ live.html           # Live token launches + trades dashboard
β”œβ”€β”€ chart.html          # Chart application
β”œβ”€β”€ bios.html           # BIOS boot screen
β”œβ”€β”€ plugin-demo.html    # Plugin system demo
β”œβ”€β”€ sw.js               # Service worker (offline support)
β”œβ”€β”€ Pump-Store/         # 169 installable apps
β”‚   β”œβ”€β”€ apps/           # Individual app HTML files
β”‚   └── db/v2.json      # App registry
β”œβ”€β”€ scripts/            # 27 JS modules (wallet, widgets, kernel, etc.)
β”œβ”€β”€ api/                # Serverless API endpoints
└── assets/             # Images, icons, wallpapers

πŸ’³ x402 Payment Protocol

The x402/ package implements HTTP 402 Payment Required as a real micropayment protocol using Solana USDC.

Component Description
Server Express middleware (x402Paywall) gates any endpoint behind a USDC payment
Client X402Client auto-pays when it receives a 402 response
Facilitator Verifies and settles payments on-chain
import { x402Paywall } from "@pump-fun/x402";

app.use("/api/premium", x402Paywall({
  recipient: "YourWalletAddress...",
  amountUsdc: 0.01, // $0.01 per request
}));

See x402/README.md for setup and examples.


πŸ€– DeFi Agents

The packages/defi-agents/ directory ships 43 production-ready AI agent definitions for DeFi, portfolio management, trading, and Web3 workflows.

  • Universal format β€” works with any AI platform (Claude, GPT, LLaMA, local models)
  • 18-language i18n β€” full locale translations
  • RESTful API β€” agents served from a static JSON API
  • Agent manifest β€” agents-manifest.json registry with metadata, categories, and counts
  • Includes β€” pump-fun-sdk-expert agent specialized for this SDK
# Browse agents
cat packages/defi-agents/agents-manifest.json | jq '.totalAgents'
# 43

🏰 Lair Telegram Platform

lair-tg/ is a unified Telegram bot platform for DeFi intelligence, non-custodial wallet management, and token launching.

  • 6 packages β€” api, bot, launch, mcp, os, shared
  • 15+ data sources β€” CoinGecko, DexScreener, GeckoTerminal, Birdeye, and more
  • AI assistant β€” GPT-4o with function calling for market analysis
  • Token deployment β€” launch tokens via bonding curve from Telegram
  • Alerts β€” meme tracker, whale monitoring, price alerts

See lair-tg/README.md for architecture and setup.


πŸ”Œ Plugin.delivery

The packages/plugin.delivery/ directory is an AI plugin index with a full SDK, gateway, and developer tools for building function-calling plugins.

  • 17 API plugins β€” pump-fun-sdk, coingecko, dexscreener, defillama, beefy, lido, 1inch, thegraph, ens-lookup, gas-estimator, phishing-detector, sanctions-check, contract-scanner, audit-checker, grants-finder, address-labels, gateway
  • Plugin SDK β€” TypeScript SDK with React hooks (usePluginSettings, usePluginState, useWatchPluginMessage)
  • OpenAPI compatible β€” auto-generated client from OpenAPI specs
  • Vercel edge deployment β€” serverless API functions

See packages/plugin.delivery/README.md for details.


πŸ”‘ Vanity Address Generators

Generate custom Solana addresses with a desired prefix or suffix β€” using the official solana-sdk (Rust) and @solana/web3.js (TypeScript).

Generator Directory Performance Use Case
Rust rust/ 100K+ keys/sec (multi-threaded, Rayon) Production, long prefixes
TypeScript typescript/ ~1K keys/sec Education, scripting, programmatic API
# Rust generator
cd rust && cargo build --release
./target/release/pump-vanity --prefix pump --threads 8

# TypeScript generator
cd typescript && npm install && npm start -- --prefix pump

Both generators zeroize key material after use and write keypairs with 0600 permissions. See rust/README.md and typescript/README.md for full documentation.


πŸ› οΈ Shell Scripts & Makefile

Production shell scripts in scripts/ wrapping solana-keygen:

Script Purpose
generate-vanity.sh Single vanity address with optional GPG encryption
batch-generate.sh Parallel batch generation with resume support
verify-keypair.sh 7-point keypair integrity verification
test-rust.sh Run Rust generator test suite
publish-clawhub.sh Publish skills to ClawHub registry
utils.sh Shared utility functions

The Makefile provides 20+ targets for the full workflow:

make generate PREFIX=pump          # Generate a vanity address
make batch PREFIX=pump COUNT=10    # Batch generate
make verify FILE=keypair.json      # Verify a keypair
make test                          # Run all tests
make help                          # Show all targets

πŸ§ͺ Testing & CI/CD

Test suites in tests/ covering unit, integration, stress, fuzz, and benchmark tests:

tests/
β”œβ”€β”€ benchmarks/     # Performance comparison and scaling tests
β”œβ”€β”€ cli/            # CLI generation and verification tests
β”œβ”€β”€ integration/    # Output compatibility, security properties, keypair validity
β”œβ”€β”€ stress/         # Rapid generation and long-running stability
β”œβ”€β”€ fuzz/           # Fuzz testing for edge cases
└── fixtures/       # Shared test data
npm test                           # Run SDK unit tests (Jest)
make test                          # Run all test suites
bash docs/run-all-tests.sh         # Run comprehensive cross-language tests

CI/CD via 6 GitHub Actions workflows:

Workflow Trigger Purpose
ci.yml Push/PR Build & lint on Node 18, 20, 22
release.yml Tags npm publish + Rust binary releases
security.yml Push/PR npm audit, cargo audit, CodeQL, dependency review
docs.yml Push Deploy documentation
stale.yml Cron (daily) Auto-close stale issues
labels.yml Push Sync issue labels

πŸ“š Tutorials

19 hands-on guides in tutorials/ covering every SDK feature:

# Tutorial Topics
1 Create a Token createV2Instruction, metadata, signing
2 Buy Tokens Bonding curve buy, slippage, fetchBuyState
3 Sell Tokens Sell math, partial sells, fetchSellState
4 Create + Buy Atomic create-and-buy in one transaction
5 Bonding Curve Math Virtual reserves, price formulas, market cap
6 Migration Graduation detection, AMM migration
7 Fee Sharing Shareholder config, distribution, BPS
8 Token Incentives Volume rewards, accumulator, claiming
9 Fee System Fee tiers, market-cap thresholds
10 PDAs Program Derived Addresses, derivation
11 Trading Bot Automated buy/sell strategies
12 Offline vs Online PumpSdk vs OnlinePumpSdk patterns
13 Vanity Addresses Rust + TS + CLI vanity generation
14 x402 Paywalled APIs HTTP 402 USDC micropayments
15 Decoding Accounts On-chain account deserialization
16 Monitoring Claims Fee claim monitoring patterns
17 Monitoring Website Live dashboard, real-time UI
18 Telegram Bot Bot setup, commands, alerts
19 CoinGecko Integration Price feeds, market data

πŸ“– Documentation

Guide Description
Getting Started Installation, setup, and first transaction
End-to-End Workflow Full lifecycle: create β†’ buy β†’ graduate β†’ migrate β†’ fees β†’ rewards
Architecture SDK structure, lifecycle, and design patterns
API Reference Full class, function, and type documentation
Examples Practical code examples for common operations
Analytics Price impact, graduation progress, token pricing
Bonding Curve Math Virtual reserves, price formulas, and graduation
Fee Sharing Creator fee distribution to shareholders
Fee Tiers Market-cap-based fee tier mechanics
Token Incentives Volume-based trading rewards
Mayhem Mode Alternate routing mode and fee recipients
Migration Guide Upgrading between versions, breaking changes
Troubleshooting Common issues and solutions
Security Security model, key handling, and best practices
Testing Test suites, commands, and CI pipelines
CLI Guide Vanity address generation with Solana CLI
SolanaAppKit SolanaAppKit integration guide
Solana Official LLMs Solana official LLMs context reference
Tutorials 19 hands-on guides covering every SDK feature

Also see: FAQ Β· Roadmap Β· Changelog


πŸ“‚ Full Repository Structure

Directory Purpose
src/ Core SDK β€” instruction builders, bonding curve math, social fees, PDAs, state, events
rust/ High-performance Rust vanity address generator (rayon + solana-sdk)
typescript/ TypeScript vanity address generator (@solana/web3.js)
mcp-server/ Model Context Protocol server for AI agent integration
telegram-bot/ PumpFun fee claim monitor β€” Telegram bot + REST API
websocket-server/ WebSocket relay β€” PumpFun API to browser clients
website/ PumpOS web desktop with 169 Pump-Store apps
x402/ x402 payment protocol β€” HTTP 402 micropayments with Solana USDC
lair-tg/ Lair β€” unified Telegram bot platform for DeFi intelligence
live/ Standalone live token launch + trades pages
packages/defi-agents/ 43 production-ready AI agent definitions for DeFi
packages/plugin.delivery/ AI plugin index for SperaxOS function-call plugins
tutorials/ 19 hands-on tutorial guides
scripts/ Production Bash scripts wrapping solana-keygen
tools/ Verification and audit utilities
tests/ Cross-language test suites
docs/ API reference, architecture, guides
security/ Security audits and checklists
skills/ Agent skill documents
prompts/ Agent prompt templates
.well-known/ AI plugin, agent config, skills registry, security.txt

🀝 Contributing

See CONTRIBUTING.md for guidelines.

πŸ“„ Additional Resources

Resource Description
VISION.md Project vision and principles
ROADMAP.md Quarterly milestones and planned features
CHANGELOG.md Version history and release notes
FAQ.md Frequently asked questions
SECURITY.md Security policy and vulnerability reporting
AGENTS.md Agent development guidelines
llms.txt LLM quick reference context

MIT

About

Interact with the Pump.fun decentralized application. It provides methods for creating, buying, and selling tokens using the Solana blockchain. The SDK handles the necessary transactions and interactions with the Pump.fun program.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • HTML 67.2%
  • TypeScript 15.3%
  • JavaScript 12.1%
  • CSS 2.2%
  • Shell 1.7%
  • Rust 1.2%
  • Other 0.3%