Research survey: matching engines and market-making models

Compiled 2026-11-13 for phase 0 (architecture + order book). Purpose: decide what the exchange, simulator and strategies must model, and keep a register of which facts and formulas are verified and which still need checking before they are relied on.

How this was researched, and how far to trust it

Two research passes ran in parallel, one on exchange rules and one on the literature. Their access was limited:

Every item below carries a tag:

Tag Meaning
[V] Verified from an index record or abstract page that was read
[S] Search-snippet level only: plausible and sourced, not read in full
[M] From memory, not checked against a source (standard references, listed for completeness)

Nothing tagged [S] or [M] should be implemented or quoted as fact until it has been checked against the primary text. Section D lists the formulas that must be transcribed from the papers first.


A. Exchange matching engines

A1. How production engines are built

A2. Matching rules differ by venue

Topic What we found Our rulebook
Allocation CME Globex tag 1142 lists FIFO, FIFO with LMM, pro-rata, configurable, threshold pro-rata (with or without LMM), institutional prioritisation, allocation, and EBS size priority [S]. FIFO only (R3); pro-rata later
Modify priority CME: a quantity decrease keeps priority; an increase, price change or account change loses it [S]. Nasdaq OUCH: a Replace always loses priority, and only a partial cancel keeps it [S]. CME convention (R9)
Replace quantity Vendor FIX docs (CQG, Kalshi) treat OrderQty in a cancel/replace as the new total including the filled quantity [S]. For OrderQty ≤ CumQty, practice varies between rejecting and stopping the order (FIX errata case D11) [S]. Total-quantity semantics; at or below filled = order done (R9)
Self-trade prevention CME: the aggressing order’s instruction (tag 8000) decides which side is cancelled; cancel-resting is the default [S]. Nasdaq: cancel oldest / newest [S]. Aggressor’s instruction; four modes (R5)
Market orders CME “market with protection”: the order fills only within a protection band around the best opposite price, and the remainder rests as a limit at the band edge [S]. Not yet: market orders sweep (risk K14)
Auctions Xetra: maximum executable volume, with the price closest to the reference price as the last resort [S]. Minimum surplus and market pressure as explicit steps were not confirmed. Euronext criteria were not reachable. Nasdaq’s opening cross minimises imbalance after maximising volume [S]. Four-step rule over the tick grid (R7)
Volatility halts US LULD: 15 s in a limit state triggers a 5-minute pause, reopened by an auction at the listing exchange [S]. Xetra volatility interruption: an extra auction of at least 2 minutes with a random end [S]. CME Velocity Logic: a brief “reserved” state, then reopening [S]. Halts/auctions driven by the session schedule (R8); automatic triggers later
Displayed vs ranked price Nasdaq and BX Rule 4702(b)(1)(A): a Price to Comply order that would lock or cross a protected quotation is displayed one minimum increment away and ranked at that quotation’s price, non-displayed. Post-Only orders that are not attributable are adjusted the same way [V: SEC release 34-79290, fn. 8 and 10; release 34-78909, fn. 8]. On BX and Nasdaq’s main market (2019-12-30), every printable execution at a non-displayed price is one increment toward the other side. On BX these account for every execution that passed an older displayed order (HISTORICAL_DATA §7). One venue and no protected quotations, so displayed and ranked prices coincide
Receipt vs display Measured, not read in a rule: on Nasdaq’s main market, every execution that passed an older displayed order was of an order with a lower reference number, received earlier and displayed later; by reference number, priority held in every execution at a displayed price (HISTORICAL_DATA §7). Orders are displayed when accepted, so the two orders coincide

The random end of Xetra’s volatility auction is worth copying in the simulator’s session scheduler. It exists to stop participants gaming a known uncross time.

A3. Market-data formats (for the historical-data adapters)

A4. Message-traffic statistics (to calibrate synthetic flow)

A5. Existing simulators


B. Market-making and microstructure models: what each gives the project

B1. Inventory risk (research questions 1 and 7)

B2. Information and adverse selection (research questions 2 and 5)

B3. Order flow, queues and short-horizon prediction (research questions 3 and 6)

B4. Speed and latency (research question 4)

