The problem
Most backtests describe a system that was never run. The backtest has its own fill model, its own clock and its own idea of when data arrived, and the live system has another. Nothing checks that the two agree, so they quietly drift apart.
quant is built around one rule: a strategy must not be able to tell which world it is running in. If it can, that is a bug.
One binary, three worlds
An EventSource feeds the engine and an ExecutionVenue takes its orders. Backtest is HistoricalSource (Parquet replay) with SimulatedVenue. Paper is LiveSource (the Binance WebSocket) with the same SimulatedVenue. Live swaps in LiveVenue. There is deliberately no separate paper venue: a second fill model would be a second thing that must agree forever, with no way to notice when it stopped.
Every order passes a mandatory RiskLayer. It keeps its own tally instead of reading the portfolio, because a limit computed from the accounting can only be as correct as the accounting.
Invariants, enforced by the compiler and tests
- Money is fixed-point i64 scaled by 1e8. Float arithmetic is denied workspace-wide by clippy.
- Every event carries two timestamps, and only the local receive time is ever dispatched on. Anything else is lookahead bias.
- Gaps are recorded events. "We were not watching" is data, not silence.
- Time is injected through a Clock trait. Anything that calls the wall clock directly cannot be backtested.
Results, milestone by milestone
- M1: the recorder ran 7 days unattended (21–28 Aug 2026); the verifier exited 0 with every discontinuity explained by a record in the capture.
- M2: 70,545,345 events replayed from the Parquet tier match the raw replay event for event, with book invariants holding at every tick.
- M3: a moving-average crossover takes $100 to $97.53 with no fees. That is the result to want: a first strategy that looked profitable would mean the harness was lying.
- M4: at Binance spot's 10 bps a side the same week ends at $64.74. The strategy loses 2.5% on price and 33% on commission.
- M5: a 14-day live paper run (18 Sep – 2 Oct 2026) on BTCUSDT and ETHUSDT. Paper P&L reproduced a backtest over the same window exactly, to the satoshi, across 97,937,822 captured frames with none missing, including a 12-hour Wi-Fi outage recorded as a gap.
- M6: under test, an oversized order never reaches the venue and a runaway strategy gets exactly its order limit out.
Now
M8: live trading with tiny capital. Done means our record and the exchange's agree exactly, every order's outcome matches what the model predicted, and its price error stays inside a bound registered beforehand.