Skip to main content

CpiRedemption

Struct CpiRedemption 

pub struct CpiRedemption {
    pub payment_date: NaiveDate,
    pub payment_ordinal: i32,
    pub notional: f64,
    pub currency: Currency,
    pub index: String,
    pub lag_months: u32,
    pub base_index: f64,
    pub observation: NaiveDate,
    pub growth_only: bool,
    pub base_date: Option<NaiveDate>,
    pub payoff: Option<RatePayoff>,
}
Expand description

A CPI coupon leg’s indexed notional: notional · (I(T)/base − 1) where it pays the growth only, or notional · I(T)/base, I(T) the index observed for observation under the index’s lag and interpolation, as a CpiCoupon observes its accrual end.

Fields§

§payment_date: NaiveDate

The payment date.

§payment_ordinal: i32

The payment date as a proleptic-Gregorian day number.

§notional: f64

The notional before indexation. Contract data.

§currency: Currency

The currency.

§index: String

The price index’s registry code.

§lag_months: u32

The observation lag, in months.

§base_index: f64

The base index level. Contract data.

§observation: NaiveDate

The date the index is observed for — the leg’s last accrual end.

§growth_only: bool

Whether only the notional’s growth is paid.

§base_date: Option<NaiveDate>

The date the base level stands for — the start of the indexation, which a payoff’s annualised strikes are measured from. Needed only by a payoff.

§payoff: Option<RatePayoff>

A collar on the indexed notional, or None. Its bounds are annualised zero-coupon rates k: the ratio I(T)/base is held within [(1+k_floor)^τ, (1+k_cap)^τ], τ = ACT/365F(base_date, observation) — a linker’s deflation floor is floor = 0. Still to fix, each bound is a zero-coupon optionlet on the ratio off the index’s CPI vol surface (see crate::marketdata::inflation_vol::CpiVolSurface).

Implementations§

§

impl CpiRedemption

pub fn with_payoff(self, payoff: RatePayoff, base_date: NaiveDate) -> Self

This notional with payoff on its indexed growth, strikes annualised from base_date.

pub fn rate_with<R: Scalar, C: CurveByIndex<R> + ?Sized>( &self, curves: &C, fixings: &FixingsView<'_, R>, as_of: NaiveDate, ) -> Result<R, CashflowError>

What the notional pays per unit of notional — the ratio I(T)/base, less one where only the growth is paid — with its collar, as of as_of: settled on a published observation, otherwise the rate less a zero-coupon call at the cap plus a put at the floor, through the coupon layer’s payoff composition.

§Errors

CashflowError::NoIndexForCoupon where curves holds no inflation for the index; CashflowError::MalformedPayoff for a digital or an unanchored strike; CashflowError::PayoffWithoutCpiVols where an option still to fix meets no CPI vols; the curve’s own errors.

Trait Implementations§

§

impl Clone for CpiRedemption

§

fn clone(&self) -> CpiRedemption

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 CpiRedemption

§

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

Formats the value using the given formatter. Read more
§

impl PartialEq for CpiRedemption

§

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

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.