Skip to main content

MarketState

Struct MarketState 

struct MarketState {
    terms: IdStore<CurveId, Term>,
    vols: IdStore<VolSurfaceId, VolSurface>,
    observations: Observations,
    marks: IdStore<MarkId, Mark>,
}
Expand description

The stored state a lift reads, as four families by shape — what the machinery branches on, not the asset class, which stays a label derived from each input’s risk axis. The walk is the families in this order, each family in its identity’s own order.

familyholdskeyed bylifted as
termsrate curves (4 roles), survival curves + recovery, inflation curvesCurveIdthe curve’s parameters; the recovery its own span
volsFX, swaption, cap, bond-yield, credit, YoY and CPI vol surfacesVolSurfaceIdone parameter per node
observationsFX spots, published fixings—always yielded, even when empty
marksbase, CMS spread and basket correlations, recovery floors, copula degrees of freedom, watched scalarsMarkIdper mark; walked last

Equality is derived: a store cannot join this struct and stay out of it.

Fields§

§terms: IdStore<CurveId, Term>

Every term structure — the four rate-curve roles, the survival curves with their stated recovery, the inflation curves — in one store keyed by curve identity. The identity’s own order is the lift order: every discount curve, then every projection, then every credit, repo, spread and inflation curve, each role by its key; no per-role store exists to be reordered on its own. The identity’s role decides which arm of Term sits under it, as for vols and marks.

§vols: IdStore<VolSurfaceId, VolSurface>

Every vol surface — FX by pair; swaption, cap and bond yield by currency; credit by name; year-on-year and zero-coupon inflation by price-index code — in one store keyed by surface identity. The identity’s own order is the lift order, and the identity decides which arm of VolSurface sits under it: the verbs insert each with its own, so a reader asking for another arm meets a defect in this store, never a caller’s.

§observations: Observations

The facts already printed — spots and fixings — which no identity keys and which are always yielded, even when empty, so a market that later gains one moves no other input.

§marks: IdStore<MarkId, Mark>

Every model mark — base correlation per credit index, CMS spread correlation per pair of swap-index codes (the pair in the order correlation_pair puts it), basket correlation by the caller’s key, tranche recovery floor and double-t degrees of freedom per credit index, and the watched exogenous scalars by label — in one store keyed by mark identity, in the identity’s order, walked last so a market that gains a mark moves no other input. Each is lifted: one parameter per base- correlation point or CMS pillar, two per copula, one otherwise, on the correlation axis (floors on the recovery axis, exogenous scalars on none). The identity decides the Mark arm under it, as for vols.

Trait Implementations§

§

impl Clone for MarketState

§

fn clone(&self) -> MarketState

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 MarketState

§

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

Formats the value using the given formatter. Read more
§

impl Default for MarketState

§

fn default() -> MarketState

Returns the “default value” for a type. Read more
§

impl PartialEq for MarketState

§

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

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