Shock

class quantsupport.risk.Shock(target: str, value: float, shock_type: ScenarioType)

A market shock selecting market quote identifiers.

Parameters:
  • target (str) – Nonempty case-insensitive underscore-token selector. Exact identifier equality succeeds first; otherwise all target tokens must occur in the identifier. Token order and repeated-token counts are ignored, so supplying a full identifier does not make the match exact-only. For example, EURIBOR12m selects its deposit and swap quotes; FUNDINGSPREAD selects every zero-rate quote of that funding-spread curve.

  • value (float) – Finite additive change in the selected input’s units for Absolute shocks (for decimal interest rates, 0.01 is 100 basis points), or fractional change for Relative shocks (0.10 increases inputs by 10%). No default is supplied.

  • shock_type (ScenarioType) – Required typed ScenarioType.Absolute or ScenarioType.Relative; strings are not accepted by this constructor. Absolute adds value to the input; Relative multiplies it by 1 + value.

Raises:

ValueError – If target is empty or value is not finite.

Notes

Immutable. Combine shocks in Scenario and enter it after a PricingContext. Overlapping selectors apply independently in order, without deduplication. Repeated tenor/expiry tokens can cause a full quote identifier to match additional quotes. Use one family selector for one family-wide move and verify the selected inputs, rather than assuming one shock per full ID bumps once.

Source declaration

Properties

property shock_type: ScenarioType

Interpretation of the shock value.

property target: str

Case-sensitive underscore-token selector, with no exact-only mode.

property value: float

Additive decimal change or fractional relative change.