Route
Calculate the optimal swap route and generate execution parameters for a token exchange
Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Query Parameters
The amount of input tokens to swap (in token's smallest unit)
^[0-9]+$"5000000000"
Contract address of the input token to sell. The zero address (0x00…00) represents the native currency ETH.
^0x[a-fA-F0-9]{40}$"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
Contract address of the output token to buy. The zero address (0x00…00) represents the native currency ETH.
^0x[a-fA-F0-9]{40}$"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
The slippage tolerance in basis points (e.g., 50 for 0.5%)
0 <= x <= 10000Optional timeout in milliseconds. If set, returns the best pathfinder result within the timeout window. Must be a positive integer.
x >= 1Response
Successfully calculated swap route with execution details
Successfully created route with execution details
Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix
^0x[a-fA-F0-9]{32}$Amount of tokens to receive
^[0-9]+$Minimum amount of tokens to receive after slippage
^[0-9]+$The target contract address for the swap
^0x[a-fA-F0-9]{40}$Hex encoded calldata for the swap
^0x[a-fA-F0-9]*$Actual gas consumed by the swap simulation
x >= 0180000
Recommended gas limit for the swap transaction (gasUsed * 1.3)
x >= 0234000