Skip to main content

CdsTemplate

Struct CdsTemplate 

pub struct CdsTemplate {
Show 13 fields pub name: String, pub calendar: Arc<dyn Calendar>, pub business_day_convention: BusinessDayConvention, pub day_count: DayCountFraction, pub frequency: Frequency, pub date_generation: DateGenerationRule, pub roll: RollConvention, pub spot_lag: Period, pub payment_lag: Period, pub payment_calendar: Option<Arc<dyn Calendar>>, pub standard_coupon: f64, pub seniority: Seniority, pub doc_clause: DocClause,
}
Expand description

The conventions of a standard credit default swap.

Fields§

§name: String

Template name (doubles as registry code).

§calendar: Arc<dyn Calendar>

Coupon-leg calendar (weekend-only for standard CDS accrual).

§business_day_convention: BusinessDayConvention

Business-day convention.

§day_count: DayCountFraction

Coupon day-count.

§frequency: Frequency

Coupon frequency.

§date_generation: DateGenerationRule

Schedule date-generation rule (CDS).

§roll: RollConvention

Coupon roll (twentieth-IMM).

§spot_lag: Period

Spot lag to the step-in date — the first day of protection — in calendar days, as the ISDA standard model counts it: one for the standard contract, so a Friday trade is protected from the Saturday.

§payment_lag: Period

Payment lag: accrual end → coupon pay date, in business days on the payment calendar. Standard CDS pay at accrual end (zero lag); the field exists for non-standard bilateral terms.

§payment_calendar: Option<Arc<dyn Calendar>>

Calendar the payment lag rolls on; None defaults to the schedule calendar.

§standard_coupon: f64

Standard fixed running coupon (decimal), the CDS2015 trading convention (e.g. 100bp for IG). A built CDS defaults to this coupon plus an upfront, rather than being struck at par.

§seniority: Seniority

The seniority a standard contract on this template references — senior unsecured for every shipped template. Required: the identity a contract is keyed by carries no default, so the template states it.

§doc_clause: DocClause

The documentation clause a standard contract on this template trades under: XR14 for the North American standard, MM14 for the European. Required, for the same reason.

Implementations§

§

impl CdsTemplate

pub fn reference( &self, spelling: &str, ) -> Result<ReferenceEntity, CreditIdParseError>

The reference entity a contract on this template names by spelling: a full ENTITY/SENIORITY/DOCCLAUSE spelling as given, or a bare entity on this template’s standard seniority and documentation clause — the template, not the identity, carries the default.

§Errors

CreditIdParseError for a full spelling that does not parse.

pub fn with_spot_lag(self, days: i32) -> Self

Overrides the spot lag to the step-in date (calendar days) — builder-style, for booking a non-standard convention set off a built-in template.

pub fn with_payment_lag(self, days: i32) -> Self

Overrides the payment lag (business days). Standard CDS pay at accrual end (zero lag); nonzero expresses non-standard bilateral terms.

pub fn with_payment_calendar(self, calendar: Arc<dyn Calendar>) -> Self

Overrides the calendar the payment lag rolls on (default: the schedule calendar).

pub fn payment_calendar_or_schedule(&self) -> Arc<dyn Calendar>

The calendar the payment lag rolls on: the explicit payment calendar when set, else the schedule calendar.

Trait Implementations§

§

impl Clone for CdsTemplate

§

fn clone(&self) -> CdsTemplate

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 From<CdsTemplate> for AnyTemplate

§

fn from(t: CdsTemplate) -> Self

Converts to this type from the input type.

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.