Enum Selector
#[non_exhaustive]pub enum Selector {
Axis(RiskAxis),
Curve(CurveId),
FxPair(CurrencyPair),
VolSurface(VolSurfaceId),
FxSmile {
pair: CurrencyPair,
component: SmileComponent,
},
CmsSpreadCorrelation {
first: String,
second: String,
},
CreditQuotes {
credit: CreditCurveId,
},
RateQuotes {
curve: CurveId,
},
TrancheModel {
index: CreditIndexId,
input: TrancheInput,
},
FuturePrice(ListedFutureId),
}Expand description
What one leg of a scenario moves.
Passive data, matched against the market’s own identifiers: a selector asks which input, never what it is worth.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Axis(RiskAxis)
Every input on one risk axis.
Curve(CurveId)
One identified curve.
FxPair(CurrencyPair)
One quoted FX spot, in the direction written: a relative move Δ
takes base/quote to S·(1 + Δ). The spot inside an FX-implied
discount curve is held — moving it against that curve’s fixed
outrights would be a rate move.
VolSurface(VolSurfaceId)
One vol surface: a relative move Δ scales every node vol by
1 + Δ, keeping the smile’s shape and the quoting convention.
FxSmile
One FX surface’s smile shape, in vol points: its risk reversal
(fx_rr(BASE/QUOTE)) or its butterfly (fx_bf(BASE/QUOTE)).
Fields
pair: CurrencyPairThe surface’s pair.
component: SmileComponentWhich part of the smile moves.
CmsSpreadCorrelation
One pair of swap indices’ market CMS spread correlation
(cms_spread_correlation(FIRST/SECOND)), moved absolutely in
correlation units by default — a term structure pillar by pillar at
each pillar’s expiry, a flat mark by a parallel move only. The pair is
order-free, as the market keys it.
Fields
CreditQuotes
One credit’s CDS quotes (credit_quotes(IDENTITY)): the quotes of the
rungs its survival curve was calibrated from — a par spread, or an
upfront on an upfront-quoted rung — moved absolutely in their own
units by default, and the curve solved again from them in the family
it was solved in. A curve pinned with no ladder has no quotes, and is
refused rather than moved in its hazards.
Fields
credit: CreditCurveIdThe credit, as the market keys its survival curve.
RateQuotes
One rate curve’s par quotes (rate_quotes(CURVE), CURVE a rate curve
id such as discount(USD) or projection(USD-SOFR)): the quotes of
the rungs the curve was calibrated from — a par rate, a basis spread,
a STIR future’s futures rate, a bond’s price — moved absolutely in
their own units by default, and the curve bootstrapped again from them
in the form it was solved in. A curve pinned with no refit has no
quotes, and is refused rather than moved in its zero rates.
TrancheModel
One credit index’s tranche model input — its recovery floor
(recovery_floor(INDEX)), its double-t factor degrees of freedom
(factor_dof(INDEX)) or its idiosyncratic ones
(idiosyncratic_dof(INDEX)) — moved by a parallel shift, absolutely
by default, and re-pinned through the market’s range check.
Fields
index: CreditIndexIdThe credit-index id, as the market keys the mark.
input: TrancheInputWhich of the index’s marks moves.
FuturePrice(ListedFutureId)
One listed future’s quoted price (future_price(CONTRACT)), moved by
a parallel shift — absolutely in price points by default, or
relatively. A contract the market quotes no price for is refused.
Implementations§
§impl Selector
impl Selector
pub fn cms_spread_correlation(first: &str, second: &str) -> Self
pub fn cms_spread_correlation(first: &str, second: &str) -> Self
The selector moving the market’s CMS spread correlation for the swap
indices first and second, in either order.
pub fn tranche_model(index: CreditIndexId, input: TrancheInput) -> Self
pub fn tranche_model(index: CreditIndexId, input: TrancheInput) -> Self
The selector moving input, one of the credit index index’s
tranche model marks.
pub fn credit_quotes(credit: CreditCurveId) -> Self
pub fn credit_quotes(credit: CreditCurveId) -> Self
The selector moving the CDS quotes entity’s survival curve was
calibrated from, and solving the curve again.
pub fn rate_quotes(curve: CurveId) -> Self
pub fn rate_quotes(curve: CurveId) -> Self
The selector moving the par quotes the rate curve curve was
calibrated from, and bootstrapping it again.
fn admits_vol(&self, id: &VolSurfaceId) -> bool
fn admits_vol(&self, id: &VolSurfaceId) -> bool
Whether this selector reaches the vol surface id.
fn selects_vols(&self) -> bool
fn selects_vols(&self) -> bool
Whether this selector reaches vol surfaces at all.
fn supported(&self) -> Result<(), ScenarioError>
fn supported(&self) -> Result<(), ScenarioError>
The axes and curves no shock transform reaches.