io.github.nirholas/pump-fun-sdk icon

Pump SDK MCP Server

by nirholas

io.github.nirholas/pump-fun-sdk

Build extend and maintain pump - Token creation buying selling migration fee collection

Version 1.0.1
AI Tools
View source

Pump SDK MCP Server · v1.0.1

nirholas

60
██████╗ ██╗   ██╗███╗   ███╗██████╗     ███████╗██████╗ ██╗  ██╗
██╔══██╗██║   ██║████╗ ████║██╔══██╗    ██╔════╝██╔══██╗██║ ██╔╝
██████╔╝██║   ██║██╔████╔██║██████╔╝    ███████╗██║  ██║█████╔╝ 
██╔═══╝ ██║   ██║██║╚██╔╝██║██╔═══╝     ╚════██║██║  ██║██╔═██╗ 
██║     ╚██████╔╝██║ ╚═╝ ██║██║         ███████║██████╔╝██║  ██╗
╚═╝      ╚═════╝ ╚═╝     ╚═╝╚═╝         ╚══════╝╚═════╝ ╚═╝  ╚═╝

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.

     

           


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 manifestagents-manifest.json registry with metadata, categories, and counts
  • Includespump-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 packagesapi, 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