Skip to main content

MarketInputId

Enum MarketInputId 

#[non_exhaustive]
pub enum MarketInputId {
Show 27 variants CurveNode { curve: CurveId, node_index: usize, date: NaiveDate, }, MeetingNode { curve: CurveId, meeting: MeetingId, }, TurnNode { curve: CurveId, date: NaiveDate, }, CurveLevel { curve: CurveId, node_index: usize, }, CurveFxSpot { curve: CurveId, }, FxSpot { pair: CurrencyPair, }, Fixing { index: String, date: NaiveDate, }, Exogenous { label: String, }, FxVolNode { pair: CurrencyPair, expiry: NaiveDate, quote: DeltaQuote, }, RateVolNode { currency: Currency, expiry_bp: u32, tenor_bp: u32, spread_bp: Option<i32>, }, BondYieldVolNode { key: String, expiry_bp: u32, duration_bp: u32, }, CapVolNode { currency: Currency, expiry_bp: u32, tenor_bp: u32, strike_bp: Option<i32>, }, CreditVolNode { credit: CreditCurveId, expiry_bp: u32, }, BaseCorrelationNode { index: CreditIndexId, detachment_bp: u32, }, Recovery { credit: CreditCurveId, }, BasketCorrelation { basket: String, }, CmsSpreadCorrelation { first: String, second: String, expiry_bp: Option<u32>, strike_bp: Option<i32>, }, YoyVolNode { index: String, expiry_bp: u32, strike_bp: Option<i32>, }, CpiVolNode { index: String, expiry_bp: u32, strike_bp: Option<i32>, }, RecoveryFloor { index: CreditIndexId, }, FactorDof { index: CreditIndexId, }, IdiosyncraticDof { index: CreditIndexId, }, SabrNode { registry: SabrRegistry, currency: Currency, expiry_bp: u32, tenor_bp: u32, parameter: SabrParameter, }, FuturePrice { contract: ListedFutureId, }, EquitySpot { name: String, }, FutureOptionVolNode { contract: ListedFutureId, expiry: Option<NaiveDate>, strike_bp: Option<u32>, }, EquityVolNode { name: String, expiry: Option<NaiveDate>, strike_bp: Option<u32>, },
}
Expand description

The typed key for one entry of a risk vector.

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

CurveNode

An ordinary dated pillar on an identified curve. node_index counts within that curve’s flat parameter vector.

Fields

§curve: CurveId

The curve the pillar belongs to.

§node_index: usize

Position in the curve’s flat parameter vector.

§date: NaiveDate

The pillar’s date, carried so a tenor bucketing needs no lookup.

§

MeetingNode

A step-curve pillar anchored at a central-bank policy decision.

Fields

§curve: CurveId

The curve the pillar belongs to.

§meeting: MeetingId

The decision the pillar represents.

§

TurnNode

A step-curve pillar anchored at a turn-of-period jump.

Fields

§curve: CurveId

The curve the pillar belongs to.

§date: NaiveDate

The turn date.

§

CurveLevel

An undated level on an identified curve — a flat hazard, a quoted level with no pillar. It belongs to its curve’s axis but to no tenor bucket.

Fields

§curve: CurveId

The curve the level belongs to.

§node_index: usize

Position in the curve’s flat parameter vector.

§

CurveFxSpot

The FX spot an implied curve is built over. It sits on the FX axis rather than the axis of the curve that owns it: it is an FX market fact, and a rate ladder that swept it up would report an FX move as a rate move.

Fields

§curve: CurveId

The implied curve that owns the spot.

§

FxSpot

A quoted FX spot rate, keyed by ordered pair. Undated.

Fields

§pair: CurrencyPair

The pair, quoted as quote per one base.

§

Fixing

One published index observation. Dated, but on no rate axis: a reset exposure is per-observation, not per-pillar, and reports on its own ladder.

Fields

§index: String

The floating index name.

§date: NaiveDate

The observation date.

§

Exogenous

A caller-named differentiable scalar. It has no natural bump unit and belongs to no axis.

Fields

§label: String

The label the scalar was stored under.

§

FxVolNode

One node of a delta-quoted FX vol surface: the quote the market names it by, which compares to the basis point of delta.

Fields

§pair: CurrencyPair

The pair the surface belongs to.

§expiry: NaiveDate

The smile’s expiry.

§quote: DeltaQuote

The node’s quote: 25P, ATM, 25C.

§

RateVolNode

One node of a currency’s swaption vol surface. The two year fractions are carried in basis points of a year so the key stays exactly comparable.

Fields

§currency: Currency

The currency the surface belongs to.

§expiry_bp: u32

The option expiry, in basis points of a year (10_000 = 1y).

§tenor_bp: u32

The underlying tenor, in basis points of a year.

§spread_bp: Option<i32>

The smile column, as a spread to the at-the-money forward in basis points, where the surface carries a smile; absent on one quoted at the money.

§

BondYieldVolNode

One node of a bond yield vol surface — the same grid type as a swaption surface, read by a bond option at its forward modified duration, and told apart from the swaption registry by this key.

Fields

§key: String

The key the surface is pinned under: a currency code, or the security an option names.

§expiry_bp: u32

The option expiry, in basis points of a year.

§duration_bp: u32

The duration pillar, in basis points of a year.

§

CapVolNode

One node of a currency’s cap vol surface — the same grid type as a swaption surface, read by a caplet at its fixing and the index tenor, and told apart from the swaption registry by this key.

Fields

§currency: Currency

The currency the surface belongs to.

§expiry_bp: u32

The caplet expiry, in basis points of a year.

