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: StringTemplate name (doubles as registry code).
calendar: Arc<dyn Calendar>Coupon-leg calendar (weekend-only for standard CDS accrual).
business_day_convention: BusinessDayConventionBusiness-day convention.
day_count: DayCountFractionCoupon day-count.
frequency: FrequencyCoupon frequency.
date_generation: DateGenerationRuleSchedule date-generation rule (CDS).
roll: RollConventionCoupon roll (twentieth-IMM).
spot_lag: PeriodSpot 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: PeriodPayment 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: f64Standard 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: SeniorityThe 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: DocClauseThe 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
impl CdsTemplate
pub fn reference(
&self,
spelling: &str,
) -> Result<ReferenceEntity, CreditIdParseError>
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
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
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
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>
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
impl Clone for CdsTemplate
§fn clone(&self) -> CdsTemplate
fn clone(&self) -> CdsTemplate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more