Skip to main content

CmsCoupon

Struct CmsCoupon 

pub struct CmsCoupon {
Show 18 fields pub accrual_start: NaiveDate, pub accrual_end: NaiveDate, pub payment_date: NaiveDate, pub payment_ordinal: i32, pub fixing_date: NaiveDate, pub notional: f64, pub gearing: f64, pub spread: f64, pub day_count: DayCountFraction, pub accrual: f64, pub currency: Currency, pub template: String, pub tenor: Period, pub projection: String, pub fixing_key: String, pub mean_reversion: f64, pub payoff: Option<RatePayoff>, pub spread_against: Option<Box<CmsSpreadLeg>>,
}
Expand description

A CMS coupon: notional · τ · (g · CMS + s), the CMS rate the swap index template at tenor fixes on fixing_date — in advance, by the index’s fixing lag — convexity-adjusted by linear TSR at mean_reversion and paid on payment_date. A payoff caps, floors or digitises the rate as on an IBOR coupon.

It holds the swap index by its codes, resolved when priced: the index is a market-layer type. Its rate needs the discount curve and the swaption smile as well as a projection, so only a source that answers CurveByIndex::cms_rate can project it; a print under fixing_key settles it anywhere.

Fields§

§accrual_start: NaiveDate

Accrual start.

§accrual_end: NaiveDate

Accrual end.

§payment_date: NaiveDate

The payment date.

§payment_ordinal: i32

The payment date as a proleptic-Gregorian day number.

§fixing_date: NaiveDate

The CMS rate’s fixing date.

§notional: f64

The notional.

§gearing: f64

Multiplier on the CMS rate.

§spread: f64

Added to the geared rate, as a decimal.

§day_count: DayCountFraction

The accrual day count.

§accrual: f64

The accrual year fraction.

§currency: Currency

The coupon’s currency.

§template: String

The fixed-versus-IBOR swap template the index is quoted on.

§tenor: Period

The swap tenor.

§projection: String

The projection key of the swap’s floating index — the curve the CMS rate’s forward reads.

§fixing_key: String

The key the swap index’s prints are stored under.

§mean_reversion: f64

The mean reversion the linear TSR slope is taken at.

§payoff: Option<RatePayoff>

An option on the rate g · CMS + s, or None for a plain coupon.

§spread_against: Option<Box<CmsSpreadLeg>>

A second swap index whose rate is subtracted, making the observation a spread of two, or None.

Implementations§

§

impl CmsCoupon

pub fn settled<R: Scalar>( &self, fixings: &FixingsView<'_, R>, as_of: NaiveDate, ) -> Result<Option<R>, CashflowError>

What the coupon pays when its fixing is published — the rate geared, spread and settled through its payoff — or None while it is still to fix. A fixing before today must be published: see FixingsView::observe.

§Errors

A missing historical print; a malformed payoff.

§

impl CmsCoupon

pub fn on_index( index: &SwapIndex, start: NaiveDate, end: NaiveDate, payment: NaiveDate, notional: f64, gearing: f64, spread: f64, day_count: DayCountFraction, mean_reversion: f64, ) -> Self

A CMS coupon on index accruing from start to end on day_count, paid on payment: its rate fixes the index’s fixing lag before start, as a CmsSwap’s periods do, and is gearing · CMS + spread, convexity-adjusted at mean_reversion.

pub fn on_spread( index: &SwapIndex, minus: &SwapIndex, correlation: impl Into<CmsSpreadCorrelation>, start: NaiveDate, end: NaiveDate, payment: NaiveDate, notional: f64, gearing: f64, spread: f64, day_count: DayCountFraction, mean_reversion: f64, ) -> Self

A CMS spread coupon: gearing · (CMS(index) − CMS(minus)) + spread, both rates fixing on index’s lag before start, their correlation correlation — a contract number, or the market’s mark for the pair.

Trait Implementations§

§

impl Clone for CmsCoupon

§

fn clone(&self) -> CmsCoupon

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 CmsCoupon

§

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

Formats the value using the given formatter. Read more
§

impl PartialEq for CmsCoupon

§

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

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.