LogoLogo
App
  • Overview
  • Partner Fees
  • Base URL
  • Quoting
    • Native Quote
    • Token to Token Quote
  • Swaps
    • Native Swaps
    • Token to Token Swaps
Powered by GitBook
On this page
  1. Quoting

Token to Token Quote

PreviousNative QuoteNextNative Swaps

Last updated 3 months ago

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
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"
}