# Pumpfun Buy

> Use when the user says /buy or asks to buy a Pump.fun coin. Checks live curve/pool state, quotes the buy with fees and price impact, and returns an UNSIGNED buy transaction for the user's wallet to sign. Never signs or sends.

- Skill: `solizardking/pumpfun-buy` (Agent Skill)
- Install (CLI): `npx get-skill add solizardking/pumpfun-buy`
- Raw SKILL.md: https://api.skillmd.com/api/skills/solizardking/pumpfun-buy/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: Solizardking (https://skillmd.com/u/solizardking)
- Updated: 2026-11-22
- Page: https://skillmd.com/skills/solizardking/pumpfun-buy

---


# Pump.fun buy

## Default keyless endpoints
Use `RPC_URL=https://musebook-proxy.mynameisjeffspicoli.workers.dev/api/solana/rpc` unless the owner set their own (fallback public mainnet). Jupiter quote: `GET https://musebook-proxy.mynameisjeffspicoli.workers.dev/api/trade/quote?inputMint=&outputMint=&amount=&slippageBps=`; prices: `GET .../api/trade/jupiter/prices?ids=<mints>`; unsigned build: `.../api/trade/jupiter/build`.

## Safety rules (always)
- Never sign, send, or broadcast. Never ask for or accept a private key or seed phrase. Output only an unsigned base64 transaction plus a human summary for the user to review and sign in their own wallet.
- Ask for anything missing: token (mint/CA/name), side, size, the user's wallet pubkey (for builds), slippage (default 8%, accept 5–10% unless the user says otherwise).
- Before any build, show: venue (bonding curve or PumpSwap), quote asset (SOL/USDC/pump coin), price, market cap (quote + SOL), graduation %, fee tier, expected out, price impact, min-out / max-in after slippage.
- Warn clearly when: graduation > 90%; price impact > 5% (strong warning > 15%) or pool/curve liquidity is thin; curve real reserves ≈ 0, no tokens left, or anything looks drained/suspicious; mayhem or cashback coin; creator holds or just dumped a large share.
- Simulate the unsigned tx (RPC simulateTransaction with sigVerify=false, replaceRecentBlockhash=true, encoding base64) and report the result. Funding errors (custom 0x1, AccountNotInitialized 3012) just mean the wallet lacks that balance.
- Units: SOL 9 decimals, pump coins 6, USDC 6. Read the token program from the mint account owner on-chain, never from an HTTP API.

## Steps
1. Collect the mint (resolve a name/symbol and confirm it), a SOL amount (or USDC/pump-coin amount if that's the coin's quote), the wallet pubkey and slippage (default 8%).
2. Check state. If the pumpfun-swap skill's toolkit is available, run `node pump.js quote <mint> buy <amount>`. If not, read state directly: the bonding curve PDA is ["bonding-curve", mint] under program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P (fields after the 8-byte discriminator: virtual_token_reserves, virtual_quote_reserves, real_token_reserves, real_quote_reserves, token_total_supply as u64, complete as bool). Price = vQuote/vToken. Graduation % = 1 − real_token_reserves / initial_real_token_reserves (from the global account). Constant-product out = reserveOut·in/(reserveIn+in) after fees. If complete is true, the coin trades on PumpSwap (pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA); DexScreener's pair data gives liquidity and market cap.
3. Show the price, market cap, graduation %, fee tier, expected output, impact and all warnings. Stop here if the user only wanted a quote.
4. Build the unsigned tx: `node pump.js build <mint> buy <amount> <wallet> <slip>`, or the agent API below (side=buy). Simulate it, then return the base64 tx, the limits and the simulation result. Remind the user to review and sign in their own wallet.

## Fee schedule
Bonding curve: 1.25% total (creator 0.30, protocol 0.95).
PumpSwap tiers by market cap (upper bound SOL / USD → creator / total; protocol 0.05 + LP 0.20 on every tier above the first):
0–420 SOL (0–85k): creator .30, protocol .93, LP .02 = 1.25 | 1,470 (300k): .95→1.20 | 2,460 (500k): .90→1.15 | 3,440 (700k): .85→1.10 | 4,420 (900k): .80→1.05 | 9,820 (2M): .75→1.00 | 14,740 (3M): .70→.95 | 19,650 (4M): .65→.90 | 24,560 (5M): .60→.85 | 29,470 (6M): .55→.80 | 34,380 (7M): .50→.75 | 39,300 (8M): .45→.70 | 44,210 (9M): .40→.65 | 49,120 (10M): .35→.60 | 54,030 (11M): .30→.55 | 58,940 (12M): .275→.53 | 63,860 (13M): .25→.50 | 68,770 (14M): .225→.48 | 73,681 (15M): .20→.45 | 78,590 (16M): .175→.43 | 83,500 (17M): .15→.40 | 88,400 (18M): .125→.38 | 93,330 (19M): .10→.35 | 98,240 (20M): .075→.33 | above 98,240 SOL (20M+): .05→.30.
On-chain tiers key off SOL market cap; use the USD column for USDC-quoted pools.

## Building via the pump.fun agent API (no local code needed)
`POST https://fun-block.pump.fun/agents/swap` with JSON `{"inputMint","outputMint","amount","user","slippagePct","encoding":"base64"}`. Buy: inputMint = So11111111111111111111111111111111111111112, amount = lamports. Sell: outputMint = that wSOL mint, amount = token base units (6 decimals). It picks curve vs PumpSwap itself and returns `{transaction, pumpMintInfo}`. Always pass encoding base64. Run it with curl in a shell.
