Skip to content

Add Binance L2 virtual-MBO reconstruction study - #61

Merged
tradingexpert merged 2 commits into
mainfrom
feature/binance-l2-reconstruction-study
Aug 11, 2026
Merged

Add Binance L2 virtual-MBO reconstruction study#61
tradingexpert merged 2 commits into
mainfrom
feature/binance-l2-reconstruction-study

Conversation

@tradingexpert

@tradingexpert tradingexpert commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a deterministic Binance L2 + individual-trade to virtual-MBO reconstruction model
  • expose named queue-conservative and queue-optimistic policies instead of presenting inferred queues as observed FIFO
  • add a streaming full-capture study with exchange-time alignment, sequence checks, top-of-book validation, and JSON manifests
  • document the assumptions, evidence, recommended default, and segment boundaries across the public docs
  • make the crypto execution path prominent in the README and publish a measurable realism challenge in issue Crypto realism challenge: validate L2 fill models against execution evidence #62

Full-capture evidence

The study used the completed BTCUSDT and ETHUSDT capture through 2026-08-10T17:12:57Z, before the machine-wide network outage.

Measure BTCUSDT ETHUSDT
Snapshot-anchored segments 4 3
Depth endpoints reconstructed 1,668,215 1,659,917
Individual trades aligned 2,847,061 4,498,386
Broken segments 0 0
Late trades with validated buffer 0 0
Exact book-ticker joins 44,277 / 44,277 72,104 / 72,104
Required replenishment / traded quantity 10.90% 14.65%

Receive ordering was measured rather than assumed. A 2-second buffer left 13,422 ETH trades late and a 10-second buffer left 71; the 60-second default left none. This is an offline evidence-alignment window, not simulated exchange latency.

Zero-price, zero-quantity @trade messages remain preserved in raw capture, are counted in the report, and are excluded from executable MBO flow. No raw capture data or generated study reports are committed.

Validation

  • ruff check .
  • 28 focused tests passed, including reconstructed-stream Python/C++ equivalence
  • per-module branch coverage: reconstruction.py 96%, reconstruction_study.py 96%
  • full suite: 265 passed, 98.26% total branch coverage
  • native C++ matching-engine suite passed
  • wheel and source distribution built; both passed twine check

Follow-up

The next increment can materialize each valid reconstruction segment to canonical Parquet plus a model manifest. A separate community validation issue should solicit paired L2/L3 evidence and alternative cancellation-allocation models.

Community benchmark: #62

@tradingexpert tradingexpert self-assigned this Aug 11, 2026
@tradingexpert
tradingexpert merged commit 45360d6 into main Aug 11, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant