Learning objective
Design an auditable market data pipeline and understand order-state transitions.
A cancel request and its acknowledgment are different events. Keep late fills, outstanding shares and residual parent quantity reconciled as messages arrive.
Desk mechanics
Data used by a desk include instrument reference data, trades, quotes, full or partial order book updates, corporate actions, economic releases, positions and risk. Every record needs an identifier, venue/source, timestamp and units. Distinguish exchange event time, receipt time and processing time; time-zone and daylight-saving differences create alignment bugs. Snapshots rebuild state; incremental messages change it. Missing sequence numbers, stale feeds and duplicate messages must trigger validation or recovery. A vendor symbol is not a permanent universal identifier. An order-management system tracks parent orders, child orders, acknowledgments, fills, cancel/replace requests, rejects and terminal states. Partial fills can arrive while cancellation is pending. Use unique order and execution identifiers and idempotent processing to avoid double-booking. A basic risk system checks maximum order size, notional, price bands, positions, credit and permissions before routing. Model operational behavior using a synthetic event stream, not live trading access.
Hypothetical worked example
Parent buy 10,000 shares. Child order A acknowledged for 6,000; fills 2,500; cancel requested; another fill of 1,000 arrives before cancel acknowledgment. Filled quantity 3,500, canceled remainder 2,500. Remaining parent target=6,500, not 7,500. An analyst ignoring the late fill over-orders by 1,000 shares.
Desk application
If the router resubmits 7,500 after ignoring the 1,000 late fill, the completed parent could become 11,000 shares. On a disconnect, reconcile fills and live leaves with the venue before resuming. Record exchange timestamps and sequence identifiers so the trader can distinguish delayed data from a genuine liquidity change.
Professional extension
Design schemas with event_id, order_id, parent_id, instrument_id, event_time, received_time, event_type, side, quantity, price, currency and status. Validate monotonically increasing sequences where appropriate, reconcile final positions with authoritative fills, and implement stale-feed alerts. Avoid storing credentials or client order data in public labs.
Practice
Why is a delayed quote dangerous even if its price was valid when produced?
Reveal the explanation
It may no longer reflect current executable markets and may cause adverse selection or breaches.
Key takeaways
Data provenance and state consistency are risk controls; order events can arrive asynchronously; deterministic reconciliation matters.