Skip to main content

Selector

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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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: CurrencyPair

The surface’s pair.

§component: SmileComponent

Which 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

§first: String

The first swap-index code, in the market’s order.

§second: String

The second swap-index code.

§

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: CreditCurveId

The 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.

Fields

§curve: CurveId

The curve, under the role the market pins it.

§

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: CreditIndexId

The credit-index id, as the market keys the mark.

§input: TrancheInput

Which 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

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

The selector moving input, one of the credit index index’s tranche model marks.

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

The selector moving the par quotes the rate curve curve was calibrated from, and bootstrapping it again.

pub fn admits(&self, id: &CurveId) -> bool

Whether this selector admits the curve id names.

fn admits_vol(&self, id: &VolSurfaceId) -> bool

Whether this selector reaches the vol surface id.

fn selects_vols(&self) -> bool

Whether this selector reaches vol surfaces at all.

fn fx_target(&self) -> Option<FxTarget>

Which FX spots this selector reaches, if any.

fn supported(&self) -> Result<(), ScenarioError>

The axes and curves no shock transform reaches.

Trait Implementations§

§

impl Clone for Selector

§

fn clone(&self) -> Selector

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Selector

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl Display for Selector

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl FromStr for Selector

The inverse of Display: an axis name, a curve, or fx(BASE/QUOTE).

§

type Err = SelectorParseError

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
§

impl PartialEq for Selector

§

fn eq(&self, other: &Selector) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl StructuralPartialEq for Selector

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.