Skip to content

Systems · Phase 1 complete · Aug 2026 – now

Fulcrum Order book

A C++20 limit order book built to be correct first and fast second, with the evidence for both kept in the repository.

32 testsASan + UBSanC++20View the repo
Stack
C++20 · CMake · GoogleTest · GitHub Actions

Problem

An order book has to stay exactly right under every sequence of adds, cancels, modifies and partial fills. Floating-point price comparisons and untested edge cases are where books go wrong.

Approach

  • Price-time priority book supporting add, cancel, modify and partial fill.
  • Queries for best bid and ask, spread, mid, depth and price-level snapshots.
  • A seeded, deterministic, Poisson-timed synthetic order generator for stress tests and benchmarks.

Key decisions

  • Prices are integer ticks, which rules out floating-point equality bugs.
  • The order generator is seeded and deterministic, so any failing run can be replayed exactly.

Evidence

  • 32 GoogleTest cases, including a 5,000-event randomised stress test.
  • CI matrix with a plain build and an ASan + UBSan sanitizer build.

What's next

  • Planned: a matching engine with pre-trade risk controls.
  • Planned: deterministic replay of real market data.
  • Planned: benchmarked tick-to-trade latency at P50, P99 and P99.9.

Contact

Say hello.

Happy to talk about systems, markets, or what we're building at Forma Labs.