[Roadmap] Pairs and spread trading foundation

Author: brokermr810Created Sep 18, 2026Updated Sep 18, 2026
Labelshelp wantedroadmapepicneeds-rfcarea: strategy-apiarea: portfoliopriority: p0

Problem

Multi-instrument code can calculate a spread today, but QuantDinger has no first-class pair/spread identity. Positions, risk, orders, and performance are therefore reported only as unrelated instrument legs.

Desired outcome

Introduce a versioned pair/spread contract that preserves leg-level truth while providing pair-level identity, hedge ratios, signals, risk, and attribution.

Initial scope

  • Define pair and generalized spread identifiers and leg metadata.
  • Represent signed hedge ratios and strategy-defined spread values.
  • Add standard research helpers for spread, z-score, and optional hedge-ratio estimation.
  • Preserve pair identity from signal through intent, order, fill, position, and result records.
  • Define pair-level entry, exit, stop, and exposure semantics.

Acceptance criteria

  • An RFC defines storage, Strategy API, and migration behavior.
  • Pair identity survives backtest and live serialization.
  • Pair-level metrics reconcile exactly to underlying legs.
  • Tests cover asymmetric quantities and one leg closing before the other.
  • Existing multi-instrument strategies continue to run unchanged.

Out of scope

  • Treating two broker orders as truly atomic when the venue does not support it.
  • A complete library of statistical-arbitrage models.

Contributing

This is an epic. Claim one contract, model, calculation, test, or documentation slice after discussing the design with a maintainer.