01Which order types must the book support?
All four core types, each defined by how it completes: a market order consumes the book immediately at whatever prices rest there; a limit order rests at its price until filled or cancelled; IOC (immediate-or-cancel) takes what is available and cancels the rest; cancel/replace re-prices without losing queue position unfairly.
02An order arrives — where does it try to fill first?
Own book first: the order matches against resting orders at price-time priority — best price wins, first-come wins ties — in microseconds, and only the unfilled residual ever leaves the building.
03The book fills 4,000 of 10,000 — how does the rest get done?
The residual is completed across the street: internalize against a wholesaler’s streamed quote when it improves on the public best price, otherwise route a child order to the venue displaying the best protected quote — never execute through a better price shown elsewhere.
04Fills now come back from three places — what does the client see?
One parent order, many fill sources: every fill — local book, wholesaler, away venue — appends to the parent; state (partially_filled 7,000/10,000) is derived from the fill log, and the order is done only when the residual is zero or explicitly cancelled.
05A cancel arrives while 3,000 shares are in flight to another venue?
Cancel is routed like an order: the resting slice cancels instantly, the in-flight routed slice sends a cancel to its venue, and the final state waits for that venue’s answer — shares that filled before the cancel landed stay filled.
06How do watchers learn the book moved?
Every match publishes: trade prints and book deltas flow to a separate market-data plane, tiered per subscriber (conflated top-of-book for most, full depth for professionals), and the matching path never waits for a subscriber.