Skip to content

simulation_builder

SimulationBuilder: runs the real engine to produce a consistent balance snapshot.

Classes:

BuildConfig dataclass

BuildConfig(
    name: str,
    start_date: date,
    instruments: list[Instrument],
    positions: list[Position],
    market_frames: dict[str, DataFrame],
)

Inputs to the simulation builder.

SimulationBuilder

Run the real simulation engine to produce a consistent snapshot.

Methods:

  • build

    Build a simulation snapshot by replaying from earliest acquisition to start_date.

build

build(config: BuildConfig) -> SimulationSnapshot

Build a simulation snapshot by replaying from earliest acquisition to start_date.

SimulationSnapshot dataclass

SimulationSnapshot(
    name: str,
    start_date: date,
    instruments: list[Instrument],
    positions: list[Position],
    balances: dict[str, float],
    valuations: dict[str, dict[str, float]] = dict(),
    market_frames: dict[str, DataFrame] = dict(),
)

Output of the simulation builder.