Skip to content

henryoman/pump-kit

Repository files navigation

Pump Kit

Pump Kit

npm version Bun >= 1.3.0 Node.js >= 20

A TypeScript SDK for Pump.fun built on Solana Kit 5.0. Designed for high-performance applications including launch bots, bundlers, and low-latency trading systems using latest Solana best practices.

Features

  • Solana Kit 5.0 – Built on the latest Solana development framework
  • Modern transaction patterns – Optimized for speed and reliability
  • Unified swapsbuy/sell auto-route between bonding curves and AMM pools
  • Curve helpers – Direct access to bonding-curve instructions when you need them (curveBuy, curveSell)
  • AMM helpers – Deterministic AMM operations with percentage-aware selling (ammBuy, ammSell)
  • Automatic slippage protection – Built-in guards for buy/sell operations
  • Full TypeScript support – Strongly typed throughout with complete type coverage

TODO

These are the next actions we need to make happen:

  • create pump fun curve launch helpers with dev buy
  • provide/remove liquidity in existing pool
  • create new liquidity pool

Installation

bun add pump-kit

Quick Start

Setup

import { createSolanaRpc } from "@solana/kit";

const rpc = createSolanaRpc("https://api.mainnet-beta.solana.com");

Buy Tokens (Curve)

import { curveBuy } from "pump-kit";

await curveBuy({
  user: myWallet,
  mint: "TokenMintAddress",
  solAmount: 0.5,        // 0.5 SOL
  slippageBps: 50,       // 0.5% slippage (optional)
  rpc,
});

Sell Tokens (Curve)

import { curveSell } from "pump-kit";

// Sell specific amount
await curveSell({
  user: myWallet,
  mint: "TokenMintAddress",
  tokenAmount: 125_000,
  rpc,
});

// Sell percentage of wallet
await curveSell({
  user: myWallet,
  mint: "TokenMintAddress",
  useWalletPercentage: true,
  walletPercentage: 40,  // Sell 40% of holdings
  rpc,
});

Buy Tokens (AMM)

import { ammBuy } from "pump-kit";

await ammBuy({
  user: myWallet,
  mint: "TokenMintAddress",
  solAmount: 0.5,
  poolCreator: "CreatorAddress", // optional if auto detection works
  rpc,
});

Sell Tokens (AMM)

import { ammSell } from "pump-kit";

await ammSell({
  user: myWallet,
  mint: "TokenMintAddress",
  useWalletPercentage: true,
  walletPercentage: 100,
  poolCreator: "CreatorAddress",
  rpc,
});

API Reference

Curve Swap Helpers

// Buy tokens on the bonding curve
curveBuy({ user, mint, solAmount, slippageBps?, rpc, ... })

// Sell tokens on the bonding curve
curveSell({ user, mint, tokenAmount?, useWalletPercentage?, walletPercentage?, rpc, ... })

AMM Swap Helpers

// Buy tokens from the AMM pool using a SOL budget
ammBuy({ user, mint, solAmount, rpc, quoteMint?, poolCreator?, poolAddress? })

// Sell tokens into the AMM pool (supports percentage-based selling)
ammSell({
  user,
  mint,
  tokenAmount?,
  useWalletPercentage?,
  walletPercentage?,
  rpc,
  quoteMint?,
  poolCreator?,
  poolAddress?,
})

Transaction Utilities

// Build transaction
buildTransaction({ instructions, payer, prependInstructions?, appendInstructions?, rpc })

// Send and confirm
sendAndConfirmTransaction({ instructions, payer, rpc, rpcSubscriptions, ... })

// Simulate transaction
simulateTransaction({ instructions, payer, rpc, options? })

License

MIT