Get a quote
Get the selected route, output amounts, approval requirement, and transaction to sign.
GET
/v1/quoteAPI key requiredQuery parameters
| Parameter | Required | Description |
|---|---|---|
| fromChain / toChain | Yes | Case-sensitive names from /v1/chains. |
| fromToken / toToken | Yes | Token address on the corresponding chain, or its native identifier. |
| amount | Yes | Positive integer string in the input token’s smallest unit. No decimal point or sign. |
| fromAddress | Yes | Wallet that signs and pays. |
| toAddress | Conditional | Defaults to fromAddress. Required when chain families differ, such as EVM → SOL. |
| slippageBps | No | Slippage tolerance, not a fee. Integer 1–5000 bps (1 bps = 0.01%). Defaults to 30 (0.3%) for same-chain or 70 (0.7%) for cross-chain quotes when omitted. Sets the tolerated adverse price movement; it is not a fixed deduction from the trade amount. |
Unknown or repeated query parameters return code 2001. Addresses are validated for their chain family. Use URL encoding for query values.
curl --get 'https://api.kernelflow.org/v1/quote' \
--header "X-API-Key: $AGGREGATOR_API_KEY" \
--data-urlencode 'fromChain=BNB' \
--data-urlencode 'toChain=BNB' \
--data-urlencode 'fromToken=0x55d398326f99059fF775485246999027B3197955' \
--data-urlencode 'toToken=0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d' \
--data-urlencode 'amount=1000000000000000000' \
--data-urlencode "fromAddress=$USER_ADDRESS"Quote response
The following is an illustrative cross-chain response, independent of the request above. Calldata is shortened and timestamps are historical; never submit this sample.
{
"code": 0,
"msg": "success",
"data": {
"toAmount": "1967167",
"minToAmount": "1967167",
"estimatedSeconds": 30,
"expiresAt": 1793943430,
"approval": {
"token": "0x55d398326f99059fF775485246999027B3197955",
"spender": "0xB0E42E806cb213e811A3af3ebbD49A6743712A21",
"amount": "2000000000000000000"
},
"tx": {
"kind": "evm",
"to": "0xB0E42E806cb213e811A3af3ebbD49A6743712A21",
"data": "0x...",
"value": "0",
"gasLimit": "723070"
}
}
}| Field | Meaning |
|---|---|
| toAmount | Expected output in the output token’s smallest unit, after the protocol fee. |
| minToAmount | Minimum after slippage; enforced by ApproveManager for same-chain contract execution and by the provider for cross-chain execution. |
| estimatedSeconds | Optional estimated time to arrival. |
| expiresAt | Optional expiry in Unix seconds. Requote after expiry; without it, use about 60 seconds at most. |
| approval | Token, spender, and amount to approve. Absent for native input. |
| tx.kind | evm, solana, or tron. |
| tx.to | Contract target; ApproveManager on EVM contract chains. May be omitted for serialized transactions. |
| tx.data | 0x-prefixed hex calldata for EVM/TRON; 0x-prefixed hex of the full serialized transaction for SOL. |
| tx.value | Native amount as a decimal integer string. Omitted means zero. |
| tx.gasLimit | Decimal integer string. Use as returned; estimate when absent. |
| tx.gasPrice | Optional gas price. Usually absent; select current gas pricing yourself. |
| tx.feeLimit | Optional TRON fee limit. |
| channel / route | Optional informational fields. Never depend on them for integration logic. |