Package com.quantfinlib.rates
@NullMarked
package com.quantfinlib.rates
Fixed income: curves, bonds, swaps, day counts and calendars, with
market conventions. The main classes:
YieldCurve (zero curve, discount factors,
implied forwards, bootstrap from annual par swaps),
BondPricer (price/yield, duration, convexity,
DV01; both whole-period and date-based with accrued interest),
DayCount (ACT/360, ACT/365, 30/360,
ACT/ACT ISDA), BusinessCalendar
(holidays, roll conventions, T+n settlement, coupon schedules) with
rule-based market calendars in HolidayCalendars,
ShortRateModels (Vasicek, CIR and
curve-fitted Hull-White: closed-form zero-coupon bonds plus the
simulation steps a rates-factor Monte Carlo needs) and
KeyRateDurations (where on the curve a
bond's DV01 lives — per-node bumps whose slices sum back to the
parallel move, tested).-
ClassDescriptionFixed-coupon bond analytics: price/yield conversion, Macaulay and modified duration, convexity, and DV01.Bucketed curve risk from the analytic Jacobian of the bootstrap, instead of bumping each quote and rebuilding the curves (
MultiCurveRisk).Business-day calendar: weekends plus a holiday set, with the standard roll conventions, settlement-lag arithmetic, and coupon schedule generation.Date roll conventions for payment dates landing on non-business days.Where an irregular (stub) period goes when the dates do not divide into whole periods (ISDA 2006 definitions, section 4.14 and market practice).A quoted market instrument aMultiCurveBootstrapfits a curve to.How aDiscountCurvefills in between its pillars.A discount curve (OIS) and the projection curve of one index, as built byMultiCurveRisk.buildCurves(LocalDate, List, List, CurveInterpolation).Day-count conventions: the year fraction between two dates as real term sheets define it — because finance never agreed on how long a year is, and the disagreement is worth real money.A cash deposit over[start, end]at simple raterate:1at start grows to1 + rate * tauat end, tau fromdayCount.A dated discount curveP(t)built from pillar discount factors: the object both an OIS discount curve and a projection curve (for example a 3M forwarding curve, a pseudo-discount curve whose ratios give the index forwards) are made of.The fixed leg of aVanillaSwap: couponsrate * tau_ipaid on each period's payment date, with the schedule, day count, stub and payment lag from aLegConvention.Published fixings of one index (for example SOFR), by fixing date.The floating leg of aVanillaSwap: either a compounded overnight leg (OvernightLeg, SOFR-style) or a term-rate leg (TermRateLeg, IBOR-style).A forward rate agreement on the index period[start, end]at fixed raterate.Rule-based holiday calendars for four settlement centres, generated asBusinessCalendarobjects for a range of years.The settlement centres with rule-based calendars.A vanilla fixed-for-floating interest rate swap in the multi-curve framework: the floating coupons are projected off a projection curve (for example 3M) and both legs are discounted on the OIS curve (collateralised pricing; Bianchetti 2010, "Two curves, one price", Risk 23(8); Ametrano and Bianchetti 2013, "Everything you always wanted to know about multiple interest rate curve bootstrapping but were afraid to ask", SSRN 2219548).Key-rate durations: where on the curve a bond's rate risk lives.The schedule and accrual conventions of one swap leg: how often it pays, how a period's year fraction is measured, which calendar and roll adjust the dates, where a stub goes, and how many business days after the accrual end the payment is made.One accrual period.Multi-curve bootstrap: an OIS discount curve fitted to its own instruments, then projection curves (3M, 6M, ...) fitted with the OIS curve held fixed for discounting (Ametrano and Bianchetti 2013, SSRN 2219548, sections 3-4).Curve risk on a bootstrapped OIS + projection curve pair by bumping the market quotes and rebuilding: the sensitivities a desk hedges with, because they are expressed in the instruments it can trade.Nelson-Siegel yield-curve fit — the parametric answer to "what shape is the curve", whereYieldCurveis the exact-repricing answer to "what IS the curve".Fitted parameters plus the fit's root-mean-square error.An overnight indexed swap: fixed rate against the daily-compounded overnight rate (SOFR, ESTR, SONIA), same schedule on both legs, payment on the accrual end date (no payment lag).How a compounded-in-arrears overnight coupon (SOFR, ESTR, SONIA) reads its daily fixings: lookback, observation shift and lockout, as described in the ISDA 2021 Interest Rate Derivatives Definitions (section 6.9, overnight rate compounding) and the ARRC SOFR conventions.A compounded-in-arrears overnight floating leg (SOFR, ESTR, SONIA) with payment lag, lookback, observation shift, lockout, stubs and realised fixings for seasoned trades.A short-term interest rate future (3M SOFR/Euribor style) on the index period[start, end], quoted by its futures raterate = (100 - price)/100.Rates volatility products priced off the curve: the bridge betweenYieldCurve(where forwards and discount factors live) and the option models on a forward rate,pricing.Black76(lognormal and shifted lognormal) andpricing.Bachelier(normal).A vol type together with its displacement (0 unless shifted lognormal).Which vol a quote is: lognormal (Black-76), shifted lognormal (Black-76 on forward + shift and strike + shift) or normal (Bachelier).The three classic short-rate models, each answering "what is a zero-coupon bond worth if the short rate follows this SDE?"Svensson (Nelson-Siegel-Svensson) yield-curve fit —NelsonSiegelwith a second curvature hump, the form most central banks actually publish (the ECB's daily curve is exactly this):Fitted parameters plus the fit's root-mean-square error.A term-rate floating leg (IBOR-style, or a term SOFR leg): each coupon is the index rate fixedfixingLagDaysbusiness days before the accrual start, plus a spread, paid with the leg's payment lag.A fixed-for-floating swap built from two convention-driven legs: the replacement for the single-curve, annual,tau = 1methods of theSwapPricer(removed in 4.0).Zero-coupon yield curve.