Overview
Standard swaps use a single centralized exchange (CEX) for routing, providing the fastest execution times. These swaps use CEX tokens from the/tokens endpoint and are routed directly through one exchange, completing in 3-30 minutes on average.
Best For: Users who prioritize speed and want the fastest completion times (typically 3-30 minutes) with straightforward single-hop routing.
How It Works
Standard swaps follow this flow:Integration Guide
Step 1: Get Supported Assets
Before requesting a quote, fetch the available tokens. Learn more about CEX tokens.Step 2: Request Quote
Request a quote withanonymous: false for standard routing. Use token symbols from the /tokens endpoint:
Quote Response
type:"standard"for single-hop routingswap: CEX provider code (e.g.,"cl"for Changelly)swapName: Human-readable CEX namepath: Single CEX routing pathduration: Estimated completion time in minutesmarkupSupported: Whether markup/fees can be added
Step 3: Create Swap
Create the swap order using the/exchange endpoint:
Exchange Response
houdiniId: Unique swap identifier - use this to check statussenderAddress: Deposit address where you send fundsreceiverAddress: Your destination addressinAmount/outAmount: Expected amounts for the swapstatus: Current swap status (0= pending deposit)inStatus: Detailed status for the swapexpires: Quote expiration time (typically 30 minutes)eta: Estimated time to completion in minutesquote.path: Single CEX provider code
Step 4: Send Deposit
After creating the swap, send the tokens to the deposit address:Step 5: Monitor Status
Poll the status endpoint to track swap progress:Status Progression
Standard swaps follow this status flow:Complete Example
For a complete, runnable Node.js example:Standard Swap Example
Complete standard swap script with status monitoring
Best Practices
Transaction Monitoring
Transaction Monitoring
- Poll status every 30 seconds
- Handle all status codes properly (0-8)
- Store
houdiniIdfor future reference
Error Handling
Error Handling
- Check for quote expiration before creating swap
- Validate deposit address format
- Handle network congestion delays
- Implement retry logic for API calls
- Check final states: COMPLETED (4), FAILED (6), EXPIRED (5), REFUNDED (7)
User Experience
User Experience
- Show clear deposit instructions
- Display countdown for quote expiration
- Provide CEX provider information
- Show estimated completion time
- Display transaction progress clearly
Security
Security
- Validate all addresses before submitting
- Never expose API keys in frontend
- Verify compliance headers are correct
- Store swap records for audit trail
- Use backend-only API integration
Common Issues
Swap Taking Longer Than Expected
Swap Taking Longer Than Expected
Causes:
- Network congestion on source/destination chain
- CEX processing delays
- Deposit confirmation delays
Wrong Amount Deposited
Wrong Amount Deposited
Issue: User sent incorrect amount to deposit addressSolution:
- Partial refund may be processed
- Contact support with
houdiniId - Always send exact
inAmount
Quote Expired
Quote Expired
Cause: Took too long to deposit after creating swapSolution: Create new swap with fresh quote. Quotes expire after 30 minutes.
Status Stuck at CONFIRMING
Status Stuck at CONFIRMING
Issue: Swap stuck at status 1 (CONFIRMING)Solution:
- Wait for blockchain confirmations
- Check transaction on block explorer
- Verify correct amount was sent