Skip to content

services

Core service layer for BRMS.

Modules:

  • accounting_service –

    AccountingService: maps Transaction dataclasses to journal entries and posts to the Ledger.

  • benchmark_service –

    BenchmarkService: syncs Prime fixings from MarketDataStore into QL's IndexManager.

  • data_service –

    DataService: loads a simulation from a zip archive.

  • loaders –

    Loader protocol and ZipLoader for decoupled simulation data loading.

  • metrics_service –

    MetricsService: computes bank metrics and writes results to MetricStore.

  • reporting_service –

    ReportingService — pure computation of financial statements from a Ledger.

  • risk_service –

    RiskService: delegates RWA computation to strategy objects.

  • rule_engine –

    Position-aware RuleEngine: applies accounting rules to open positions.

  • simulation_builder –

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

  • simulation_service –

    SimulationService: thin orchestrator that sequences service calls for each date.

  • valuation_context –

    ValuationContext: long-lived mutable context updated once per valuation date.

  • valuation_service –

    ValuationService: strategy-based valuation dispatching by MeasurementBasis.

  • valuation_strategies –

    Valuation strategy implementations for the strategy-based ValuationService.

  • yield_curve_service –

Classes:

  • CoreServices –

    Typed container for all core-layer services, stores, and infrastructure.

Functions:

  • build_core_services –

    Instantiate and wire all core services. Returns a frozen CoreServices.

CoreServices dataclass

CoreServices(
    event_bus: EventBus,
    simulation_service: SimulationService,
    bank: Bank,
    market_data: MarketDataStore,
    valuation_store: ValuationStore,
    metric_store: MetricStore,
    transaction_log: TransactionLog,
    reporting_service: ReportingService,
    risk_service: RiskService,
    data_service: DataService,
    accounting_service: AccountingService,
)

Typed container for all core-layer services, stores, and infrastructure.

build_core_services

build_core_services(
    *, simulation_zip: Path | None = None
) -> CoreServices

Instantiate and wire all core services. Returns a frozen CoreServices.