Struct CreditLinkedNote
pub struct CreditLinkedNote {
pub cds: CreditDefaultSwap,
pub side: f64,
}Expand description
A credit-linked note: the funded single-name credit product.
The investor pays par at issue and is long credit: while the entity
survives they receive the fixed coupons and par at maturity; on default
the note redeems at recovery. The value reuses the CDS legs —
coupons + N·DF(T)·S(T) + protection·R/(1−R) — the premium leg being
the survival-weighted fixed leg, the protection integral rescaled from
(1−R) to R of face.
Fields§
§cds: CreditDefaultSwapThe underlying contract, built from the investor’s (protection seller’s) side with the note’s coupon as its running spread.
side: f64+1 for the investor, −1 for the issuer.
Implementations§
§impl CreditLinkedNote
impl CreditLinkedNote
pub fn standard(
template: &CdsTemplate,
trade_date: NaiveDate,
entity: impl Into<String>,
currency: Currency,
tenor_years: u32,
notional: f64,
coupon: f64,
) -> Self
pub fn standard( template: &CdsTemplate, trade_date: NaiveDate, entity: impl Into<String>, currency: Currency, tenor_years: u32, notional: f64, coupon: f64, ) -> Self
A standard note: the CDS2015 quarterly schedule from the trade date at
coupon, floating recovery, investor perspective.
pub fn standard_maturing(
template: &CdsTemplate,
trade_date: NaiveDate,
entity: impl Into<String>,
currency: Currency,
maturity: NaiveDate,
notional: f64,
coupon: f64,
) -> Self
pub fn standard_maturing( template: &CdsTemplate, trade_date: NaiveDate, entity: impl Into<String>, currency: Currency, maturity: NaiveDate, notional: f64, coupon: f64, ) -> Self
standard with the maturity supplied directly.
The pair mirrors CreditDefaultSwap::standard and its twin.
pub fn standard_on(
template: &CdsTemplate,
trade_date: NaiveDate,
credit: CreditCurveId,
currency: Currency,
maturity: NaiveDate,
notional: f64,
coupon: f64,
) -> Self
pub fn standard_on( template: &CdsTemplate, trade_date: NaiveDate, credit: CreditCurveId, currency: Currency, maturity: NaiveDate, notional: f64, coupon: f64, ) -> Self
The standard note on credit — a stated identity, so a subordinated
name or another documentation clause is built rather than assigned
afterwards, as CreditDefaultSwap::standard_on builds the swap.
pub fn issued(self) -> Self
pub fn issued(self) -> Self
The issuer’s side.
pub fn with_fixed_recovery(self, recovery: f64) -> Self
pub fn with_fixed_recovery(self, recovery: f64) -> Self
Locks a contractual recovery on the note.
pub fn credit(&self) -> &CreditCurveId
pub fn credit(&self) -> &CreditCurveId
The credit the note is valued on.
§impl CreditLinkedNote
impl CreditLinkedNote
pub fn components<R: Scalar>(
&self,
view: &PricingView<'_, R>,
) -> Result<(R, R, R), PricingError>
pub fn components<R: Scalar>( &self, view: &PricingView<'_, R>, ) -> Result<(R, R, R), PricingError>
The investor’s three components: survival-weighted coupons, the survival-weighted par redemption, and recovery of face on default.
§Errors
Whatever the underlying contract’s legs report.
Trait Implementations§
§impl Clone for CreditLinkedNote
impl Clone for CreditLinkedNote
§fn clone(&self) -> CreditLinkedNote
fn clone(&self) -> CreditLinkedNote
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 CreditLinkedNote
impl Debug for CreditLinkedNote
§impl PartialEq for CreditLinkedNote
impl PartialEq for CreditLinkedNote
§fn eq(&self, other: &CreditLinkedNote) -> bool
fn eq(&self, other: &CreditLinkedNote) -> bool
self and other values to be equal, and is used by ==.§impl<R: Scalar> Priceable<R> for CreditLinkedNote
impl<R: Scalar> Priceable<R> for CreditLinkedNote
§fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
coupons + redemption + recovery, signed by side.
§fn par_rate(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_rate(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
The note’s natural rate is its coupon.
§fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
§impl PricingRiskFactors for CreditLinkedNote
impl PricingRiskFactors for CreditLinkedNote
§fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
§impl Product for CreditLinkedNote
impl Product for CreditLinkedNote
§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.