Back to News
PRODUCT UPDATENovember 28, 2025
Common Pitfalls in Exchange API Integration
In quant trading system development, exchange API integration is unavoidable — and it's also the piece whose effort is most often underestimated. On the surface it looks like a few REST endpoints for placing and querying orders, plus a WebSocket subscription for market data. In practice, the details pile up fast.
The first pitfall is rate limiting. Nearly every exchange caps request frequency, usually with separate weight budgets per endpoint — placing orders, canceling orders, and querying data each consume their own quota. Without proper request throttling and queuing, high-frequency calls can quickly trigger rate limits or even a temporary IP/API-key ban. This needs to be validated during load testing, not discovered in production.
The second pitfall is eventual consistency of order state. A successful response to a place-order request doesn't mean the order has been fully processed by the matching engine — there's a time gap between acceptance and actual fill or rejection, and REST-queried status can lag or diverge from WebSocket push updates. The system needs a single, unified order state machine that treats one data source as authoritative and correctly handles out-of-order or duplicate updates.
The third pitfall is reconnection handling. WebSocket connections drop due to network hiccups or exchange-initiated disconnects. After reconnecting, the client must re-subscribe and have a mechanism to backfill any market data or order updates missed during the outage — otherwise the system ends up making decisions on stale or incomplete data.
The fourth pitfall is idempotency. Deciding whether to retry an order placement after a network timeout is a classic source of bugs — if the original request actually succeeded, a retry causes a duplicate order. The standard approach is to generate a unique client order ID and rely on the exchange's deduplication by that ID.
The fifth pitfall is precision and lot-size rules. Every trading pair has its own price precision, quantity precision, and minimum notional value, so orders must be rounded according to exchange rules before submission — otherwise they get rejected outright.
The sixth pitfall is clock synchronization. Many exchanges' signature schemes require the request timestamp to fall within a tight tolerance window; server clock drift causes requests to be rejected, so periodic NTP calibration is necessary.
None of these issues is complicated in isolation, but together they're the main source of integration instability — worth investing real testing and fault-tolerance effort in from the start of system design.
