Skip to main content

Overview

Standard swaps route through a single centralized exchange (CEX) for fast execution. In API v2, all swap types — standard, private, and DEX — share the same /quotes and /exchanges endpoints. Pass types=standard to get only standard quotes, or filter the response by type: "standard". Tokens are identified by their ID (not symbol), and orders are created by passing a quoteId.
Best For: Users who prioritize speed and want the fastest completion times (typically 3-30 minutes) with straightforward single-hop routing.
Looking for the v1 standard swap guide? See API v1 — Standard Swap.
Need to guarantee the output amount? Add fixed=true and a refundAddress to your quote request to lock the rate. See the Fixed Rate Swap Guide for the full flow.

How It Works

1

Get Tokens

Bulk fetch CEX-supported tokens and cache to your DB, or search by name/symbol. Note each token’s id.
2

Get Quotes

Call GET /quotes with token IDs. The response returns quotes from all available providers — select the one with type: "standard".
3

Create Order

Call POST /exchanges with the selected quoteId and the user’s destination address.
4

Send Deposit

Send exactly inAmount of the input token to the depositAddress returned in the order.
5

Monitor Status

Poll GET /orders/{houdiniId} until statusLabel is FINISHED.

Integration Guide

Step 1: Get Tokens

There are two approaches for getting tokens. Choose the one that fits your integration:
Fetch all CEX-supported tokens once and store them in your backend database. This is the best approach for production integrations — it keeps your UI fast and avoids hammering the API.
Cache the token list in your backend database. Load on server startup or via a scheduled job, and refresh periodically (e.g., every 24 hours). Never call /tokens on every user request.

Step 2: Get Quotes

Call GET /quotes using token IDs (not symbols). The response includes quotes from all available providers across all swap types.

Quotes Response

Key Fields:
  • quoteId: Pass this to /exchanges to create the order
  • type: "standard" for single-hop CEX routing
  • swap / swapName: CEX provider code and human-readable name
  • amountOut: Output amount
  • duration: Estimated completion time in minutes
  • min / max: Valid input amount range

Step 3: Create Order

Pass the quoteId and destination address to POST /exchanges:

Order Response

Key Response Fields:
  • houdiniId: Unique order identifier — use for status polling
  • depositAddress: Send input funds here
  • inAmount / inSymbol: Exact amount and token to send
  • expires: Deposit deadline (typically 30 minutes)
  • statusLabel: Human-readable order status
  • eta: Estimated completion time in minutes
Send exactly inAmount of inSymbol to depositAddress before expires.

Step 4: Send Deposit

After creating the order, send the input tokens to depositAddress. The status will advance automatically once the deposit is detected on-chain.

Step 5: Monitor Order Status

Poll GET /orders/{houdiniId} to track progress, or subscribe via the WebSocket API for real-time updates:

Status Progression

Poll every 30 seconds. Standard swaps typically complete in 3–30 minutes. For real-time updates without polling, use the WebSocket API.

Best Practices

  • Bulk fetch + cache: Paginate through /v2/tokens?hasCex=true on server startup and store in your DB. Refresh every 24 hours.
  • Search: Use ?term=<query> for on-demand token lookup — good for lightweight integrations.
  • Never call /tokens on every user request in production.
  • Poll /orders/{houdiniId} every 30 seconds
  • Store houdiniId for future reference and support lookups
  • Handle all statusLabel values: FINISHED, FAILED, EXPIRED, REFUNDED
  • Re-fetch quotes if quote is expired before calling /exchanges
  • Validate addressTo format before submitting
  • Implement retry logic with backoff for API calls
  • Never expose API keys in frontend code
  • Use backend-only API integration
  • Validate all addresses before submitting
  • Store order records for audit trail

Common Issues

Causes: Network congestion, CEX processing delays, slow block confirmations.Solution: Continue monitoring. Most swaps complete within 2× the estimated time.
Issue: User sent an incorrect amount to the deposit address.Solution: A partial refund may be processed. Contact support with the houdiniId.
Cause: Deposit was not received before the expires timestamp.Solution: Fetch a new quote and create a new order.
Solution: Wait for blockchain confirmations. Check the deposit transaction on a block explorer and verify the correct amount was sent.

Example Repositories

See full working integrations on GitHub:

Next.js Example

Full Next.js integration showing standard, private, and DEX swap flows

Node.js Example

Backend Node.js integration with token fetching, quoting, and order tracking

Next Steps

Private Swaps

Multi-hop privacy swaps

DEX Swaps

On-chain decentralized swaps

Order Lifecycle

Understand all order statuses

Error Handling

Handle errors and edge cases