Design the message contract and flow between a firm's trading system (OMS/EMS) and an external exchange.
Assume:
-
The trading system sends orders and receives acknowledgements, rejects, cancels, and fills.
-
The exchange is an external system reachable over the network.
-
The system must handle retries, partial fills, out-of-order delivery, and disconnect/reconnect.
Deliverables:
-
What
message types
are required in each direction (trading system → exchange, exchange → trading system)?
-
For each message type, what are the
key fields
(IDs, timestamps, quantities, prices, etc.)?
-
How do you guarantee
idempotency
,
ordering
, and
exactly-once or effectively-once processing
at the application level?
-
How do you handle
session management
(heartbeats, sequence numbers, resend/replay) and
failure modes
(timeouts, dupes, reconnect)?