Skip to content
synaping

Python · Backtesting · Multi-agent

Quant Research Infrastructure

Engineering a walk-forward backtesting engine, data pipeline and risk controls.

Technical research only; not investment advice. No real returns, strategy parameters or trading signals are shown.

We built engineering infrastructure for strategy research: a unified data layer, an event-driven backtesting engine and a rolling walk-forward framework for out-of-sample evaluation.

The system follows a layered (hexagonal) architecture: the domain layer has no dependency on databases, market data or broker APIs; every external dependency lives in adapters at the edge, so risk and causality rules can be verified one by one with fast unit tests.

The risk module applies the same rules in backtests and paper trading — for example a daily loss limit that resets at each calendar day. Any uncertain state (stale prices, ambiguous configuration) fails closed, so research and execution logic cannot drift apart.

A multi-agent research workflow assigns data checks, hypothesis generation and result review to different AI roles; humans sign off on conclusions.

The demo below uses randomly generated synthetic data and only illustrates how walk-forward folds are structured.

Synthetic data: 4 rolling walk-forward folds

Architecture

System architecture

01 · Data

  • Market-data ingestion and short-lived cache
  • Time-series database
  • Data-quality checks

02 · Research

  • Event-driven backtesting engine
  • Walk-forward folds with no-overlap checks
  • Chronological, purged train / test splits

03 · Risk

  • Pre-order rule checks
  • Reject on stale prices
  • Externally triggered kill switch

04 · Execution

  • Paper trading by default
  • Live mode needs two explicit confirmations
  • Idempotent order intents and reconciliation

Highlights

Engineering highlights

01

Causality tests

Each test file pins one claim: a future bar cannot change a past result, no same-bar fills, a retry yields one order, no ML leakage.

02

Fail closed

Switching from paper to live needs two independent settings; ambiguous configuration fails at startup. The kill switch can be triggered from outside the process.

03

Observable safety state

Separate liveness, readiness and safety endpoints; the safety endpoint returns 503 and lists every blocker when conditions are not met.

04

CI with real dependencies

CI runs against a real time-series database service, treats skipped tests as failures and asserts paper mode before any test runs.

Book a free 30-min call

Free call