/pumpswap-sdk:pump-swap-sdkfrom pumpswap-sdk
Quotes and builds PumpSwap AMM swap, deposit, withdraw, and pool creation instructions on Solana using @pump-fun/pump-swap-sdk. Returns TransactionInstruction[] for the caller to sign and send.
Ships in pumpswap-sdk. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
@pump-fun/pump-swap-sdk builds instructions for the PumpSwap AMM program on Solana. It never signs or sends: it returns TransactionInstruction[] that the caller puts in a transaction.
npm install @pump-fun/pump-swap-sdk
BN in the raw base units of its mint (lamports for wSOL, micro-units for USDC).slippage is a percentage: 1 means 1%.OnlinePumpAmmSdk (needs a Connection, fetches on-chain state) and PUMP_AMM_SDK (offline, builds instructions from fetched state).import { Connection, PublicKey } from "@solana/web3.js";
import BN from "bn.js";
import { OnlinePumpAmmSdk, PUMP_AMM_SDK } from "@pump-fun/pump-swap-sdk";
const onlineSdk = new OnlinePumpAmmSdk(new Connection(rpcUrl));
const state = await onlineSdk.swapSolanaState(poolKey, user);
const buy = await PUMP_AMM_SDK.buyQuoteInput(state, new BN(100_000_000), 1);
The four builders on PUMP_AMM_SDK, each (state, amount, slippage, options?):
| Method | Meaning |
|---|---|
buyBaseInput | buy exactly base tokens, pay at most quote plus slippage |
buyQuoteInput | spend quote, receive at least base minus slippage |
sellBaseInput | sell base, receive at least quote minus slippage |
sellQuoteInput | receive quote, sell at most base plus slippage |
options is { v2?: boolean }; v2 builds buy_v2 or sell_v2 only when the pool supports it. For explicit limits use buyInstructions(state, baseOut, maxQuoteIn) and sellInstructions. The pure quote helpers buyBaseInput, buyQuoteInput, sellBaseInput, sellQuoteInput, multiHopSwapQuote and computeFeesBps are also exported.
onlineSdk.liquiditySolanaState(poolKey, user), then PUMP_AMM_SDK.depositAutocompleteQuoteAndLpTokenFromBase(state, base, slippage) or depositAutocompleteBaseAndLpTokenFromQuote(state, quote, slippage), then PUMP_AMM_SDK.depositInstructions(state, lpToken, slippage).withdrawAutoCompleteBaseAndQuoteFromLpToken and withdrawInstructions.onlineSdk.createPoolSolanaState(index, creator, baseMint, quoteMint) then PUMP_AMM_SDK.createPoolInstructions(state, baseIn, quoteIn).onlineSdk.getCoinCreatorVaultBalance and collectCoinCreatorFeeSolanaState.Check the signature in src/sdk/offlinePumpAmm.ts or src/sdk/onlinePumpAmm.ts before using any method not listed here.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub nirholas/pump-swap-sdk --plugin pumpswap-sdkOther plugins' skills for the same job