How chrislernunes/queue_positioning works
queue_positioning is an OCaml research engine for deterministic market-data replay and passive-execution simulation. The main workflow is to validate or normalize a dataset, replay its depth events, then run a configured simulation or experiment and examine the resulting metrics and reports. Separate capabilities include synthetic fixture generation, Binance capture, depth synchronization, and benchmarking. The README documents the runtime stages; source excerpts are limited to the Python analysis/reporting and capture scripts, so internal OCaml call relationships are shown only where documented.
Main entry points: main.ml Command-line interface · experiment.ml Experiment runner · reports Engine outputs · capture_binance.py Binance capture
Components 21
Market Data
- Command-line interface
bin/main.ml - Binance capture
scripts/capture_binance.py - Data normalization
lib/binance_decoder.ml - Depth synchronization
lib/depth_sync.ml - Dataset validation
lib/validation.ml - Synthetic fixtures
lib/synthetic.ml
Replay and Simulation
- Canonical events
lib/event.ml - Event replay
lib/replay.ml - Order book
lib/order_book.ml - Queue models
lib/queue_model.ml - Fill simulation
lib/fill_engine.ml - Execution ledger
lib/ledger.ml - Experiment runner
lib/experiment.ml - Execution metrics
lib/metrics.ml - Replay benchmark
lib/benchmark.ml
Research Outputs
- Engine outputs
reports - Output analysis
scripts/analysis.py - Research note
scripts/write_report.py
Report Presentation
- Report site
site/site.js
Other components
- Researcher
- Binance public streams
Connections 21
- Researcher → Command-line interface: runs commands
README.md - Command-line interface → Dataset validation: validates dataset
README.md - Command-line interface → Data normalization: normalizes capture
README.md - Command-line interface → Synthetic fixtures: generates fixtures
README.md - Command-line interface → Event replay: replays dataset
README.md - Command-line interface → Experiment runner: runs experiments
README.md - Command-line interface → Replay benchmark: runs benchmark
README.md - Command-line interface → Binance capture: starts capture
README.md - Binance capture → Binance public streams: reads streams
scripts/capture_binance.py - Binance capture → Data normalization: supplies raw data
README.md - Data normalization → Depth synchronization: synchronizes depth
README.md - Event replay → Order book: updates book
- Experiment runner → Queue models: uses queue models
README.md - Experiment runner → Fill simulation: simulates executions
README.md - Experiment runner → Execution ledger: tracks execution
- Experiment runner → Execution metrics: computes metrics
- Experiment runner → Engine outputs: writes results
README.md - Replay benchmark → Engine outputs: writes benchmark
README.md - Engine outputs → Output analysis: loads outputs
scripts/analysis.py - Output analysis → Research note: provides analysis
scripts/write_report.py - Engine outputs → Report site: loads committed reports
site/site.js