Quant Platform is a historical-first, live-targeted quantitative research, simulation, and execution platform. Built with strict mathematical determinism, event-driven causality, and institutional accounting rigor, the platform ensures that research simulations, historical replays, and live execution share identical execution semantics and produce provably reproducible results.
The platform is designed around four non-negotiable architectural invariants:
-
Bitwise Determinism & Monotonic Monolithic Time:
Simulations and replay engines advance time purely via monotonically non-decreasing timestamps (
Instant). Given identical input data and configuration, repeated runs on any machine produce bitwise-identical order IDs, fill prices, fees, equity curves, and trace digests. Zero dependency on the host clock (datetime.now()). -
Point-in-Time Correctness & Availability Floor:
Strict causal anti-leakage invariants (
$t_{\text{available}} \le t_{\text{decision}}$ ) are enforced at runtime. Strategy policies cannot observe any feature, indicator, or market event that would not have been available at decision time (ADR-0006, ADR-0031). -
Double-Entry Portfolio Accounting:
All monetary and quantity accounting is executed in exact
Decimalarithmetic. Positions are tracked in hedge mode (independent long and short sides), with strict conservation of cash, position assets, fee expenses, and realized/unrealized PnL: $$\text{Equity}t = \text{Cash}t + \sum{i} \text{PositionValue}{i,t}$$ -
DataGateway Seam Preservation:
Upper layers (Strategy, Execution, Portfolio, Replay) must consume market data exclusively through
DataGateway.scan()andDataGateway.read(). Upper layers never open storage files or catalog tables directly (ADR-0019).
Market Data Ingest (Bybit Trades / L2)
↓
Data Plane & Storage Roots (Natural Partitioning, Parquet, Manifest Hashes)
↓
PostgreSQL Catalog & Lineage Tracking (DDL, DataGateway Boundary)
↓
Representations & Feature Engine (Candles D03, Footprints D04, Features E04/E06)
↓
Validation & Walk-Forward Engine (Causal Floor, Purged & Embargoed Folds)
↓
Strategy Policies & Composition (G01 StrategySpec, G02 Signals, G04 Session/Cooldown, G03 Risk/Sizing)
↓
DecisionIntent (Learner-Agnostic, ADR-0009)
↓
Unified Execution Engine (H01 Order State Machine, H02 Fees/Slippage, H03 OCO/Conflict Resolver)
↓
Historical Replay Runtime (H05 Deterministic ReplayEngine, Trace Fingerprint)
↓
Double-Entry Portfolio Ledger (H04 Ledger Transactions, Realized/Unrealized PnL, Mark-to-Market Equity)
-
Canonical Data Plane: Frozen
trade-v1schema, dataset and partition manifests, natural time partitions, storage root isolation, Bybit historical trade ingestion, and PostgreSQL catalog DDL. -
Representations & Features: Frozen
CandleDefinition v1,FootprintDefinition v1, andFeatureDefinition v1semantic foundations with availability metadata. - Validation Engine: Point-in-time train/test isolation, causal availability floors, purged and embargoed walk-forward cross-validation splits, and statistical robustness metrics.
-
Strategy & Policy Gates (
G01–G04): StatefulStrategySpec, multi-signal combination policies, directional entry/exit policies, fixed-fraction position sizing, capital risk budgets (max_drawdown_fraction, position notional ceilings), 24/7 and exchange session calendars, and post-loss streak cooldown gating. -
Unified Execution Engine (
H01–H03): Order state machine (PENDING_NEWthroughFILLED/CANCELED), deterministic fill generation, explicit maker/taker fee schedules, synthetic slippage models, and intra-bar execution conflict and OCO resolvers. -
Double-Entry Portfolio Ledger (
H04): Double-entry journal lines, multi-asset hedge-mode position sides, exact cost basis tracking, transaction audit logs, and mark-to-market equity curves. -
Deterministic Historical Replay Runtime (
H05): End-to-end replay engine streaming fromDataGateway.scan(), enforcing temporal causality chains ($t_{\text{event}} \le t_{\text{decision}} \le t_{\text{order}} \le t_{\text{fill}} \le t_{\text{ledger}}$ ), producing bitwise-identicalReplayResultartifacts and execution fingerprints.
Quant Platform is engineered from the ground up to solve the most pervasive pitfalls in financial machine learning: lookahead bias, non-stationary feature leakage, and backtest overfitting.
-
Causal Feature Engineering: Strict mathematical enforcement of the causal availability floor (
$t_{\text{available}} \le t_{\text{decision}}$ ) guarantees that no future information leaks into training features or inference states (ADR-0006, ADR-0031). - Purged & Embargoed Cross-Validation: Native walk-forward cross-validation folds with combinatorial embargo intervals (ADR-0031) and Deflated Sharpe Ratio / Probability of Backtest Overfitting (DSR/PBO) statistical evaluation (ADR-0037).
-
Learner-Agnostic Decision Interface (
DecisionIntent, ADR-0009): Completely decouples predictive intelligence from execution mechanics. Supervised ML models (LightGBM, XGBoost, CatBoost), deep neural architectures, and Reinforcement Learning agents (PPO, SAC, DQN) feed directly into the deterministic execution state machine and double-entry portfolio ledger. - Sister Research & Recurrent Neural Network Models: For exploratory recurrent neural network training, sequence modeling, and deep learning experiments sharing this underlying algorithmic foundation, explore our public companion repository Rnn_V0_1.
Beyond our frozen core architecture, we actively explore cutting-edge quantitative ideas with researchers and the open-source community:
- RFC #182: Live Execution Adapters — Evaluating CCXT Pro vs. Native Async WebSockets (Bybit / Interactive Brokers) within our deterministic state machine.
- RFC #183: Causal Reinforcement Learning & Reward Function Design — Formulating cost-penalized differential Sharpe rewards and risk budgets in
DecisionIntent. - RFC #184: Interactive Order Flow & Footprint Visualizer — Designing a terminal TUI vs. lightweight web UI for cluster delta footprints and replay stepping.
- RFC #185: System One Decision Models (TypeSafe Jev) — Evaluating fast typed inference models against exchange fee hurdles and adverse-selection gating.
- RFC #186: JEPA World Models for Order Flow & L3/MBO Data — Self-supervised representation learning (Fin-JEPA) on unlabelled high-frequency market events.
Have an idea or research proposal? Join the debate in Discussions ➔ Ideas!
quant-platform/
├── db/ # PostgreSQL catalog schema, roles, and migration scripts
├── docs/ # Product roadmap, target architecture, core contracts, and 45+ ADRs
├── fixtures/ # Canonical JSON fixtures for schema validation and integration tests
├── infra/ # Container provisioning and disposable PostgreSQL test harnesses
├── schemas/ # Frozen JSON Schema definitions (trade-v1, manifest contracts)
├── src/ # Production source tree (quant_platform modular monolith)
│ └── quant_platform/
│ ├── access/ # DataGateway, catalog query provider, request models
│ ├── application/ # Ingestion pipelines, conformity runners, live bridges
│ ├── data/ # Domain models, dataset identities, Instant, TradeRecord
│ ├── execution/ # Orders, fills, fee schedules, slippage, conflict resolvers
│ ├── portfolio/ # Double-entry ledger, hedge positions, transaction journals
│ ├── replay/ # HistoricalReplayRuntime, ReplaySpec, ReplayResult
│ └── strategy/ # StrategySpec, policy gates, compose_decision, risk sizing
├── tests/ # Unit, boundary, property, and PostgreSQL integration test suites
└── tools/ # Workflow automation, preflight integrity, markdown link checkers
- Python 3.11 or higher
- Optional: Docker / PostgreSQL 17 (for catalog integration tests)
# Clone the repository
git clone https://github.com/NeoNix-Lab/quant-platform.git
cd quant-platform
# Create virtual environment and install development dependencies
# (runtime + test extra + linter, all declared in pyproject.toml)
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\Activate.ps1
pip install -e ".[dev]"
# CI installs the equivalent set from tests/requirements.txt (kept in sync by a test)# 1. Run full repository preflight checks (syntax, boundaries, whitespace, governance)
python tools/workflow.py preflight
# 2. Run all local unit and regression test suites (73 suites, 0 failures)
python tools/run_tests.py
# 3. Verify all internal documentation links
python tools/check_markdown_links.py
# 4. Run targeted historical replay runtime tests
python -m unittest tests.test_replay_v1- Interactive Documentation (GitHub Pages)
- Product Specification
- Capability Map
- Product Roadmap
- Target Architecture
- Core Contracts
- DataGateway Contract
- Market Data Ingest Architecture
- Market Data Ingest Contracts
- Storage Lifecycle
- Repository Synchronization
- Architecture Decision Records (ADRs)
- Current Scope
- Contributions must follow the workflow defined in CONTRIBUTING.md and AGENTS.md.
- To report a security vulnerability, please review our Security Policy.
This project is licensed under a Source-Available Proprietary License. See LICENSE for details.