Token to Token Swaps

Important: Token swapping requires approval (if not already approved). This is shown in additionalTransactions. Always check for additional transactions and execute them first, then execute transactionData

Get transaction data for token-to-token swaps

post

Returns transaction data for swapping directly between tokens. Uses the quoteData from a previous quote API call to generate executable transaction data. Always includes token approval transaction data when needed.

Body
quoteDatastringRequired

Encoded quote data from a previous call to the quotes/token API

Example: eyJ0b2tlbkluIjoiMHgxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwIiwidG9rZW5PdXQiOiIweGFiY2RlZjEyMzQ1Njc4OTBhYmNkZWYxMjM0NTY3ODkwYWJjZGVmMTIiLCJhbW91bnRJblRva2VuSW4iOiIxMDAwMDAwMDAwMDAwMDAwMDAwIiwiYW1vdW50T3V0VG9rZW5PdXQiOiI5ODUwMDAwMDAwMDAwMDAwMDAiLCJ0b2tlbkRlY2ltYWxzSW4iOjE4LCJ0b2tlbkRlY2ltYWxzT3V0IjoxOCwiZXhjaGFuZ2UiOjAsInBhcmFtcyI6eyJzdGFibGUiOmZhbHNlLCJ0aWNrU3BhY2luZyI6MCwiZmVlIjowLCJiaW5TdGVwIjoiMCIsInJldmVyc2VkIjpmYWxzZX19
slippagenumber · max: 100Optional

Slippage tolerance percentage (0-100)

Default: 0.5Example: 1
toAddressstringOptional

Address to receive tokens (defaults to sender)

Example: 0xabcdef1234567890abcdef1234567890abcdef12Pattern: ^0x[a-fA-F0-9]{40}$
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
chevron-right
200

Transaction data for executing the swap

application/json
post
/api/v1/swap/token

Last updated