Skip to main content

Crate qs_risk

Crate qs_risk 

Source
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§

CorrelationGroup
Symbols the owner declares to be one bet, so a cap can bound their combined risk.
ExposureFact
One position, pending order, or approved request the supervisor counts.
ExposureIntent
One request for new exposure as the supervisor sees it.
HaltInterval
A period during which new exposure was rejected.
PortfolioFacts
Account state at the moment of a review or boundary.
PortfolioSupervisor
Portfolio risk supervisor for one account.

Enums§

HaltAction
What a kill switch does when it trips.
HaltCommand
A bulk action a halt asks the executing stage to perform.
IntentKind
Whether a request adds a position or grows an existing one.
LossLimit
How large a day’s realized loss may become.
RiskConfigError
A supervisor configuration the owner cannot run.
RiskPolicy
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.