Skip to content
KernelFlowDevelopers v1
Get a quote
Swap & Bridge/API reference
KERNELFLOW / DEVELOPERS

Get a quote

Get the selected route, output amounts, approval requirement, and transaction to sign.

GET/v1/quoteAPI key required

Query parameters

ParameterRequiredDescription
fromChain / toChainYesCase-sensitive names from /v1/chains.
fromToken / toTokenYesToken address on the corresponding chain, or its native identifier.
amountYesPositive integer string in the input token’s smallest unit. No decimal point or sign.
fromAddressYesWallet that signs and pays.
toAddressConditionalDefaults to fromAddress. Required when chain families differ, such as EVM → SOL.
slippageBpsNoSlippage 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.

Request · BNB USDT → USDC
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.

Response · illustrative only
{
  "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"
    }
  }
}
FieldMeaning
toAmountExpected output in the output token’s smallest unit, after the protocol fee.
minToAmountMinimum after slippage; enforced by ApproveManager for same-chain contract execution and by the provider for cross-chain execution.
estimatedSecondsOptional estimated time to arrival.
expiresAtOptional expiry in Unix seconds. Requote after expiry; without it, use about 60 seconds at most.
approvalToken, spender, and amount to approve. Absent for native input.
tx.kindevm, solana, or tron.
tx.toContract target; ApproveManager on EVM contract chains. May be omitted for serialized transactions.
tx.data0x-prefixed hex calldata for EVM/TRON; 0x-prefixed hex of the full serialized transaction for SOL.
tx.valueNative amount as a decimal integer string. Omitted means zero.
tx.gasLimitDecimal integer string. Use as returned; estimate when absent.
tx.gasPriceOptional gas price. Usually absent; select current gas pricing yourself.
tx.feeLimitOptional TRON fee limit.
channel / routeOptional informational fields. Never depend on them for integration logic.