B5. Execution and impact (institutional agents, implementation shortfall)

B6. Measurement

B7. Order-flow memory, latent liquidity and stylised facts (added in phase 2)

Used to build and calibrate the background market (STYLIZED_FACTS.md). All from memory; none of the primary texts were re-read.


C. Design consequences

  1. A deterministic single-threaded core (LMAX pattern), with parallelism across simulations. Done in phase 0.
  2. Latency at the message level, per participant and per direction, with per-link FIFO and queueing at the gateway (beyond ABIDES’s pairwise matrix). Agents see only a delayed MBO/L2 feed. Phase 1.
  3. Market-maker PnL decomposed into spread capture, adverse selection (mark-outs at several horizons), inventory revaluation and fees (Menkveld). Done in phase 4, exact to the fee unit (METRICS.md).
  4. Nanosecond timestamps and race detection (Aquilina et al.). Done: timestamps in phase 0. The race metric (phase 4) includes cancels the gateway refused.
  5. Queue position as a first-class observable (Moallemi & Yuan). queue_ahead done.
  6. Background flow calibrated to stylised facts: cancel ratios, spread distribution, order-sign autocorrelation, square-root impact. The benchmark generator is not calibrated (BENCHMARKS.md). Phase 2.
  7. No profitability claim from simulation alone. Strategy results must be replayed on historical MBO data and the two clearly separated. Phase 5.

D. Formula register: verify before implementing

Formula Needed for Status Before implementation
A–S reservation price and total spread A–S market maker Verified (phase 3) as the first-order expansion in τ of the exact GLFT solution, which itself matches a direct numerical HJB solution. The A–S paper itself was not read MARKET_MAKING.md §1
A–S fill intensity A·exp(−kδ) A–S, GLFT, calibration [V] as GLFT’s model assumption (arXiv:1105.3115 §2, read via ar5iv); online estimator verified on synthetic data Same
GLFT exact quotes, asymptotics and closed form GLFT market maker [V] and verified (phase 3): transcribed from arXiv:1105.3115 (ar5iv). The exact solution matches a direct numerical HJB solution to 1e-6 ticks; the closed form is within 2% on the inventory term when α/η is small Same
Order-flow imbalance (CKS) Research question 6, OFI-aware quoting [V] (phase 3): transcribed from arXiv:1011.6402 §2.1 (ar5iv); unit-tested on each event type Same
Micro-price Order-flow-aware quoting [S] (phase 3): definition from papers citing Stoikov (2018); the original was not available. Estimator verified against brute-force simulation Same
Effective / realized / quoted spread Metrics [V] (phase 4): Rule 600(b) definitions and Rule 605(a)(1) horizons, read on eCFR; hand-tested Done (METRICS.md)
Amihud illiquidity Metrics [M]; implemented on intraday intervals (Amihud used daily returns) The original was not re-read
Roll implied spread 2√(−γ₁) Metrics [M]; hand-tested The original was not re-read
Implementation shortfall (delay / execution / opportunity) Metrics, execution agents [M]; exact identity tested Perold (1988) was not re-read
Latency race and its duration Research question 4 [S] (phase 4): duration definition from the NBER Digest summary; window and grouping are choices Read the paper’s methodology section before comparing race statistics with its figures
Almgren–Chriss trajectory: share done after τ = t/T is 1 − sinh(κ(1 − τ))/sinh(κ) ExecutionAgent (phase 2) [M], implemented κ is a free urgency parameter. Before deriving κ from risk aversion, volatility and temporary impact, transcribe the κ formula from the paper
Sign memory from metaorder splitting: γ = α − 1 Background calibration (phase 2) [M], used Consistent with simulation (α = 1.5 gives a measured γ of 0.52); check the derivation’s assumptions before relying on it elsewhere
Thresholds uniform on [0, θ_max] give opposing supply ≈ N·x²/(2θ_max), hence I ∝ √Q FundamentalTrader population (phase 2) derived here An elementary calculation, not taken from a paper; holds only while no trader hits its position cap

E. Not verified (carried over from the agents’ notes)


References

Bibliographic details: [V] where tagged in section B; otherwise [S] or [M] as noted.