Struct EuropeanSwaption
pub struct EuropeanSwaption {
pub underlying: SwaptionUnderlying,
pub expiry: NaiveDate,
pub strike: f64,
pub kind: SwaptionKind,
pub engine: SwaptionEngine,
pub settlement: SwaptionSettlement,
}Expand description
A European swaption.
Fields§
§underlying: SwaptionUnderlyingThe forward-starting swap the option confers.
expiry: NaiveDateThe option’s expiry.
strike: f64The fixed rate the option confers.
kind: SwaptionKindPayer or receiver.
engine: SwaptionEngineThe model the option prices under.
settlement: SwaptionSettlementHow it settles on exercise; physical unless said otherwise.
Implementations§
§impl EuropeanSwaption
impl EuropeanSwaption
pub fn new(
underlying: SwaptionUnderlying,
expiry: NaiveDate,
strike: f64,
kind: SwaptionKind,
) -> Result<Self, SwaptionError>
pub fn new( underlying: SwaptionUnderlying, expiry: NaiveDate, strike: f64, kind: SwaptionKind, ) -> Result<Self, SwaptionError>
A European swaption priced off the surface.
§Errors
SwaptionError for an empty fixed leg, a non-finite strike, or an
expiry on or after the underlying’s last fixed payment.
pub fn with_settlement(self, settlement: SwaptionSettlement) -> Self
pub fn with_settlement(self, settlement: SwaptionSettlement) -> Self
This swaption settling as settlement says.
pub fn with_engine(self, engine: SwaptionEngine) -> Self
pub fn with_engine(self, engine: SwaptionEngine) -> Self
This swaption priced under engine.
§impl EuropeanSwaption
impl EuropeanSwaption
pub fn npv_at_vol(
&self,
view: &PricingView<'_, f64>,
vol: f64,
) -> Result<f64, PricingError>
pub fn npv_at_vol( &self, view: &PricingView<'_, f64>, vol: f64, ) -> Result<f64, PricingError>
The option’s passive value at a stated flat volatility under the resolved surface’s convention — Bachelier for a normal surface, Black-76 for a lognormal one — with the surface’s own vol replaced. Surface engine only: a Hull-White swaption states no flat vol.
§Errors
As Priceable::npv, and UnsupportedForProduct under the Hull-White
engine.
Trait Implementations§
§impl Clone for EuropeanSwaption
impl Clone for EuropeanSwaption
§fn clone(&self) -> EuropeanSwaption
fn clone(&self) -> EuropeanSwaption
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 EuropeanSwaption
impl Debug for EuropeanSwaption
§impl PartialEq for EuropeanSwaption
impl PartialEq for EuropeanSwaption
§fn eq(&self, other: &EuropeanSwaption) -> bool
fn eq(&self, other: &EuropeanSwaption) -> bool
self and other values to be equal, and is used by ==.§impl<R: Scalar> Priceable<R> for EuropeanSwaption
impl<R: Scalar> Priceable<R> for EuropeanSwaption
§fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
Under the surface engine, annuity · Black-or-Bachelier(F, K, σ, T)
with the formula chosen by the surface’s convention and σ read at
(T, tenor) in the mode, so vega per node flows. Under Hull-White,
the Jamshidian kernel on the underlying’s fixed payments after expiry.
An expired option is worth nothing.
§fn par_rate(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_rate(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
The underlying’s forward swap rate — the level the strike is measured against.
§fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
§impl PricingRiskFactors for EuropeanSwaption
impl PricingRiskFactors for EuropeanSwaption
§fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
Discounts on the underlying’s collateral and projects its index; the surface engine declares the currency’s swaption vols, the Hull-White engine the currency’s model parameters — each only what it will read.
§impl Product for EuropeanSwaption
impl Product for EuropeanSwaption
§fn currency(&self) -> Currency
fn currency(&self) -> Currency
§fn contract_dates(&self) -> Vec<(&'static str, NaiveDate)>
fn contract_dates(&self) -> Vec<(&'static str, NaiveDate)>
(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>>
fn legs(&self) -> Option<Vec<&Leg>>
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>
fn final_payment_date(&self) -> Option<NaiveDate>
None for a product no ladder is built from.§fn restruck_at_rate(&self, _rate: f64) -> Option<AnyInstrument>
fn restruck_at_rate(&self, _rate: f64) -> Option<AnyInstrument>
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>
fn restruck_at_spread(&self, _spread: f64) -> Option<AnyInstrument>
spread on its spread
leg, or None for a product that quotes none.