Enum SwaptionUnderlying
#[non_exhaustive]pub enum SwaptionUnderlying {
Vanilla(VanillaSwap),
Ois(OvernightIndexedSwap),
}Expand description
The swap a swaption is written on: the closed two-arm set.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Vanilla(VanillaSwap)
A fixed-versus-IBOR swap.
Ois(OvernightIndexedSwap)
An overnight-indexed swap — the post-LIBOR market.
Implementations§
§impl SwaptionUnderlying
impl SwaptionUnderlying
pub fn as_instrument(&self) -> AnyInstrument
pub fn as_instrument(&self) -> AnyInstrument
This underlying as an instrument in its own right.
The widening back into AnyInstrument
belongs here, beside the narrow
union it inverts, rather than in a binding that would have to be taught
each arm again.
§impl SwaptionUnderlying
impl SwaptionUnderlying
pub fn currency(&self) -> Currency
pub fn currency(&self) -> Currency
The swap’s currency — the discount, Hull-White and vol-surface key.
pub fn collateral(&self) -> &CollateralSpec
pub fn collateral(&self) -> &CollateralSpec
What the swap is collateralised against.
fn fixed_coupons(&self) -> impl Iterator<Item = &FixedRateCoupon>
fn fixed_coupons(&self) -> impl Iterator<Item = &FixedRateCoupon>
The fixed leg’s coupons, in order — the accrual periods the option’s annuity and the Hull-White coupon bond are built from. Redemptions, if a leg carried any, are not rate-bearing and are skipped.
pub fn effective_date(&self) -> Option<NaiveDate>
pub fn effective_date(&self) -> Option<NaiveDate>
The fixed leg’s first accrual start — the underlying’s effective date.
pub fn termination_date(&self) -> Option<NaiveDate>
pub fn termination_date(&self) -> Option<NaiveDate>
The fixed leg’s last accrual end — the underlying’s termination.
pub fn last_payment_date(&self) -> Option<NaiveDate>
pub fn last_payment_date(&self) -> Option<NaiveDate>
The fixed leg’s last payment date.
pub fn fixed_periods(&self) -> Vec<(NaiveDate, NaiveDate, f64)>
pub fn fixed_periods(&self) -> Vec<(NaiveDate, NaiveDate, f64)>
The fixed leg’s periods as (accrual start, payment date, accrual year fraction), in accrual order — the coupon bond the Hull-White engines
price. Exercise on a date enters the periods whose accrual starts
on or after it: with a payment lag, the period that has just ended
still pays after the exercise date and must not be entered.
pub fn periods_entered_on(&self, date: NaiveDate) -> Vec<(NaiveDate, f64)>
pub fn periods_entered_on(&self, date: NaiveDate) -> Vec<(NaiveDate, f64)>
The fixed periods entered by exercising on date: (payment date, accrual year fraction) for every period whose accrual starts on or
after it.
pub fn tenor_years(&self) -> f64
pub fn tenor_years(&self) -> f64
The underlying’s tenor in years — Act/365F over the fixed leg’s accrual span, the coordinate the vol surface is read at.
Trait Implementations§
§impl Clone for SwaptionUnderlying
impl Clone for SwaptionUnderlying
§fn clone(&self) -> SwaptionUnderlying
fn clone(&self) -> SwaptionUnderlying
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for SwaptionUnderlying
impl Debug for SwaptionUnderlying
§impl PartialEq for SwaptionUnderlying
impl PartialEq for SwaptionUnderlying
§fn eq(&self, other: &SwaptionUnderlying) -> bool
fn eq(&self, other: &SwaptionUnderlying) -> bool
self and other values to be equal, and is used by ==.