services
06

Quote API

served on the RPC endpoint

Estimated prices across 17 Solana pool families, on the RPC endpoint and key. POST quote to https://services.carbium.sh, then swap for an unsigned transaction. Bought per account; the plan's rate is shared by its keys.

carbium://quote · quote.sh
# Quotecurl https://services.carbium.sh \  -H 'content-type: application/json' -H 'x-api-key: <YOUR_KEY>' \  -d '{"jsonrpc":"2.0","id":1,"method":"quote","params":[{        "src_mint":"So11111111111111111111111111111111111111112",        "dst_mint":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",        "amount_in":"1000000000","slippage_bps":50}]}'# -> {"jsonrpc":"2.0","result":{#     "srcAmountIn":"1000000000","destAmountOut":"109583697","minAmountOut":"109035778",#     "slippageBps":50,"swapMode":"BaseIn",#     "inputMint":"So11111111111111111111111111111111111111112",#     "outputMint":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",#     "routePlan":[{"hop":0,"percent":"100","swapInfo":{#       "ammKey":"DJNtGuBGEQiUCWE8F981M2C3ZghZt2XLD8f2sQdZ6rsZ","label":"pancakeswap-v3",#       "inputMint":"So11111111111111111111111111111111111111112",#       "outputMint":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",#       "inAmount":"999500000","outAmount":"109583697"}}],#     "quoteId":"65a5c08fd08b79ea9ffd4290a229a5fb",#     "platformFee":{"amount":"500000","feeBps":5,"mint":"So11111111111111111111111111111111111111112"}},"id":1}# Pin venues with "dex":"o-whirlpool" or "dex":["o-whirlpool","r-clmm"].

request and result

