Native Quote
Returns the best quote for buying or selling tokens with native currency. Token decimals are automatically detected using ERC20 standard calls.
Query parameters
actionstring · enumRequiredExample:
The swap direction - either buy tokens with native currency, or sell tokens for native currency
buy
Possible values: tokenAddressstringRequiredExample:
The token address to buy or sell
0x1234567890123456789012345678901234567890
Pattern: ^0x[a-fA-F0-9]{40}$
amountstringRequiredExample:
The amount as a BigInt string. For buy - This is the amount of native currency to spend. For sell - This is the amount of tokens to sell.
1000000000000000000
feeBpsinteger · max: 10000OptionalExample:
Partner fee in basis points (0-10000)
25
feeRecipientstringOptionalExample:
Address to receive the partner fee
0xabcdef1234567890abcdef1234567890abcdef12
Pattern: ^0x[a-fA-F0-9]{40}$
Responses
200
Successful quote response
application/json
400
Invalid request parameters
application/json
404
No quotes found
application/json
500
Internal server error
application/json
get
GET /api/v1/quotes/native HTTP/1.1
Host: api.coal.ag
Accept: */*
{
"amountOutNative": "985000000000000000",
"quoteData": "eyJ0b2tlbk91dCI6IjB4MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MCIsImFtb3VudEluTmF0aXZlIjoiMTAwMDAwMDAwMDAwMDAwMDAwMCIsImFtb3VudE91dEluVG9rZW5zIjoiOTg1MDAwMDAwMDAwMDAwMDAwIiwidG9rZW5PdXREZWNpbWFscyI6MTgsImV4Y2hhbmdlIjowLCJwYXJhbXMiOnsic3RhYmxlIjpmYWxzZSwidGlja1NwYWNpbmciOjAsImZlZSI6MCwiYmluU3RlcCI6IjAiLCJyZXZlcnNlZCI6ZmFsc2V9fQ=="
}
Last updated