Backend quant engine focused on deterministic replay, canonical market data capture, and operationally reliable signal infrastructure.
MarketCore is a market-data and replay foundation for quant workflows where event semantics matter. The project captures live market data, normalizes it into canonical raw events, stores those events durably, and builds deterministic replay primitives on top of that storage layer. The goal is not to make early alpha claims. The goal is to make later claims about parity, features, signals, and backtests defensible.
Many trading projects can calculate indicators. Far fewer make replay correctness, canonical event identity, and ordering semantics explicit. Without that foundation, later claims about live-vs-backtest parity are weak.
MarketCore is built to make those guarantees concrete:
- canonical raw events preserve source identity and payload hash
- replay ordering preserves source, timestamp, and ingest-order semantics
- top-of-book sampling is deterministic at
250ms - replay equality checks reject ambiguous or non-canonical payload forms
- local verification runs with tests, linting, and strict typing
This repository is currently in Milestone 1: Capture and Replay Foundation.
Current scope:
- live
tradecapture foundation 250msfixed-interval top-of-book snapshot foundation- canonical raw-event normalization
- raw-event schema and storage foundation in TimescaleDB
- deterministic replay helpers and equality checks
- minimal health, metrics, and operator stack scaffold
Current system shape:
Binance stream -> ingest normalization -> canonical raw events -> TimescaleDB -> replay path -> future feature/signal parity
Repository modules:
ingest/normalization, deterministic top-of-book sampling, storage and publication foundationsbacktest/replay equality checks and replay-path primitivesapi/minimal health and metrics-facing surfaceops/local Docker Compose, Prometheus, and Grafana scaffoldmigrations/raw-event schema foundationtests/deterministic behavior, normalization, replay, storage, and operator-stack coverage
Create and use a local virtual environment:
.\.venv\Scripts\python.exe -m pip install fastapi pydantic pydantic-settings pytest prometheus-client alembic sqlalchemy asyncpg redis websockets structlog hypothesis mypy ruff uvicorn httpxIf .venv does not exist yet, create one first with a local Python interpreter, then install the baseline dependencies used by the repo.
The operator stack scaffold lives under ops/, but it should be treated as Milestone 1 infrastructure scaffolding rather than a complete live deployment path.
Run the current verification suite from the repository root:
.\.venv\Scripts\python.exe -m pytest tests -v
.\.venv\Scripts\python.exe -m ruff check .
.\.venv\Scripts\python.exe -m mypy --strict .These checks currently pass on the repository snapshot in this branch.
Milestone 1capture and replay foundationMilestone 2derived bars and shared feature engineMilestone 3live features and simple signal emissionMilestone 4parity validation over replayed live windowsMilestone 5backtesting and research workflow
- the full live ingest loop is not implemented yet
- feature and signal pipelines are not implemented yet
- historical backtesting reports and research workflow are not implemented yet
- the operator stack is scaffold-level, not a final deployment setup
- the local environment is currently bootstrapped through a repo-local
.venv