slippage_exceeded error.
- Sandbox
- Production
Authorization: Bearer <token> header. POST endpoints accept an optional Idempotency-Key header to prevent duplicate transactions. Amounts are decimal strings. Network codes are uppercase as returned by GET /currencies: STELLAR, CELO, BITCOIN.
Generate a swap quote
Request a quote for swapping one asset to another. The quote locks the rate, minimum received amount, and fees for 30 minutes.Endpoint
Request headers
string
required
Bearer token
string
Optional unique key to prevent duplicate quote creation
Request body
object
required
Asset you are swapping from
object
required
Asset you are swapping to
string
required
Amount to swap as a decimal string
string
required
Which side the amount refers to:
from or tonumber
Maximum acceptable slippage as a percentage, e.g.
0.5 for 0.5%. Defaults to the slippage value from GET /currencies or 0.5% if not specified.Response fields
string
Quote ID, e.g.
sq_...object
object
string
Exchange rate (to per from unit)
string
Minimum amount you are guaranteed to receive, based on slippage
object
Fee breakdown:
number
Slippage percentage used for this quote
string
ISO 8601 timestamp. Quote expires 30 minutes after created_at.
string
ISO 8601 timestamp
Example request
Example response
Execute a swap
Execute a previously generated swap quote to create a swap transaction. The swap deducts the source asset from your balance and credits the target asset.Endpoint
Request headers
string
required
Bearer token
string
Optional unique key to prevent duplicate execution
Request body
string
required
ID of the swap quote to execute, e.g.
sq_7xYz9AbCdEfGhIjKstring
Optional external reference string
Response fields
The response is a wallet transaction object.string
Transaction ID, e.g.
txn_...string
Always
swapstring
pending, processing, completed, failed, or refundedobject
Source asset details:
object
Target asset details:
object
Fee breakdown as in the quote
string
Net target amount received after fees
string
External reference if provided
string
On-chain transaction hash (null until completed)
string
ISO 8601 timestamp
string
ISO 8601 timestamp
Example request
Example response
Understanding slippage
Slippage is the difference between the quoted price and the actual execution price. Market prices can change between quote generation and execution, especially for cross-network swaps. When you request a quote, you set aslippage tolerance as a percentage. If the executable rate moves unfavorably beyond that tolerance before you execute, the API returns a slippage_exceeded error and you must request a fresh quote.
The
minimum_received field in the quote shows the worst-case amount you are guaranteed to receive if the swap executes within tolerance.Error codes
Step-by-step flow
1
Request a quote
Call
POST /wallet/swap/quote with your from/to assets, amount, and optional slippage tolerance.2
Review the quote
Check the
rate, minimum_received, and fee. The quote is valid for 30 minutes.3
Execute the quote
Call
POST /wallet/swap with the quote_id. No additional balance checks are needed.4
Track completion
Poll GET /orders/{order_id} or listen for webhook events
transaction.processing, transaction.completed, and transaction.failed.