Struct XccyLegTemplate
pub struct XccyLegTemplate {Show 14 fields
pub currency: String,
pub calendar: Arc<dyn Calendar>,
pub day_count: DayCountFraction,
pub frequency: Frequency,
pub business_day_convention: BusinessDayConvention,
pub end_of_month: bool,
pub date_generation: DateGenerationRule,
pub pay_delay: Period,
pub fixing_lag: Period,
pub kind: XccyLegKind,
pub index_code: String,
pub index: Option<AnyIndex>,
pub projection: IborProjection,
pub fx: Option<LegFx>,
}Expand description
Per-leg conventions for a cross-currency swap leg.
Fields§
§currency: StringLeg currency (ISO 4217 code).
calendar: Arc<dyn Calendar>Leg calendar (often a joint calendar).
day_count: DayCountFractionLeg day-count.
frequency: FrequencyCoupon frequency (Frequency::Once for the zero-coupon case).
business_day_convention: BusinessDayConventionBusiness-day convention.
end_of_month: boolPer-leg end-of-month rule (can differ between legs).
date_generation: DateGenerationRuleSchedule date-generation direction.
pay_delay: PeriodPayment delay applied to this leg’s coupon payment dates.
No rate cut-off rides with it: the screens quote the OIS-compounded legs with a 1 BD cut-off, but on an overnight leg a cut-off is a lockout, which helixio prices without (§9 of the roadmap). A field here would document a convention the engine does not apply.
fixing_lag: PeriodFixing lag (0 BD on OIS legs and HKD HIBOR; 2 BD on other IBOR legs).
kind: XccyLegKindPer-leg rate-projection mechanism.
index_code: StringThe projection key the leg’s coupons reset against, by registry code
("USD-SOFR", "EUR-EURIBOR-3M"); empty on a fixed leg, which
projects nothing.
index: Option<AnyIndex>The index itself where the leg was stated on a value — a
constructed index the registry never carried — and None where
index_code names the registry. A swap built on the leg reads this
first.
projection: IborProjectionThe window an IBOR coupon reads its index over; ignored on an overnight or fixed leg.
fx: Option<LegFx>Where this leg’s FX fixing comes from, on a non-deliverable template
whose settlement currency is not this leg’s; None otherwise.
Implementations§
§impl XccyLegTemplate
impl XccyLegTemplate
pub fn on_index(index_code: &str) -> Result<Self, XccyTemplateError>
pub fn on_index(index_code: &str) -> Result<Self, XccyTemplateError>
A floating leg on the registered index index_code, in its currency
and on its conventions.
An overnight index gives a compounded leg: quarterly, Modified Following, end of month, backward, paying two days late, on the index’s day count and fixing calendar. An IBOR index gives a term leg paying at its own tenor, on its day count, calendar, business-day convention, end-of-month rule and fixing lag, with no payment delay. Every one of these can be overridden afterwards.
§Errors
XccyTemplateError for a code no registry entry carries, an index
that is neither overnight nor IBOR, or an IBOR tenor no leg pays on.
pub fn fixed(currency: &str) -> Result<Self, XccyTemplateError>
pub fn fixed(currency: &str) -> Result<Self, XccyTemplateError>
A fixed leg in currency: annual, ACT/365.FIXED, Modified Following
with end-of-month on the currency’s settlement centre, generated
backward, paying on the period end. Refine it with the builders.
§Errors
XccyTemplateError::NotALeg if currency is not a currency with a
settlement centre.
pub fn on(index: AnyIndex, code: &str) -> Result<Self, XccyTemplateError>
pub fn on(index: AnyIndex, code: &str) -> Result<Self, XccyTemplateError>
A floating leg on index itself, keyed under code: as
XccyLegTemplate::on_index, for an index the caller holds as a
value — one the registry may never have carried.
§Errors
XccyTemplateError for an index that is neither overnight nor
IBOR, or an IBOR tenor no leg pays on.
pub fn with_index(self, index_code: &str) -> Result<Self, XccyTemplateError>
pub fn with_index(self, index_code: &str) -> Result<Self, XccyTemplateError>
This leg projecting on the registered index_code instead, its kind
and currency taken from the new index and every other convention
kept.
The kind follows the index, so a leg cannot name an overnight index and project it as a term rate. A payment delay or fixing lag the old kind implied is not carried across: override it after if it matters.
§Errors
pub fn with(
self,
index: AnyIndex,
code: &str,
) -> Result<Self, XccyTemplateError>
pub fn with( self, index: AnyIndex, code: &str, ) -> Result<Self, XccyTemplateError>
This leg projecting on index itself, keyed under code, as
XccyLegTemplate::with_index.
§Errors
pub fn with_frequency(self, frequency: Frequency) -> Self
pub fn with_frequency(self, frequency: Frequency) -> Self
This leg paying at frequency.
pub fn with_day_count(self, day_count: DayCountFraction) -> Self
pub fn with_day_count(self, day_count: DayCountFraction) -> Self
This leg accruing on day_count.
pub fn with_calendar(self, calendar: Arc<dyn Calendar>) -> Self
pub fn with_calendar(self, calendar: Arc<dyn Calendar>) -> Self
This leg’s schedule and payments on calendar.
pub fn with_business_day_convention(
self,
convention: BusinessDayConvention,
) -> Self
pub fn with_business_day_convention( self, convention: BusinessDayConvention, ) -> Self
This leg’s schedule rolled under convention.
pub fn with_end_of_month(self, end_of_month: bool) -> Self
pub fn with_end_of_month(self, end_of_month: bool) -> Self
This leg with its end-of-month rule set.
pub fn with_date_generation(self, rule: DateGenerationRule) -> Self
pub fn with_date_generation(self, rule: DateGenerationRule) -> Self
This leg’s schedule generated in rule’s direction.
pub fn with_pay_delay(self, days_late: i32) -> Self
pub fn with_pay_delay(self, days_late: i32) -> Self
This leg paying days business days after each period ends.
pub fn with_projection(self, projection: IborProjection) -> Self
pub fn with_projection(self, projection: IborProjection) -> Self
This leg’s IBOR coupons reading their index over projection.
pub fn with_fixing_lag(self, days_before: i32) -> Self
pub fn with_fixing_lag(self, days_before: i32) -> Self
This leg fixing days business days before each period starts.
Trait Implementations§
§impl Clone for XccyLegTemplate
impl Clone for XccyLegTemplate
§fn clone(&self) -> XccyLegTemplate
fn clone(&self) -> XccyLegTemplate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more