services
06

Quote API

served on the RPC endpoint

Route quotes from the router across 17 Solana pool families, on the RPC endpoint and key. POST quote to https://services.carbium.sh, then call swap for the 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 labels; alias: dexesonly 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 account cap, 1 to 64. A route fits when its transaction loads at most that many accounts, lookup tables included, or its router instruction lists at most that many; the swap is built under the same cap. Omitted: no cap, except 64 with swapTag 1, where the instruction's entries alone count, repeats included. No route fits: -32055; out of range: -32602 (the quote upstream refused the request) with error.data.code bad_max_accounts
integrator_fee_bps0 to 5000, optional; alias: fee_bpsyour own fee, in basis points: 50 is 0.5%. 0 or omitted: none. Send it with integrator_fee_account, or neither. One alone, out of range, or above 0 with swapTag 1: -32602
integrator_fee_accountbase58, optional; alias: treasurythe wallet that receives your fee: a wallet address, not a token account. Counts as one more account toward maxAccounts
result
srcAmountInstringinput amount, base units
destAmountOutstringexpected output, base units, net of platformFee, of integratorFee when you asked one, and of 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; with an integratorFee both fees come off G together, floor(G × (10000 − feeBps − integratorFee.feeBps) / 10000), gross being destAmountOut plus both amounts. 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
integratorFeeobject, when asked{amount, feeBps, mint, account}: your own fee, set by integrator_fee_bps, rounded down; amount a string in base units of mint, account the wallet you sent. Same mint and side as platformFee, on the same base, and inside destAmountOut and minAmountOut like it. Present whenever integrator_fee_bps is above 0, even when amount is 0; absent otherwise. The transaction can still skip paying it: see Integrator fee, below
txVersionnumber; v1 only1 when asked; its transaction is v1. Absent on v0
swapTagnumber; tagged only1 when asked; its transaction 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, and integrator_fee_bps with integrator_fee_account (or fee_bps with treasury); 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-32602integrator_fee_bps (a whole number 0 to 5000) and integrator_fee_account (a base58 32-byte pubkey) go togethersend both, valid, or neither
400-32602swapTag 1 carries no integrator feedrop swapTag or the fee
400-32602send integrator_fee_bps or fee_bps, not both / send integrator_fee_account or treasury, not bothsend one name for each value
400-32602dex must name venue families: … / dex must be a venue-family label …a venue table label, or an array
400-32602amount too small: the output rounds to nothingerror.data.code dust_amount or sell_below_one_atom: send amount_in of at least error.data.min_amount_in when given, or a clearly larger amount
400-32602the quote upstream refused the requesterror.data.code says why; 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 transaction 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
503-32057the upstream has the integrator fee switched offretry later, or quote without the fee
!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 call 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.
$Integrator fee (integratorFee): send integrator_fee_bps with integrator_fee_account, your fee wallet, and the transaction pays that wallet your share on chain, beside the router fee and by its rule: in SOL when SOL is at either end, else in USDC or USDT when that is the output, else in the input token. swap takes nothing new: it carries the fee from the quote. A SOL fee is paid to the wallet in lamports; a token fee to the wallet's associated token account for that token, which must already exist: nothing in the transaction creates it. When that account is missing or cannot receive, or a SOL fee would leave the wallet below the rent-exempt minimum, the fee is skipped: the transaction still lands and the signer keeps the amount. It is skipped too, with the router fee, when it is due in an input token that is a Token-2022 mint with a transfer hook program set, frozen by default or non-transferable: the quote still shows the amount. Off the output the fee is a share of what the route delivers, so integratorFee.amount is exact only off the input, and there it is what leaves the input: a Token-2022 input mint's own transfer fee is held back from what reaches your account.

methods

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