Skip to content

Separate Runtimes from Core #7

@bxvtr

Description

@bxvtr

Problem

The Core currently contains not only deterministic Runtime logic, but also environment-specific implementations for Backtesting and Live operation.

This introduces a violation of architectural boundaries:

  • The Core is defined as a deterministic, environment-agnostic engine.
  • Backtesting and Live represent distinct Runtime environments with different infrastructure and integration concerns.

Mixing these concerns reduces clarity of responsibilities and makes the System harder to reason about.

It also conflicts with the documented separation between Core logic and Runtime environments.

Proposed Solution

Extract Backtesting and Live implementations from the Core into a dedicated Runtime layer.

The Core should contain only:

  • Event processing
  • State management
  • Strategy evaluation
  • Risk validation
  • Order lifecycle management

The Runtime layer should be responsible for:

  • specific Execution (Backtesting, Live)
  • orchestration and process lifecycle
  • configuration and setup
  • integration with external systems such as data sources and Venues

This establishes a clear architectural boundary:

Core → deterministic logic
Runtime → Execution environment

Alternatives

  1. Keep Backtesting and Live inside the Core

    This would simplify the repository structure but continue to mix deterministic logic with environment-specific concerns.

  2. Split Backtesting and Live into separate repositories without a Runtime layer

    This would improve separation but may lead to duplicated orchestration logic.

Additional Context

This change aligns the implementation with the documented system model:

  • The Core is environment-independent and deterministic.
  • Runtimes provide the operational context for the Core.

Both Backtesting and Live Runtimes rely on the same Core behavior but differ in their surrounding infrastructure and external integrations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions