Token to Token Quote
Returns the best quote for swapping directly between tokens. Token decimals are automatically detected using ERC20 standard calls. Includes both direct and indirect (via native currency) routing options.
Query parameters
tokenInstringRequiredExample:
The input token address
0x1234567890123456789012345678901234567890
Pattern: ^0x[a-fA-F0-9]{40}$
tokenOutstringRequiredExample:
The output token address
0xabcdef1234567890abcdef1234567890abcdef12
Pattern: ^0x[a-fA-F0-9]{40}$
amountstringRequiredExample:
The amount of input token as a BigInt string
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/token HTTP/1.1
Host: api.coal.ag
Accept: */*
{
"amountOutToken": "985000000000000000",
"quoteData": "eyJ0b2tlbkluIjoiMHgxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwIiwidG9rZW5PdXQiOiIweGFiY2RlZjEyMzQ1Njc4OTBhYmNkZWYxMjM0NTY3ODkwYWJjZGVmMTIiLCJhbW91bnRJblRva2VuSW4iOiIxMDAwMDAwMDAwMDAwMDAwMDAwIiwiYW1vdW50T3V0VG9rZW5PdXQiOiI5ODUwMDAwMDAwMDAwMDAwMDAiLCJ0b2tlbkRlY2ltYWxzSW4iOjE4LCJ0b2tlbkRlY2ltYWxzT3V0IjoxOCwiZXhjaGFuZ2UiOjAsInBhcmFtcyI6eyJzdGFibGUiOmZhbHNlLCJ0aWNrU3BhY2luZyI6MCwiZmVlIjowLCJiaW5TdGVwIjoiMCIsInJldmVyc2VkIjpmYWxzZX19"
}
Last updated