메인 콘텐츠로 건너뛰기
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": { "...": "..." }
  }
}
네이티브 자산(ETH, SOL 등) 거래 시 fromToken/toTokenNATIVE 키워드를 사용하세요. 요청 제한(사용자당 15/분). Solana 메인넷만 지원(devnet/testnet 미지원). ERC20로 from 제공 시 approvalNeededspender를 반환합니다.
{
  "quote": {
    "srcAmount": "1000000000000000000",
    "dstAmount": "998700000000000000",
    "fromToken": "0xSrc",
    "toToken": "0xDst",
    "approvalNeeded": true,
    "spender": "0xRouter",
    "allowanceTarget": "0xRouter",
    "raw": { "...": "..." }
  }
}

인증

x-api-key
string
header
필수

본문

application/json
chain
string
필수

EVM chain slug

fromToken
string
필수
toToken
string
필수
amount
string
필수

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)

응답

Quote response

quote
object
필수