Query a Swap
Query a swap from the API
Follow the above OpenAPI spec to query the routes endpoint, and receive a swap quote.
The return data will have the shape:
Last updated
Query a swap from the API
Follow the above OpenAPI spec to query the routes endpoint, and receive a swap quote.
The return data will have the shape:
Last updated
Field | Description |
---|---|
expectedOut
Non decimal-adjusted output amount for the given trade. When displayed on a UI, you will have to account for decimals.
routerAddress
Address at the correct router implementation to perform the swap
details
Information necessary to perform the swap on chain. Some details, such as path, may be interesting to the end user. See Execute a Swap for a deeper breakdown of the details
` object.
Get a swap route from one token to another
Input token for swap
Output token
Total amount of input token to be traded
Transaction originator. If present, will return a transaction ready to be signed
Allowed slippage, in bips. Can be congifigured at transaction, defaults to 10 BPS
Recipient of trade. Defaults to from
Deadline for quote, defaults to 5 minutes
Chain to perform swap on, defaults to 42220 (CELO). More chains coming soon.
Path found Successfully