quote/shape
fieldtypemeaning
params · required, positional [{...}] or by name
src_mintbase58input mint
dst_mintbase58output mint; not src_mint
amount_inu64, number or stringinput amount, base units; a string keeps precision past 2^53
slippage_bps0 to 5000sets minAmountOut: 50 is 0.5%
params · optional
dexlabel, or array of labelsonly these families (table below), one hop src_mint to dst_mint, may split across their pools; no such route: -32051 no_route_in_pinned_dex, never another venue's route. Omit to search every family, multi-hop and split
txVersionnumber, optional0 (default): v0 with address lookup tables, at most 1,232 B. 1: v1 with every address inline, at most 4,096 B, for routes v0 cannot fit. Over 64 accounts is refused in both
swapTagnumber, optional0 (default): the router picks the form. 1: the plain form: data starts with tag 0x01, no middle block, each middle token account made by its own idempotent instruction, paid and owned by your wallet, left open; same route, price, fee and floor. v0 only: with txVersion 1, -32602 (the quote upstream refused the request) with error.data.code swap_tag_format
maxAccountsnumber, optionalthe most accounts the swap instruction may carry, 1 to 64, repeats counted. Omitted: no cap, except 64 with swapTag 1. No route within it: -32055; out of range: -32602 (the quote upstream refused the request) with error.data.code bad_max_accounts
result
srcAmountInstringinput amount, base units
destAmountOutstringexpected output, base units, net of platformFee and any Token-2022 transfer fee on the route's mints; do not take them off again
minAmountOutstringthe exact floor swap sets, rounded down; the transaction never fills below it. Fee off the output (SOL out, or USDC or USDT out with no SOL in): G = floor(gross × (10000 − slippageBps) / 10000), then G − floor(G × feeBps / 10000), gross being destAmountOut plus platformFee.amount. Otherwise: floor(destAmountOut × (10000 − slippageBps) / 10000)
slippageBps, swapModenumber, stringyour slippage; always BaseIn
inputMint, outputMintbase58the pair
routePlan[]arraylegs: hop (depth), percent (share of the hop's input), swapInfo {ammKey, label, inputMint, outputMint, inAmount, outAmount}
quoteId32 hexfor swap; valid 30 s
platformFeeobject, when charged{amount, feeBps, mint}: router fee, rounded down. Mint: SOL when SOL is at either end, else USDC or USDT when that is the output, else the input token. Taken off the input before the route, except on SOL out, or USDC or USDT out with no SOL in, where destAmountOut and minAmountOut are net of it. Absent when it rounds to 0 (a base under 2,000 atoms), or on an input-token route whose input is a Token-2022 mint with a transfer hook program set (an empty hook still pays), frozen by default or non-transferable
txVersionnumber; v1 only1 when asked; its swap is v1. Absent on v0
swapTagnumber; tagged only1 when asked; its swap is the plain form. Absent otherwise
partial, requestedAmountInboolean, string; partial onlyonly part of amount_in can fill: past what its one pool pays out (any family; that bound less 3%), or a SOL-input route that cannot fill it whole (why first_hop_unfilled; halved up to 6 times, down to 1/64, the first part that fills served). srcAmountIn is the part, requestedAmountIn your ask; swap builds the part

venues

quote/venues
dex labelvenue
r-ammRaydium AMM v4
r-cpmmRaydium CPMM
r-clmmRaydium CLMM
r-lpadRaydium LaunchLab
o-whirlpoolOrca Whirlpool
o-orca-v1Orca legacy pools (token-swap v1)
o-orca-v2Orca legacy pools (token-swap v2)
m-dlmmMeteora DLMM
m-dammMeteora DAMM v1
m-damm-v2Meteora DAMM v2
m-dbcMeteora Dynamic Bonding Curve
m-dbc-hookMeteora DBC, Token-2022 transfer-hook mints
pump-curvepump.fun bonding curve
pump-ammPumpSwap
manifestManifest
pancakeswap-v3PancakeSwap v3
byrealByreal CLMM
$Bonding curves: quote quotes a token on its curve, then on its pool once it migrates (pump-curve, then pump-amm), with no extra parameter. Just after a migration it waits for the new pool: 250 ms on pump-curve, 600 ms on r-lpad and m-dbc. A dex pin to pump-curve on a migrated token answers -32051 no_route_in_pinned_dex: drop the pin or pin pump-amm. Chained pump hops (a PumpSwap pool or SOL curve, then curves quoted in each other) land as one pump multi_hop_swap step; routePlan lists each hop with one-step amounts. The protocol fee is only on the SOL-end hop, and the curves in between pay none. The creator fee is on the hop farthest from SOL (the last when SOL is the input, the first when SOL is the output), plus the LP fee when that hop is a pump-amm pool.

errors

quote/errors
httpcodemessagewhat to do
400-32602params accepts only … / params must carry … / … must be …the four params plus optional dex, txVersion, swapTag, maxAccounts; amount_in non-zero, base units; slippage_bps 0 to 5000; two different valid mints
400-32602txVersion must be 0 or 10, 1 or omit
400-32602swapTag must be 0 or 10, 1 or omit
400-32602maxAccounts must be a whole number1 to 64, or omit
400-32602dex must name venue families: … / dex must be a venue-family label …a venue table label, or an array
400-32602the quote upstream refused the requesterror.data.code says why; dust_amount: send amount_in of at least error.data.min_amount_in; bad_max_accounts: maxAccounts 1 to 64. Change the request before sending it again
400-32052dex names a venue family the quote upstream does not havefamily unavailable now: pin another or omit dex
400-32600quote is not batchableone quote per request
401-32001unknown api key / api key is not enabled for quotesend the whole key; give it the QUOTE scope
403-32050module not enabled for this accountthe account needs the quote module
429-32005rate limit exceeded / quote lane capacity exceeded / free quote plan at capacity / free tier limit for your network reachedalready waited up to 1 s (rate) and 3 s (lane permit): retry after Retry-After; upgrade from free for your own budget
200-32051no routeno path for this pair and size; error.data.message, when sent, gives the reason. error.data.why hook_launch_window: the transfer hook admits only allowlisted wallets, retry later; hook_market_closed: retry when its transfer schedule allows; hook_sells_only: routes only as the input; no_route_in_pinned_dex: drop the pin or pin others; dust_gate: every pool holds under 0.001 SOL on its SOL side (direct_why names the pool and reserve), stop until it refills
200-32053sell exceeds what the curve can payinput exceeds one pool's payout in any family, and the payable part (error.data.max_amount_in less 3%) failed too. max_out: the most it pays at max_amount_in. why partial_below_fee: that part pays less than the swap costs, stop. max_amount_in 0: nothing pays, stop. No why: the part did not route or the bound moved; quote well under max_amount_in, or stop
200-32054token has no live poolstop until it lists again
200-32055no route fits the account capthe cap (maxAccounts, or 64 with swapTag 1) left no route: raise maxAccounts (at most 64), lower amount_in, or quote with neither
503-32011quote upstream staleprice feed reloading: retry after Retry-After. error.data.why graduating: a migrated curve's new pool is not serving yet, retry after about 3 s
503-32011quote upstream …retry with backoff, after Retry-After when sent
!Branch on error: -32051, -32053, -32054 and -32055 come back 200. A 429 comes before any params check.

plans

quote/plans
planpricequotes / account
FREE$010 / s
STARTER$750 / s
PRO$28150 / s
ELITE$104500 / s
$A swap counts as one quote. Keys need the QUOTE scope, set at issue or on the dashboard. Router fee (platformFee): 5 bps (0.05%), charged on chain in the transaction.

methods

quotereturns {srcAmountIn, destAmountOut, minAmountOut, slippageBps, swapMode, inputMint, outputMint, routePlan: [{hop, percent, swapInfo}], quoteId?, partial?, requestedAmountIn?, platformFee?, txVersion?, swapTag?}

GET /cq1/quotereturns {srcAmountIn, destAmountOut, destAmountOutMin, swapMode, slippage, priceImpactPct, routePlan, feeMint, feeBps, signatureFeeLamports, prioritizationFeeLamports, rentFeeLamports, inputMint, outputMint, swapType, router, requestId, priceImpact}