services

quote

quote, Quote API on carbium services: returns {srcAmountIn, destAmountOut, minAmountOut, slippageBps, swapMode, inputMint, outputMint, routePlan: [{hop, percent, swapInfo}], quoteId?, partial?, requestedAmountIn?, platformFee?, txVersion?, swapTag?}. It costs 0 credits.

quote0 credits
paramtype
src_mintpubkeyreq
dst_mintpubkeyreqmust differ from src_mint
amount_inu64, number or decimal stringreqnon zero, in base units
slippage_bpsu64req0 to 5000
dexr-amm | r-cpmm | r-clmm | r-lpad | o-whirlpool | o-orca-v1 | o-orca-v2 | m-dlmm | m-damm | m-damm-v2 | m-dbc | m-dbc-hook | pump-amm | pump-curve | pancakeswap-v3 | manifest | byreal, or an array of themoptsend only one of dex and dexes
dexesarray of the dex labelsopt
txVersion0 | 1opt1 builds a v1 swap
swapTag0 | 1opt
maxAccounts1 to 64optthe most accounts the swap instruction may carry; 64 with swapTag 1 when omitted
{"jsonrpc":"2.0","id":1,"method":"quote","params":[{"src_mint":"So11111111111111111111111111111111111111112","dst_mint":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","amount_in":"1000000000","slippage_bps":50}]}

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

refuses403 -32050 the account lacks the quote module; 401 -32001 the key lacks the quote scope; 400 -32602 a param missing, unknown or out of range; 200 -32051 no route; 400 -32052 dex names a family the router lacks; 200 -32053 sell exceeds what the curve can pay; 200 -32054 token has no live pool; 200 -32055 no route fits the account cap; 400 -32600 sent in a batch