Skip to main content
This guide covers the full token swap flow: browsing available assets, finding valid swap routes, getting a quote, executing the swap, and monitoring the result.
Test swaps in the Sandbox at https://crypto-sandbox.yativo.com/api/v1/. Sandbox swaps simulate the full flow with test assets.
1

Browse available swap assets

Retrieve the list of assets supported for swapping. Use this to populate asset selector UI in your app.
Response (excerpt):
2

Find valid swap routes

Retrieve the available routes for a given asset pair. Routes describe the path the swap will take (which DEXes or bridges are involved) and help you select the best option.
Response:
3

Get a quote

Request a precise quote for a specific amount. Quotes have a short expiry window — execute the swap before the quote expires.
Response:

Quote expiry handling

Quotes are valid for 3 minutes by default. If a quote expires before execution, request a fresh one.
TypeScript
4

Execute the swap

Submit the swap using the quoteId. The quote must not have expired.
Response:
5

Monitor swap status

Poll the swap history endpoint to monitor status. For master wallet swaps, you can also subscribe to the master_wallet.swap webhook event.
Completed swap response:

Swap statuses

Fee Breakdown

Every quote response includes a fees object:
The actualToAmount in the completed swap may differ slightly from expectedToAmount in the quote due to slippage and real-time gas fluctuations.

Next Steps