Token to Token Quote

Get quotes for token-to-token swaps

get

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
tokenInstringRequired

The input token address

Example: 0x1234567890123456789012345678901234567890Pattern: ^0x[a-fA-F0-9]{40}$
tokenOutstringRequired

The output token address

Example: 0xabcdef1234567890abcdef1234567890abcdef12Pattern: ^0x[a-fA-F0-9]{40}$
amountstringRequired

The amount of input token as a BigInt string

Example: 1000000000000000000
feeBpsinteger · max: 10000Optional

Partner fee in basis points (0-10000)

Example: 25
feeRecipientstringOptional

Address to receive the partner fee

Example: 0xabcdef1234567890abcdef1234567890abcdef12Pattern: ^0x[a-fA-F0-9]{40}$
Responses
200

Successful quote response

application/json
get
GET /api/v1/quotes/token HTTP/1.1
Host: api.coal.ag
Accept: */*
{
  "amountOutToken": "985000000000000000",
  "quoteData": "eyJ0b2tlbkluIjoiMHgxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwIiwidG9rZW5PdXQiOiIweGFiY2RlZjEyMzQ1Njc4OTBhYmNkZWYxMjM0NTY3ODkwYWJjZGVmMTIiLCJhbW91bnRJblRva2VuSW4iOiIxMDAwMDAwMDAwMDAwMDAwMDAwIiwiYW1vdW50T3V0VG9rZW5PdXQiOiI5ODUwMDAwMDAwMDAwMDAwMDAiLCJ0b2tlbkRlY2ltYWxzSW4iOjE4LCJ0b2tlbkRlY2ltYWxzT3V0IjoxOCwiZXhjaGFuZ2UiOjAsInBhcmFtcyI6eyJzdGFibGUiOmZhbHNlLCJ0aWNrU3BhY2luZyI6MCwiZmVlIjowLCJiaW5TdGVwIjoiMCIsInJldmVyc2VkIjpmYWxzZX19"
}

Last updated