Python research software for market-making replay, options, portfolio risk, and trading experiments.
The public-sample pipeline reconstructs NASDAQ-derived order books, selects assumptions on a validation interval, and compares five policies on a chronological holdout. It models queue position, latency, fees, inventory limits, adverse selection, and liquidation, with independent PnL accounting.
The recorded study processes 301,587 synchronized AAPL messages and Level-5 book states. Reconstruction exactly matches 89.17% of synchronized states; remaining boundary mismatches are counted and reseeded. All five policies lose money on the sample. This is pipeline validation on one demonstration session, not evidence of persistent alpha.
Study · Data quality · Executed notebook · Paper · Demo
Requires Python 3.11 or newer. Use a virtual environment.
python -m pip install -e ".[dev,research]"
pytest
quantlab demo-suite --seed 7Reproduce the public-sample study:
make fetch-order-book-data
make reproduce-market-making-sample
make market-making-notebookThe fetch step downloads external data. Synthetic demos can run separately. For the optional Streamlit dashboard, install .[dashboard] and run make market-making-dashboard.
| Area | Implementation and evidence |
|---|---|
| Options | Black-Scholes, Heston/Bates, SABR, SVI/SSVI, Greeks, Monte Carlo/PDE baselines, hedging, and surface diagnostics |
| Risk and portfolios | Factor models, covariance shrinkage, VaR/CVaR, robust allocation, turnover constraints, and stress tests |
| Learning and statistical arbitrage | Constrained RL experiments, cointegration, dynamic hedge ratios, and chronological replay |
| Credit and systemic risk | Structural/reduced-form credit models, portfolio losses, clearing, and contagion simulations |
| Valuation allocation | Study and memo; does not outperform the simpler risk-matched baselines on the reported measures |
| Leveraged trend | Study, long-history check, and execution timing audit |
| Defensive momentum | Study, robustness, and paper protocol |
Historical adjusted prices, reconstructed leverage, synthetic fixtures, and forward paper records have different evidence limits. The individual reports preserve these distinctions and negative results.
make quality test docs auditSee the Makefile for the checks included. CI covers linting, types, tests, coverage, documentation, and benchmark regression. Passing software checks does not validate a trading strategy.
src/quantlab/: reusable models, data adapters, replay, and research workflowsexamples/: runnable studies and demonstrationsreports/: dated research outputs and data-quality evidencenotebooks/: executed research walkthroughtests/: model, accounting, and workflow checksconfig/: experiment parameters
Architecture · Model cards · Data sources · Assumptions · Research roadmap audit
MIT licensed. This is research software; the published results are not live trading performance.