Type/to search
Built-in Functions
Structures
Built-in Variables and Constants
Conventions
Exchanges
Capability Matrix
Centralized Exchanges
Decentralized Exchanges (DEX)
Prediction Markets
Securities and Futures
On-chain & Custom

Discover new coins on the pump.fun bonding curve, read the curve state, quote, buy and sell; graduated coins trade through Jupiter swaps automatically.

exchange.IO(k)
exchange.IO(k, options)
exchange.IO(k, mint)
exchange.IO(k, mint, side, amount)
exchange.IO(k, mint, solAmount)
exchange.IO(k, mint, solAmount, options)
exchange.IO(k, mint, amount, options)
exchange.IO(k, wallet)

Examples

  • Discover new coins and quote them on the curve (read-only).

    javascript
    function main() { var coins = exchange.IO("pump.new", {limit: 10}) if (!coins) { Log("Query failed:", GetLastError()) return } for (var i = 0; i < coins.length; i++) { var c = coins[i] if (c.quote != "SOL") { continue } var info = exchange.IO("pump.info", c.mint) var q = exchange.IO("pump.quote", c.mint, "buy", 0.1) if (!info || !q) { continue } Log(_D(c.time), c.symbol, c.mint, "progress", info.progress.toFixed(2) + "%", "market cap", info.marketCap.toFixed(2), "SOL", "0.1 SOL buys", q.amountOut, "impact", q.priceImpactPct.toFixed(2) + "%") } }
  • Poll for new coins, buy when the quote looks right, check the holdings, then sell everything.

    javascript
    function main() { var since = Date.now() var seen = {} while (true) { var coins = exchange.IO("pump.new", {limit: 20, since: since}) || [] for (var i = 0; i < coins.length; i++) { var c = coins[i] if (seen[c.mint] || c.quote != "SOL" || c.mayhem || c.cashback) { continue } seen[c.mint] = true if (c.devBuy && c.devBuy.quoteAmount > 1) { continue // the creator's first buy is too large } var q = exchange.IO("pump.quote", c.mint, "buy", 0.01) if (!q || q.priceImpactPct > 5) { continue } var r = exchange.IO("pump.buy", c.mint, 0.01, {slippage: 0.2, priorityFee: 0.0005}) if (!r) { Log("Buy failed:", GetLastError()) continue } Log("Bought", r.tokenAmount, c.symbol, "for", r.solAmount, "SOL", r.txHash) Sleep(30 * 1000) var h = exchange.IO("pump.holdings") || [] h.forEach(function(x) { Log("holding", x.mint, x.amount, "value", x.value, "SOL") }) var s = exchange.IO("pump.sell", c.mint, "all", {slippage: 0.2}) Log("Sold:", s ? s.solAmount + " SOL " + s.txHash : GetLastError()) return } Sleep(1000) } }
  • Simulate a buy only, without signing or sending.

    javascript
    function main() { var coins = exchange.IO("pump.new", {limit: 5}) if (!coins || coins.length == 0) { Log("No new coins:", GetLastError()) return } var r = exchange.IO("pump.buy", coins[0].mint, 0.01, {dryRun: true}) if (!r) { Log("Simulation error:", GetLastError()) return } Log("simulation", r.ok ? "ok" : "failed", r.simulationError || "", "expected", JSON.stringify(r.expected), "compute units", r.unitsConsumed) }

Returns

TypeDescription

object / array / null value

pump.new and pump.holdings return arrays, the others objects; fields are in the sections of the remarks. A null value is returned for bad arguments, a coin that is not a pump.fun coin, a failed simulation (unless dryRun) or a failed transaction, with the reason in GetLastError().

Arguments

NameTypeRequiredDescription

k

string

Yes

The command: pump.new, pump.info, pump.quote, pump.buy, pump.sell or pump.holdings.

mint

string

No

The coin's mint address (pump.info, pump.quote, pump.buy, pump.sell).

side

string

No

Direction of pump.quote: buy or sell.

amount

number / string

No

pump.quote: the SOL to spend (fees included) for a buy, the coins to sell for a sell; pump.sell: the coins to sell, or all (the whole balance).

solAmount

number

No

The SOL pump.buy spends, protocol and creator fees included.

options

object

No

{limit, since} for pump.new; the order options {slippage, priorityFee, computeUnitLimit, dryRun, payer, wait, closeAccount} for pump.buy and pump.sell. See the remarks.

wallet

string

No

The wallet pump.holdings looks at, this exchange object's wallet by default.

See Also

Remarks

Commands
CommandArgumentsPurpose
pump.new[options]Discover recently created coins on chain
pump.infomintBonding-curve state: reserves, price, market cap, progress, fees
pump.quotemint, side, amountLocal quote (no transaction)
pump.buymint, solAmount[, options]Buy for solAmount SOL
pump.sellmint, amount[, options]Sell amount coins or all
pump.holdings[wallet]pump.fun coins held by a wallet, valued on the curve

These commands trade coins on the bonding curve of the pump.fun program (6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P) directly, not through Jupiter: the connector builds, simulates and signs the transactions itself, with the on-chain program's quote formula and fees.

pump.new

Lists the recent signatures of the pump.fun mint authority (TSLvdd1pWpHVjahSpsvCXUbgwsL3JAcvokwaKt1eokM, which appears only in creation transactions) and parses each creation transaction's CreateEvent, newest first. options.limit is how many creation transactions to look at (20 by default, at most 100), options.since a millisecond timestamp: only coins created after it are returned. Parsed transactions are cached in the process, so polling fetches only new ones (one getSignaturesForAddress plus one getTransaction per new transaction). Creation transactions that failed on chain are not listed.

Each item is {signature, slot, time, mint, name, symbol, uri, creator, user, bondingCurve, tokenProgram, quote, quoteMint, mayhem, cashback, holderReward, devBuy}: time is the block time (milliseconds); user is the wallet that sent the creation (usually the creator); tokenProgram is spl-token or token-2022; quote is SOL, USDC or the quote token's mint; devBuy is the first buy in the same transaction, {tokens, quoteAmount} (quoteAmount includes fees), or null. name, symbol and uri are whatever the creator chose; rely on the mint address.

pump.info

One getMultipleAccounts reads the curve, mint, global config and fee table and returns {mint, bondingCurve, creator, tokenProgram, decimals, quote, quoteMint, complete, migrated, virtualTokenReserves, virtualQuoteReserves, realTokenReserves, realQuoteReserves, tokenTotalSupply, price, marketCap, progress, fees, mayhem, cashback, holderReward}: reserves and supply are in readable units; price is the quote (SOL) value of one coin and marketCap is price times the total supply; progress is the share of the curve sold (%), and at 100 the curve is complete (complete) and then migrates to PumpSwap (migrated, reserves zeroed, price, marketCap and fees null); fees is the current rate {protocolBps, creatorBps} in basis points. A coin that is not a pump.fun coin is an error.

pump.quote

Quotes locally with the on-chain program's formula and fees and returns {venue, mint, side, quote, amountIn, amountOut, price, spotPrice, priceAfter, priceImpactPct, fees, protocolFeeBps, creatorFeeBps, crossesCurve}: venue is pump; amountIn and amountOut are what is paid and received (SOL and coins for a buy, coins and SOL for a sell); price is the average fill price including fees (SOL per coin), spotPrice the current price and priceAfter the price after the trade; priceImpactPct is how far the average price before fees is from the current price (%); fees is the protocol plus creator fee (SOL); crossesCurve true means the buy goes past the end of the curve (see below). A sale is paid from the SOL on the curve (realQuoteReserves), and more than that is an error.

Once the curve is complete (graduated) the quote comes from Jupiter (exact input on MINT_SOL), with venue jupiter plus route (the liquidity sources used), priceImpactPct Jupiter's estimated price impact (%) and spotPrice, priceAfter, fees, protocolFeeBps and creatorFeeBps null; it fails when Jupiter has no route.

pump.buy and pump.sell
  • A buy is exact input: it spends solAmount SOL (fees included), creates the wallet's token account idempotently and sends buy_exact_quote_in_v3 with a minimum output of the local quote × (1 − slippage). A sell sends sell_v3 with a minimum SOL output of the local quote × (1 − slippage); selling more than the balance fails without sending. Both minimums are enforced on chain; when missed the whole transaction fails and only the network fee is paid.
  • The node simulates before sending, and a failed simulation is not sent and is reported (pump.fun error codes with their names, such as BuySlippageBelowMinTokensOut). Waiting for confirmation follows the concentrated-liquidity rules: when it cannot be decided, the error says outcome is unknown with the signature.
  • Result {txHash, venue, mint, side, solAmount, tokenAmount, price, fee, slot}: solAmount is the SOL paid for a buy (protocol and creator fees included, network fee and account deposits excluded) or received for a sell (fees deducted); tokenAmount is the coins traded, from the on-chain events; fee is the network fee (SOL). With wait false the result is {txHash, venue, mint, side, pending, lastValidBlockHeight, expected} (expected is the local quote); with dryRun it is {dryRun, venue, mint, side, payer, ok, simulationError, logs, unitsConsumed, txBytes, solAmount, tokenAmount, price, expected}, with the fill taken from the simulated on-chain events.
Order optionDescription
slippage[0, 1), default 0.05
priorityFeeThe transaction's total priority fee (SOL, 0 to 1); without it the 75th percentile of recent fees paid by transactions writing the same accounts, capped by exchange.IO("priorityFee")
computeUnitLimitThe compute-unit limit; default: the simulated usage plus headroom
dryRuntrue simulates only, without signing or sending
payerOnly with dryRun: simulate with this wallet paying
waitDefault true waits for confirmation and reports the fill from the on-chain events; false returns right after the broadcast
closeAccountpump.sell only: selling all closes the wallet's token account in the same transaction and returns its deposit by default; false keeps it

pump.holdings

The coins in the wallet's token balances that have a bonding curve, as [{mint, amount, quote, complete, price, value}]: value is the quote (fees deducted) that selling the whole balance on the curve would return now; price and value are null once the curve is complete or when the balance exceeds what the curve can buy back (value graduated coins with exchange.IO("route")).

Limits and graduation
  • SOL-quoted coins only: coins quoted in USDC or another token (quote of pump.new) and cashback coins fail in pump.buy and pump.sell; cashback coins can be traded through Jupiter with exchange.Buy and exchange.Sell on MINT_SOL.
  • Buying past the curve: when a buy exceeds what is left on the curve (except mayhem coins), the excess fills at the price of the PumpSwap pool it migrates to and crossesCurve is true; the curve then cannot trade until migration completes. A mayhem-coin buy beyond what is left is an error.
  • Graduation: for a coin whose curve is complete, pump.buy and pump.sell swap at market through this exchange object's Jupiter swaps (pair MINT_SOL, protected by the order's slippage, which Jupiter requires below 0.5), and venue is jupiter with route; the priorityFee and computeUnitLimit options are then errors (the priority-fee cap is exchange.IO("priorityFee")), and dryRun is not supported (quote with pump.quote). For a short time after the curve completes and before migration, both paths may fail.
  • Fees: protocol and creator fees follow the Pump Fees program's tiers by market cap (pump.info and pump.quote return the actual rates), plus network and priority fees. The first buy of a coin creates a token account (about 0.002 SOL deposit); the wallet's first pump.fun trade also creates its volume account (about 0.0018 SOL, not returned).
  • Public nodes are rate-limited per second and slow; for sniping, configure your own paid node in the node address setting and pay enough priorityFee, or transactions may expire during congestion.

Risks
  • Most new coins go to zero quickly; creators or wallets bundled with them often buy in the creation transaction or the next few blocks and can dump at any time.
  • Sniping bots and MEV are fierce: a wide slippage invites sandwich attacks that fill at the worst price.
  • Names, symbols and metadata links can impersonate well-known projects; rely on the mint address.
  • Protocol, creator, network and priority fees are paid on every trade, so frequent in-and-out trading is costly.