Skip to main content

cashflow_records

Function cashflow_records 

pub fn cashflow_records<R: Scalar>(
    legs: &[&Leg],
    disc: &dyn YieldCurve<R>,
    curves: &dyn CurveByIndex<R>,
    fixings: &FixingsView<'_, R>,
    as_of: NaiveDate,
) -> Result<Records, CashflowError>
Expand description

One instrument’s cashflows as records: a row per coupon, over legs in the order the instrument declares them and coupons in payment order within each.

fwd projects the coupons that have not fixed; disc discounts every payment. A rate is read from fixings where its reset has passed, exactly as a valuation reads it — so a table and the value it explains cannot disagree about what a coupon pays.

§Errors

Whatever a coupon reports, and for the whole table: a missing historical fixing fails here rather than leaving one row’s rate projected or zeroed. A partial table with one silently-wrong number in it is worse than no table.