Order-Book Matching Engine

Deterministic single-thread core with gap-free events and replay

Order-Book Matching Engine Deterministic single-thread core with gap-free events and replay Deterministic core Traders · order flow · Architecture component Traders order flow Order Gateway · parse + validate · Architecture component Order Gateway parse + validate Sequencer · assign seq # · Deterministic core · linearization Sequencer assign seq # linearization Matching Core · single thread · Deterministic core · pure fn Matching Core single thread pure fn Order Book · price-time, in-mem · Deterministic core Order Book price-time, in-mem Input Journal · append-only, replay · Deterministic core Input Journal append-only, replay Event Stream · trades + deltas · Architecture component Event Stream trades + deltas Market Data · book + tape feed · Architecture component Market Data book + tape feed Clearing · fills to settlement · Architecture component Clearing fills to settlement orders validated match append emit Legend External Backend Message bus Database

Ingress

  • • Gateways parse and risk-check off the hot path
  • • Sequencer stamps one canonical, monotonic input stream

Deterministic core

  • • Single thread, no clock, no shared state
  • • Price-time priority over an in-memory book
  • • Pure function of the sequenced input

Egress + replay

  • • Gap-free trade + book-delta events
  • • Journal replays inputs bit-for-bit
  • • Shard by instrument to scale out