Skip to main content

Overview

Test the full swap lifecycle — getting quotes and executing cross-chain or same-chain token swaps — without spending real funds. Sandbox base URL: https://crypto-sandbox.yativo.com/api/v1/
Swap rates in the sandbox are simulated. They reflect approximate market conditions but are not live market prices.

Step 1 — Get a Swap Quote

Request a price quote before executing. The quote includes the expected output amount, rate, and fees.
string
required
Source blockchain: solana, ethereum, base, polygon, etc.
string
required
Source token ticker: USDC_SOL, ETH, SOL, etc.
string
required
Destination blockchain. Can be the same as from_chain for same-chain swaps.
string
required
Destination token ticker: USDC_ETH, USDC_SOL, etc.
string
required
Input amount in the source token’s native units, e.g. "100.00".
string
required
Source wallet address sending the funds.
string
required
Destination wallet address to receive the swapped funds.
Response — Quote
Quotes expire quickly (typically 60–120 seconds). If the quote expires before you execute, request a new one.

Step 2 — Execute the Swap

Execute a swap using a previously obtained quote ID.
string
required
The quote ID obtained from POST /swap/quote.
string
required
The asset ID of the source wallet to deduct funds from.
string
required
Destination wallet address to receive the swapped tokens.
Execute swap

Step 3 — Check Swap History

Retrieve the history of your swaps.
integer
Max results to return. Defaults to 20.
integer
Records to skip for pagination. Defaults to 0.
string
Filter by status: pending, completed, failed.
cURL
Response

Swap Status Values


Testing Scenarios

Wait 60–120 seconds after getting a quote, then try to execute it. Your application should receive an error and re-request a fresh quote.
Request a quote for more than your available balance, then try to execute it. Verify your application handles the INSUFFICIENT_BALANCE error.
After a swap completes, verify the balance update by calling POST /assets/get-user-assets. The source asset balance should decrease and the destination asset balance should increase.