Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Order Gateways and State Machines

Status Draft outlineSection Market and Trading Systems

An order gateway reconciles local intent with asynchronous acknowledgements, rejects, fills, cancels, disconnects, and session recovery.

Planned model

Drive an order through pending, live, partially filled, cancel-pending, terminal, and uncertain states while messages arrive late or duplicate.

Questions

  • Which transitions are legal from every state?
  • How are client and venue identifiers correlated?
  • What does the system know after a disconnect before reconciliation?

Exercise

Construct an order-state machine that treats duplicates idempotently and never resurrects a terminal order.