Skip to main content

InterestRateCapFloor

Struct InterestRateCapFloor 

pub struct InterestRateCapFloor {
    pub leg: Leg,
    pub strike: f64,
    pub kind: CapFloorKind,
    pub currency: Currency,
    pub index: String,
    pub tenor_years: f64,
    pub collateral: CollateralSpec,
}
Expand description

A strip of caplets or floorlets on a registered term index.

Fields§

§leg: Leg

The index’s own coupons between the two dates, received.

§strike: f64

The strike rate every caplet is struck at.

§kind: CapFloorKind

Cap or floor.

§currency: Currency

The currency the strip pays in.

§index: String

The registry code of the index each coupon resets on.

§tenor_years: f64

The strip’s coupon frequency in years — the second axis the cap vol surface is read on. For a term index this is its tenor; for an overnight index it is the stated frequency, because a quarterly overnight cap reads a quarterly column and not a one-day one.

§collateral: CollateralSpec

The discounting the strip is priced on.

Implementations§

§

impl InterestRateCapFloor

pub fn new( index: &IborIndex, effective: NaiveDate, termination: NaiveDate, notional: f64, strike: f64, kind: CapFloorKind, ) -> Result<Self, CapFloorError>

A kind strip on index from effective to termination, on notional, struck at strike. The schedule and the coupons are the index’s: its tenor, calendar, roll convention, end-of-month rule and day count, with each coupon fixing on the index’s own lag and projecting as every term coupon does — a regular period over the index’s own window, a stub over its accrual — so a cap less a floor at one strike is the swap on the same dates.

§Errors

CapFloorError::NonFiniteStrike for a NaN or infinite strike; CapFloorError::EmptyStrip if no coupon accrues between the dates.

§Panics

If the index’s currency code is not an ISO code — a registered index always carries one.

pub fn on_overnight( index: &OvernightIndex, effective: NaiveDate, termination: NaiveDate, frequency: Period, notional: f64, strike: f64, kind: CapFloorKind, ) -> Result<Self, CapFloorError>

A kind strip on an overnight index from effective to termination at frequency, on notional, struck at strike.

Each coupon compounds the index’s daily prints over its own accrual period — the observation strip an overnight swap leg builds, on the index’s publication calendar and day count. So the underlying of each caplet is a rate that is not known until its period ends, which is what the pricer reads off the coupon kind.

The surface’s second axis is frequency, not the index’s one-day tenor.

§Errors

CapFloorError::NonFiniteStrike for a NaN or infinite strike; CapFloorError::EmptyStrip if no coupon accrues between the dates.

§Panics

If the index’s currency code is not an ISO code — a registered index always carries one.

pub fn on_coupons( coupons: Vec<AnyCoupon>, strike: f64, kind: CapFloorKind, currency: Currency, index: impl Into<String>, tenor_years: f64, collateral: CollateralSpec, ) -> Result<Self, CapFloorError>

A strip on coupons already compiled — a note’s own — struck at strike: the term-index coupons among them, taken as they are. What a capped or floored note prices its option on, so the two share every fixing, accrual and payment date by construction.

§Errors

CapFloorError::NonFiniteStrike for a NaN or infinite strike; CapFloorError::EmptyStrip if no term-index coupon is among them.

pub fn without_first_caplet(self) -> Result<Self, CapFloorError>

This strip without its first caplet — the market’s cap. A cap traded at spot has a first coupon whose rate is fixed at trade, so the market quotes and prices the strip from the second caplet on. A strip of one caplet excluded is empty, and is refused.

§Errors

CapFloorError::EmptyStrip if no caplet would remain.

pub fn notional(&self) -> f64

The notional the coupons accrue on.

§

impl InterestRateCapFloor

pub fn caplets( &self, view: &PricingView<'_, f64>, ) -> Result<Vec<Caplet>, PricingError>

The strip’s caplets on the derivative-free projection, in payment order, coupons already paid omitted — the inputs a stripper prices with the kernel directly.

§Errors

As Priceable::npv, less the surface: no cap vol is read.

Trait Implementations§

§

impl Clone for InterestRateCapFloor

§

fn clone(&self) -> InterestRateCapFloor

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 InterestRateCapFloor

§

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

Formats the value using the given formatter. Read more
§

impl PartialEq for InterestRateCapFloor

§

fn eq(&self, other: &InterestRateCapFloor) -> 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<R: Scalar> Priceable<R> for InterestRateCapFloor

§

fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>

Σ N·τᵢ·DF(payᵢ)·Black-or-Bachelier(Fᵢ, K, σ(Tᵢ, tenor, K), Tᵢ) over the strip’s coupons, with Fᵢ each coupon’s own projected rate (a fixing already observed reads the store), Tᵢ the year fraction to its fixing — or, for a coupon compounding an overnight index, the accrual end it is keyed on and the effective variance S + (E − S)/3 it accrues over — the formula chosen by the surface’s convention and σ read at the cap’s own strike in the mode so vega per node flows — a surface quoted at the money answers every strike alike. A coupon fixed on or before the valuation date takes T = 0, and both kernels return intrinsic at zero variance.

§

fn par_rate(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>

The strip’s at-the-money rate Σ N·τ·DF·F / Σ N·τ·DF — the strike at which a cap and a floor are worth the same.

§

fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>

The par (breakeven) floating-leg spread. Zero for a product with no floating leg. Read more
§

impl PricingRiskFactors for InterestRateCapFloor

§

fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>

Discounts on the strip’s collateral, projects its index and reads the currency’s cap vol surface.

§

impl Product for InterestRateCapFloor

§

fn currency(&self) -> Currency

The currency the product pays in. An FX product values in its quote currency; a book converts.
§

fn contract_dates(&self) -> Vec<(&'static str, NaiveDate)>

The contract dates the product resolved to, as (name, date) pairs — exactly the dates its stated constructor takes, so a product built through a derived form can be read back and rebuilt through the stated one. Empty for a product with no stated form. No default: every product states which it is — see AnyInstrument::contract_dates.
§

fn legs(&self) -> Option<Vec<&Leg>>

The legs the product itself holds, in a declared order, or None for a product that holds none — see AnyInstrument::legs. No default: every product states which it is.
§

fn final_payment_date(&self) -> Option<NaiveDate>

The date of the product’s final payment, where a calibration rung can be built on it; None for a product no ladder is built from.
§

fn restruck_at_rate(&self, _rate: f64) -> Option<AnyInstrument>

This product re-struck at the par rate rate — the scalar a par calibration rung on it is quoted in — or None for a product that carries no such scalar. What a quote scenario moves a rung to.
§

fn restruck_at_spread(&self, _spread: f64) -> Option<AnyInstrument>

This product re-struck at the basis spread spread on its spread leg, or None for a product that quotes none.
§

impl StructuralPartialEq for InterestRateCapFloor

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.