Skip to main content

CreditDefaultSwapOption

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: CreditDefaultSwap

The CDS the option exercises into.

§expiry: NaiveDate

The exercise date.

§strike: f64

The strike spread, as a decimal.

§kind: SwaptionKind

A payer (the right to buy protection) or a receiver.

§short: bool

The seller’s side: the holder’s value negated.

§style: CdsOptionStyle

What a default before expiry does, and how the option is priced.

§strike_type: CdsStrikeType

How strike is quoted: a spread, or the price the holder enters at.

Implementations§

§

impl CreditDefaultSwapOption

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>

Read strike as a price per unit notional.

§Errors

CreditDefaultSwapOptionError::PriceStrikeNeedsIndex off the index style.

§

impl CreditDefaultSwapOption

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>

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

§

fn clone(&self) -> CreditDefaultSwapOption

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 CreditDefaultSwapOption

§

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

Formats the value using the given formatter. Read more
§

impl PartialEq for CreditDefaultSwapOption

§

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

§

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>

The par rate — the fixed rate at which the product is worth nothing. Read more
§

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 CreditDefaultSwapOption

§

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

The market data this product is priced against. Read more
§

impl Product for CreditDefaultSwapOption

§

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 CreditDefaultSwapOption

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.