§tenor_bp: u32

The index tenor, in basis points of a year.

§strike_bp: Option<i32>

The strike column, in basis points, where the surface carries a smile; absent on a surface quoted at the money.

§

CreditVolNode

One node of a credit name’s CDS option vol surface, by expiry.

Fields

§credit: CreditCurveId

The credit name the surface belongs to.

§expiry_bp: u32

The option expiry, in basis points of a year.

§

BaseCorrelationNode

One quoted point of a credit index’s base-correlation curve: the correlation of the base tranche detaching there.

Fields

§index: CreditIndexId

The credit index the curve belongs to.

§detachment_bp: u32

The base tranche’s detachment, in basis points of the pool (300 = 3%).

§

Recovery

One entity’s market recovery: the rate default settles at, with its survival curve held.

Fields

§credit: CreditCurveId

The entity the recovery is quoted for.

§

BasketCorrelation

One basket’s market asset correlation, by the caller’s key — the correlation an nth-to-default basket on a market correlation reads.

Fields

§basket: String

The key it is pinned under.

§

CmsSpreadCorrelation

One pair of swap indices’ market CMS spread correlation — what a CMS spread coupon on a market correlation reads. The pair is in the market’s order (the lesser code first), since a correlation is symmetric. A flat mark is one parameter with no expiry; a term structure carries one per pillar; a surface carries one per (expiry, strike) node.

Fields

§first: String

The first swap-index code.

§second: String

The second swap-index code.

§expiry_bp: Option<u32>

The pillar’s option expiry, in basis points of a year; None for a flat mark.

§strike_bp: Option<i32>

The pillar’s strike, in basis points; None for a flat mark or a term structure.

§

YoyVolNode

One node of a price index’s year-on-year inflation optionlet vol surface — what a YoY caplet, floorlet or collared YoY coupon reads.

Fields

§index: String

The price index’s registry code.

§expiry_bp: u32

The optionlet expiry, in basis points of a year.

§strike_bp: Option<i32>

The strike column, in basis points, where the surface carries a smile; absent on a flat surface.

§

CpiVolNode

One node of a price index’s zero-coupon CPI option vol surface — what a zero-coupon inflation cap, floor or collared CPI notional reads.

Fields

§index: String

The price index’s registry code.

§expiry_bp: u32

The option expiry, in basis points of a year.

§strike_bp: Option<i32>

The annualised zero-coupon strike column, in basis points, where the surface carries a smile; absent on a flat surface.

§

RecoveryFloor

One credit index’s market Amraoui–Hitier recovery floor — what a tranche on a market floor reads.

Fields

§index: CreditIndexId

The credit-index id.

§

FactorDof

One credit index’s market double-t factor degrees of freedom — what a tranche on a market copula reads.

Fields

§index: CreditIndexId

The credit-index id.

§

IdiosyncraticDof

One credit index’s market double-t idiosyncratic degrees of freedom.

Fields

§index: CreditIndexId

The credit-index id.

§

SabrNode

One parameter of one node of a SABR rate smile — its ATM vol, ρ or ν.

Fields

§registry: SabrRegistry

The registry the surface is pinned in.

§currency: Currency

The currency the surface belongs to.

§expiry_bp: u32

The node’s expiry, in basis points of a year.

§tenor_bp: u32

The node’s tenor, in basis points of a year.

§parameter: SabrParameter

Which of the node’s parameters.

§

FuturePrice

One listed future’s quoted price, per 100 face — what an option on the future reads as its underlying. Undated, and on its own axis: a futures delta is a price exposure, not a pillar exposure.

Fields

§contract: ListedFutureId

The contract quoted.

§

EquitySpot

One equity’s quoted spot. Undated, on the equity axis.

Fields

§name: String

The equity’s name, as the trade states it.

§

FutureOptionVolNode

One node of a listed future’s option vol surface. The strike is carried in ten-thousandths of a price point so the key stays exactly comparable.

Fields

§contract: ListedFutureId

The underlying contract the surface belongs to.

§expiry: Option<NaiveDate>

The listed option expiry; None on a flat surface.

§strike_bp: Option<u32>

The strike, per 100 face, in ten-thousandths (1_125_000 = 112.5); None on a flat surface.

§

EquityVolNode

One node of an equity’s option vol surface, keyed as a listed future option’s node is.

Fields

§name: String

The equity’s name.

§expiry: Option<NaiveDate>

The listed option expiry; None on a flat surface.

§strike_bp: Option<u32>

The strike in ten-thousandths of a price unit; None on a flat surface.

Implementations§

§

impl MarketInputId

pub fn curve(&self) -> Option<&CurveId>

The curve this key belongs to, where it belongs to one.

pub fn date(&self) -> Option<NaiveDate>

The date this key reports against, where it has one.

None for the undated families — a level, a spot, an exogenous scalar — which is what keeps them out of a tenor bucketing that would otherwise have to invent a date for them.

Trait Implementations§

§

impl Clone for MarketInputId

§

fn clone(&self) -> MarketInputId

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 MarketInputId

§

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

Formats the value using the given formatter. Read more
§

impl Display for MarketInputId

§

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

Formats the value using the given formatter. Read more
§

impl Eq for MarketInputId

§

impl Hash for MarketInputId

§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl Ord for MarketInputId

§

fn cmp(&self, other: &MarketInputId) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
§

impl PartialEq for MarketInputId

§

fn eq(&self, other: &MarketInputId) -> 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 PartialOrd for MarketInputId

§

fn partial_cmp(&self, other: &MarketInputId) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl StructuralPartialEq for MarketInputId

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.