Struct OisTemplate
pub struct OisTemplate {Show 18 fields
pub name: String,
pub fixed_day_count: DayCountFraction,
pub fixed_frequency: Frequency,
pub index: OvernightIndex,
pub calendar: Arc<dyn Calendar>,
pub business_day_convention: BusinessDayConvention,
pub roll: RollConvention,
pub spot_lag: Period,
pub payment_lag: Period,
pub payment_calendar: Option<Arc<dyn Calendar>>,
pub payment_convention: Option<BusinessDayConvention>,
pub float_payment_convention: Option<BusinessDayConvention>,
pub float_payment_lag: Option<Period>,
pub float_payment_calendar: Option<Arc<dyn Calendar>>,
pub end_of_month: bool,
pub date_generation: DateGenerationRule,
pub stated_date_generation: Option<DateGenerationRule>,
pub accumulation: AccrualCompounding,
}Expand description
The conventions of a standard overnight-indexed swap (fixed vs compounded RFR).
Fields§
§name: StringTemplate name.
fixed_day_count: DayCountFractionFixed-leg day-count.
fixed_frequency: FrequencyFixed-leg frequency.
index: OvernightIndexThe overnight index of the floating leg.
calendar: Arc<dyn Calendar>Schedule calendar.
business_day_convention: BusinessDayConventionBusiness-day convention.
roll: RollConventionRoll convention.
spot_lag: PeriodSpot lag: valuation → default effective date (a Day-unit lag is resolved
in business days at spot time).
payment_lag: PeriodPayment lag: accrual end → coupon pay date, in business days on the payment calendar (zero ⇒ pay at accrual end, the pre-lag behavior). The standard market convention for e.g. USD SOFR OIS is 2bd.
payment_calendar: Option<Arc<dyn Calendar>>Calendar the payment lag rolls on; None defaults to the schedule
calendar (the common case; keeping them separate preserves the seam for
conventions whose payment calendar differs from the schedule’s).
payment_convention: Option<BusinessDayConvention>Business-day convention the payment date rolls under, separate from
the convention the schedule is generated with. None — every template
the registry carries — leaves the payment on the unadjusted accrual end.
A payment lag above zero already lands on a business day, so a convention named beside one has no further effect.
float_payment_convention: Option<BusinessDayConvention>The convention, lag and calendar the floating leg’s payments roll under, where that side follows a different market’s agreement.
None means inherit the single value above, not use the default:
an unset floating side follows whatever the fixed side was given, which
is what keeps with_payment_convention setting both sides as it always
has. Every registered template leaves all three
unset, so both legs pay alike unless a caller says otherwise.
float_payment_lag: Option<Period>The floating leg’s own payment lag; None inherits payment_lag.
float_payment_calendar: Option<Arc<dyn Calendar>>The floating leg’s own payment calendar; None inherits whatever
payment_calendar resolves to.
end_of_month: boolWhether schedule boundaries snap to month-ends.
date_generation: DateGenerationRuleSchedule date-generation direction.
stated_date_generation: Option<DateGenerationRule>The direction a caller stated with with_date_generation, which the
swap builder honours: Backward puts any stub at the front. None on
every registered template, which builds forward as it always has;
date_generation above is the registered declaration the builder
does not yet read.
accumulation: AccrualCompoundingHow the floating leg’s daily prints combine into a coupon rate.
This belongs to the template, not to the index. USD EFFR is quoted both ways — the standard Fed Funds OIS averages, while a compounded EFFR leg trades as the other side of a basis — so an index cannot say which convention a swap on it follows. A template can, because that is what a template is: one market’s agreement about one instrument.
Implementations§
§impl OisTemplate
impl OisTemplate
pub fn with_spot_lag(self, days: i32) -> Self
pub fn with_spot_lag(self, days: i32) -> Self
Overrides the spot lag (business 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).
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 with_payment_convention(self, convention: BusinessDayConvention) -> Self
pub fn with_payment_convention(self, convention: BusinessDayConvention) -> Self
Rolls the payment date under convention, separate from the schedule’s
own — a payment convention, which the street applies with a lag of
zero.
pub fn with_business_day_convention(
self,
convention: BusinessDayConvention,
) -> Self
pub fn with_business_day_convention( self, convention: BusinessDayConvention, ) -> Self
Generates the schedule under convention, rather than the registered
one.
Unadjusted, the accrual boundaries stay on their unadjusted dates,
which is what makes with_payment_convention
observable: a schedule rolled by its own convention has no weekend
boundary left for a payment to move. The pair — unadjusted accrual,
rolled payment — is the one the street books.
pub fn with_date_generation(self, rule: DateGenerationRule) -> Self
pub fn with_date_generation(self, rule: DateGenerationRule) -> Self
Generates in rule’s direction — Backward from the termination
with any stub at the front — rather than forward as every registered
template builds.
pub fn with_calendar(self, calendar: Arc<dyn Calendar>) -> Self
pub fn with_calendar(self, calendar: Arc<dyn Calendar>) -> Self
Generates on calendar rather than the registered business centres —
FpML’s businessCenters stated per trade. A payment lag with no
payment calendar of its own rolls on it too.
pub fn with_roll_convention(self, roll: RollConvention) -> Self
pub fn with_roll_convention(self, roll: RollConvention) -> Self
Rolls interior boundaries under roll rather than the registered roll
— FpML’s rollConvention stated per trade (a day of the month, EOM,
IMM).
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.
pub fn with_float_payment_convention(
self,
convention: BusinessDayConvention,
) -> Self
pub fn with_float_payment_convention( self, convention: BusinessDayConvention, ) -> Self
Rolls the floating leg’s payments under convention, leaving the
fixed leg on whatever with_payment_convention set — the shape a swap
needs when each side follows its own market.
pub fn with_float_payment_lag(self, days: i32) -> Self
pub fn with_float_payment_lag(self, days: i32) -> Self
Gives the floating leg its own payment lag in business days, leaving the fixed leg on the shared one.
pub fn with_float_payment_calendar(self, calendar: Arc<dyn Calendar>) -> Self
pub fn with_float_payment_calendar(self, calendar: Arc<dyn Calendar>) -> Self
Gives the floating leg its own payment calendar, leaving the fixed leg on the shared one.
The floating leg’s payment calendar: its own when set, else whatever the shared one resolves to.
The floating leg’s payment lag: its own when set, else the shared one.
pub fn effective_date(&self, valuation: NaiveDate) -> NaiveDate
pub fn effective_date(&self, valuation: NaiveDate) -> NaiveDate
The default effective date for a swap booked off this template as of
valuation: the spot lag applied through spot_effective_date — the
same resolution Product.build_in performs.
Trait Implementations§
§impl Clone for OisTemplate
impl Clone for OisTemplate
§fn clone(&self) -> OisTemplate
fn clone(&self) -> OisTemplate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more