Function overnight_leg
pub fn overnight_leg(
schedule: &Schedule,
terms: &LegTerms,
index: &str,
gearing: f64,
spread: f64,
calendar: &dyn Calendar,
index_day_count: DayCountFraction,
accumulation: AccrualCompounding,
) -> LegExpand description
Builds an overnight (RFR) floating leg over schedule, accumulating the
daily prints the way accumulation says.
Each period’s daily observation strip is enumerated once, here: one
observation per business day on calendar from accrual start to accrual
end, each spanning to the next business day (a Friday print applies over
the weekend) and capped at the period end, carrying its year fraction under
index_day_count — the index’s own basis, which need not equal the leg’s
accrual day count. Valuation then walks dates and never a calendar, and an
in-progress period blends realised prints with the projected remainder in
OvernightCoupon’s own projection.
The strip does not depend on the accumulation — the same observations, the same calendar, the same year fractions — so a compounded and an averaged leg over one schedule differ in exactly one line of arithmetic.