Expand description
Risk Account Builder - Assembles Portfolio Margin inputs.
This service provides a unified way to build PM snapshot inputs by combining:
- BalanceProvider: Engine-owned runtime balances
- PortfolioService: Executed positions with cost basis
- OpenOrdersSource: Resting orders for PM calculations
Both UnifiedEngine (for order admission) and API handlers (for /risk/grid) use this builder, keeping UnifiedEngine out of the API hot path.
Structsยง
- Risk
Account Builder - RiskAccountBuilder assembles PM inputs from balances, positions, and open orders.
Enumsยง
- Risk
Error - Error type for risk account building.
- Snapshot
Mode ๐
Traitsยง
- Open
Orders Source - Source for open orders. Implemented by SnapshotOpenOrdersSource.
- Spot
Price Source - Source for spot prices. Implemented by GreeksCache.