Design a Low-Latency Electronic Trading System
Ingest market data, validate strategy order intents, route orders to exchanges, and reconcile executions with predictable low latency.
Problem statement
For this exercise, assume you are designing the first production version of a low-latency electronic trading system.
It receives sequenced exchange market data, lets one automated strategy submit or cancel order intents, applies pre-trade limits, sends accepted orders through colocated exchange gateways, and reconciles acknowledgments, partial fills, fills, cancellations, and rejects.
The colocated host provides a low-latency local persistence primitive that survives process restart; a compact prepared send occurrence is committed before exchange transmission. Operators need a kill switch and an auditable view of order and system health.
Focus on the software and hardware boundaries from network ingress to exchange egress. Exclude strategy research, portfolio optimization, whole-site disaster recovery, and the exchange's matching engine.
What to build
- Ingest, validate, sequence, and normalize market-data updates from exchange feeds, exposing gaps or stale state to the strategy.
- Accept strategy order intents and reject any intent that violates configured pre-trade limits or a global kill switch.
- Commit a prepared send occurrence, route each accepted order at most once to the correct exchange gateway, and apply duplicate acknowledgments, partial fills, fills, cancels, and rejects idempotently.
- Give operators a current order view, health signals, and a kill switch that stops new risk while preserving recovery and audit data.
At scale
- Assume bursts of up to 1,000,000 market-data updates per second in one colocated deployment.
- Assume p99 from an accepted strategy order intent to bytes handed to the exchange gateway must stay below 100 microseconds during normal load.
- An order intent may be accepted at most once, and every exchange response must remain attributable after process recovery.
- The first version uses one active colocated site; local persistent storage survives process restarts, durable order state must be restored within 30 seconds, and whole-site failure is out of scope.