About this module
Design the matching engine where buyers and sellers become trades: price-time priority, FIX sessions and client order IDs, a sequencer and a journal, a single-threaded engine per stock, deterministic replay and a standby, the opening auction, and the safety rails that keep a market fair.
Lessons
- Lesson 36
Clarifying a Matching Engine
One exchange, limit and market orders, an opening auction, and speed that must be predictable
3:38 - Lesson 37
Estimating a Matching Engine
Twenty thousand messages a second, a million at the open, and one hot book
2:11 - Lesson 38
Invariants for an Exchange
Price then time, no order lost, the same trades on replay, and every order answered
1:59 - Lesson 39
The Exchange API: Sessions and Execution Reports
Long-lived FIX sessions, client order IDs, cancel and replace, and execution reports
2:23 - Lesson 40
Designing the Exchange
Gateways and risk checks, a sequencer, a journal, the matching engine, and what comes out
3:29 - Lesson 41
The Order Book
Bids and asks, a queue at every price, and an order that crosses two levels
3:10 - Lesson 42
One Thread, Replay and the Standby
Why one thread per stock, the rules of determinism, snapshots and a standby engine
2:21 - Lesson 43
The Opening Auction
A crossed book before the open, the price that matches the most, and the uncross
2:23 - Lesson 44
What Breaks First at an Exchange
Engine, gateway and sequencer failures, safety rails, and a delayed open
2:59 - Lesson 45
Exchange Follow-ups and the Invariant Replay
Self-trades, fairness between members, new stocks, and four ticks
2:04