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.
| param | type | ||
|---|---|---|---|
| src_mint | pubkey | req | |
| dst_mint | pubkey | req | must differ from src_mint |
| amount_in | u64, number or decimal string | req | non zero, in base units |
| slippage_bps | u64 | req | 0 to 5000 |
| dex | r-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 them | opt | send only one of dex and dexes |
| dexes | array of the dex labels | opt | |
| txVersion | 0 | 1 | opt | 1 builds a v1 swap |
| swapTag | 0 | 1 | opt | |
| maxAccounts | 1 to 64 | opt | the 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