Expand description
Synchronous portfolio supervision.
A PortfolioSupervisor sits between the strategies that want new exposure and the stage that executes it. It sees each Entry or scale-in request together with facts about the account, applies declared RiskPolicy values, and approves or rejects the request. It never blocks a close, a partial close, a stop move, or a cancellation, because a supervisor must not prevent risk reduction.
The crate owns no clock, IO, or async runtime. A historical replay and a live runtime supply the same facts and receive the same verdicts.
Structs§
- Correlation
Group - Symbols the owner declares to be one bet, so a cap can bound their combined risk.
- Exposure
Fact - One position, pending order, or approved request the supervisor counts.
- Exposure
Intent - One request for new exposure as the supervisor sees it.
- Halt
Interval - A period during which new exposure was rejected.
- Portfolio
Facts - Account state at the moment of a review or boundary.
- Portfolio
Supervisor - Portfolio risk supervisor for one account.
Enums§
- Halt
Action - What a kill switch does when it trips.
- Halt
Command - A bulk action a halt asks the executing stage to perform.
- Intent
Kind - Whether a request adds a position or grows an existing one.
- Loss
Limit - How large a day’s realized loss may become.
- Risk
Config Error - A supervisor configuration the owner cannot run.
- Risk
Policy - One portfolio rule.
- Verdict
- Outcome of one review.
Constants§
- MAX_
GROUPS - MAX_
GROUP_ ID_ BYTES - Longest group identifier in bytes.
- MAX_
GROUP_ SYMBOLS - Largest number of symbols one correlation group lists.
- MAX_
POLICIES - Largest number of policies or groups one supervisor accepts.