Skip to main content

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:
1

Get Supported Assets

Fetch available tokens from /tokens
2

Request Quote

Get a quote with anonymous: false for standard routing
3

Create Order

Submit swap order with user’s destination address
4

Single CEX Routing

Funds are routed through one centralized exchange
5

Receive Funds

Output tokens sent directly to destination address

Integration Guide

Step 1: Get Supported Assets

Before requesting a quote, fetch the available tokens. Learn more about CEX tokens.
Performance Note: The /tokens endpoint can take several seconds to minute to respond due to the large token list.
  • Save tokens in your backend database
  • Load tokens on server startup or via scheduled job
  • Serve token list from your database to frontend
  • Refresh cache periodically (e.g., every 24 hours)

Step 2: Request Quote

Request a quote with anonymous: false for standard routing. Use token symbols from the /tokens endpoint:

Quote Response

Key Fields:
  • type: "standard" for single-hop routing
  • swap: CEX provider code (e.g., "cl" for Changelly)
  • swapName: Human-readable CEX name
  • path: Single CEX routing path
  • duration: Estimated completion time in minutes
  • markupSupported: Whether markup/fees can be added

Step 3: Create Swap

Create the swap order using the /exchange endpoint:

Exchange Response

Key Response Fields:
  • houdiniId: Unique swap identifier - use this to check status
  • senderAddress: Deposit address where you send funds
  • receiverAddress: Your destination address
  • inAmount / outAmount: Expected amounts for the swap
  • status: Current swap status (0 = pending deposit)
  • inStatus: Detailed status for the swap
  • expires: Quote expiration time (typically 30 minutes)
  • eta: Estimated time to completion in minutes
  • quote.path: Single CEX provider code
Important: Send exactly inAmount of inSymbol to the senderAddress within the expiration time.

Step 4: Send Deposit

After creating the swap, send the tokens to the deposit address:
1

Get Deposit Address

Use senderAddress from the exchange response
2

Send Exact Amount

Send exactly inAmount of the source token
3

Wait for Confirmations

Status will change from 0 (WAITING) to 1 (CONFIRMING)

Step 5: Monitor Status

Poll the status endpoint to track swap progress:

Status Progression

Standard swaps follow this status flow:
Polling: Check status every 30 seconds. Standard swaps typically complete in 3-30 minutes.

Complete Example

For a complete, runnable Node.js example:

Standard Swap Example

Complete standard swap script with status monitoring

Best Practices

  • Poll status every 30 seconds
  • Handle all status codes properly (0-8)
  • Store houdiniId for future reference
  • 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)
  • Show clear deposit instructions
  • Display countdown for quote expiration
  • Provide CEX provider information
  • Show estimated completion time
  • Display transaction progress clearly
  • 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

Causes:
  • Network congestion on source/destination chain
  • CEX processing delays
  • Deposit confirmation delays
Solution: Continue monitoring. Most swaps complete within 2x the estimated time.
Issue: User sent incorrect amount to deposit addressSolution:
  • Partial refund may be processed
  • Contact support with houdiniId
  • Always send exact inAmount
Cause: Took too long to deposit after creating swapSolution: Create new swap with fresh quote. Quotes expire after 30 minutes.
Issue: Swap stuck at status 1 (CONFIRMING)Solution:
  • Wait for blockchain confirmations
  • Check transaction on block explorer
  • Verify correct amount was sent

Next Steps

Private Swaps

Learn about private multi-hop swaps

DEX Swaps

Integrate on-chain DEX swaps

Order Lifecycle

Understand swap status progression

Error Handling

Handle errors and edge cases