← back to projects

Market Making

It loses money under every fill assumption. The one great day was luck: the biggest selloff in the sample.

capability: Systems / market microstructure
category: Systems / C++
date: October 2026
Daily PnL against the ES move over 21 sessions
Daily PnL against ES's open-to-close move, 21 sessions.

question

How much of a market-making backtest is the strategy, and how much is the fill assumption? Built in C++ and replayed on real CME order-book data.

methodology

  • C++20 engine: order book, order management, risk limits, an exchange simulator with latency, and an inventory-aware quoter.
  • A second engine replays the same quotes under four fill rules, from "filled on touch" to "wait your turn in the queue".
  • 21 trading days of E-mini futures, Sep to Oct 2026.

result

  • It loses on average under every rule.
  • It gets short in rallies and long in selloffs; the day's move explains 58% of PnL.
  • Quoting more aggressively loses 14 times more, because those fills get picked off within a second.
  • The two engines match fill for fill, which caught an accounting bug.

figures

  1. Mean daily PnL by fill rule
    Figure 1. Mean daily PnL by fill rule, with 16 Oct marked.
  2. ESZ6 on 16 Oct 2026: price, position and PnL
    Figure 2. ESZ6 on 16 Oct 2026, filling on touch: price, net position and PnL.

caveats

  • Queue position is estimated, not exact.
  • One contract, no fees.

stack

C++20CMakeCatch2PythonDatabento