Skip to main content
POST
/
trade
/
quote
Get trade quote (EVM + Solana)
curl --request POST \
  --url https://api.afkcrypto.com/v1/trade/quote \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "chain": "<string>",
  "fromToken": "<string>",
  "toToken": "<string>",
  "amount": "<string>",
  "from": "<string>",
  "includeGas": true,
  "protocols": "<string>",
  "excludeProtocols": "<string>"
}'
{
  "quote": {
    "srcAmount": "1000000000000000000",
    "dstAmount": "998700000000000000",
    "fromToken": "0xSrc",
    "toToken": "0xDst",
    "approvalNeeded": true,
    "spender": "0xRouter",
    "allowanceTarget": "0xRouter",
    "raw": { "...": "..." }
  }
}
{
  "quote": {
    "srcAmount": "1000000000000000000",
    "dstAmount": "998700000000000000",
    "fromToken": "0xSrc",
    "toToken": "0xDst",
    "approvalNeeded": true,
    "spender": "0xRouter",
    "allowanceTarget": "0xRouter",
    "raw": { "...": "..." }
  }
}

Authorizations

x-api-key
string
header
required

Body

application/json
  • EVM
  • Solana
chain
string
required

EVM chain slug

fromToken
string
required
toToken
string
required
amount
string
required

Amount in wei (decimal or 0x-hex)

from
string | null

Wallet address for allowance checks (optional)

includeGas
boolean | null

Include gas estimates (optional)

protocols
string | null

Comma-separated allowlist of protocols (optional)

excludeProtocols
string | null

Comma-separated blocklist of protocols (optional)

Response

Quote response

quote
object
required
I