Struct CreditDefaultSwapOption
pub struct CreditDefaultSwapOption {
pub underlying: CreditDefaultSwap,
pub expiry: NaiveDate,
pub strike: f64,
pub kind: SwaptionKind,
pub short: bool,
pub style: CdsOptionStyle,
pub strike_type: CdsStrikeType,
}Expand description
A European option on a CDS: the right at expiry to enter underlying —
the CDS it exercises into, its protection starting after expiry — as a
payer (buying protection at the strike spread) or a receiver
(selling it), held long or short.
Priced at the vol the market’s credit vol surface for the underlying’s
name quotes at expiry, under one of three CdsOptionStyles.
Fields§
§underlying: CreditDefaultSwapThe CDS the option exercises into.
expiry: NaiveDateThe exercise date.
strike: f64The strike spread, as a decimal.
kind: SwaptionKindA payer (the right to buy protection) or a receiver.
short: boolThe seller’s side: the holder’s value negated.
style: CdsOptionStyleWhat a default before expiry does, and how the option is priced.
strike_type: CdsStrikeTypeHow strike is quoted: a spread, or the price the holder enters at.
Implementations§
§impl CreditDefaultSwapOption
impl CreditDefaultSwapOption
pub fn new(
underlying: CreditDefaultSwap,
expiry: NaiveDate,
strike: f64,
kind: SwaptionKind,
short: bool,
style: CdsOptionStyle,
) -> Result<Self, CreditDefaultSwapOptionError>
pub fn new( underlying: CreditDefaultSwap, expiry: NaiveDate, strike: f64, kind: SwaptionKind, short: bool, style: CdsOptionStyle, ) -> Result<Self, CreditDefaultSwapOptionError>
An option at expiry on underlying struck at strike.
§Errors
CreditDefaultSwapOptionError for an underlying whose protection does not start
after the expiry, or a strike that is not finite and positive.
pub fn with_price_strike(self) -> Result<Self, CreditDefaultSwapOptionError>
pub fn with_price_strike(self) -> Result<Self, CreditDefaultSwapOptionError>
Read strike as a price per unit notional.
§Errors
CreditDefaultSwapOptionError::PriceStrikeNeedsIndex off the index style.
§impl CreditDefaultSwapOption
impl CreditDefaultSwapOption
fn at_expiry<R: Scalar>(
&self,
view: &PricingView<'_, R>,
) -> Result<(R, R, R), PricingError>
fn at_expiry<R: Scalar>( &self, view: &PricingView<'_, R>, ) -> Result<(R, R, R), PricingError>
The recovery, the survival probability to expiry and the discount factor to it: what a default before expiry is settled on.
fn index_value<R: Scalar>(
&self,
view: &PricingView<'_, R>,
legs: &CdsLegs<R>,
vol: R,
t: f64,
) -> Result<R, PricingError>
fn index_value<R: Scalar>( &self, view: &PricingView<'_, R>, legs: &CdsLegs<R>, vol: R, t: f64, ) -> Result<R, PricingError>
The index model; see
CdsOptionStyle::Index.
The spread’s mean is solved passively by Newton and then taken one Newton step in the mode from the solution, which carries the implicit function’s first derivatives exactly; the exercise boundary is passive, the payoff being zero on it.
Trait Implementations§
§impl Clone for CreditDefaultSwapOption
impl Clone for CreditDefaultSwapOption
§fn clone(&self) -> CreditDefaultSwapOption
fn clone(&self) -> CreditDefaultSwapOption
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 CreditDefaultSwapOption
impl Debug for CreditDefaultSwapOption
§impl PartialEq for CreditDefaultSwapOption
impl PartialEq for CreditDefaultSwapOption
§fn eq(&self, other: &CreditDefaultSwapOption) -> bool
fn eq(&self, other: &CreditDefaultSwapOption) -> bool
self and other values to be equal, and is used by ==.§impl<R: Scalar> Priceable<R> for CreditDefaultSwapOption
impl<R: Scalar> Priceable<R> for CreditDefaultSwapOption
§fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
By style: Black on the
underlying’s forward spread F over its forward risky annuity A,
both survival-weighted from today, at the name’s credit vol for the
expiry — a payer adding its front-end protection where the option
does not knock out — or the index model. Nothing once expired:
exercise was decided then.
§fn par_rate(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_rate(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
§fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
§impl PricingRiskFactors for CreditDefaultSwapOption
impl PricingRiskFactors for CreditDefaultSwapOption
§fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
§impl Product for CreditDefaultSwapOption
impl Product for CreditDefaultSwapOption
§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.