Record Class OvernightConvention
java.lang.Object
java.lang.Record
com.quantfinlib.rates.OvernightConvention
- Record Components:
lookbackDays- business days of lookback (or shift),>= 0observationShift- whether the lookback shifts the observation window (weights from it)lockoutDays- business days of lockout at the end of the period,>= 0
public record OvernightConvention(int lookbackDays, boolean observationShift, int lockoutDays)
extends Record
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.
The plain idea: the coupon for an accrual period is the daily-compounded overnight rate, but the payer needs to know the amount a few days before paying. Each convention buys that time differently.
- Lookback of L business days, no shift: accrual day i uses the
fixing published L business days earlier, weighted by the accrual
day's own calendar-day count
n_i. - Observation shift of L days: the whole observation window
moves back L business days, and both rates and weights
n_jcome from the shifted window; the compounded rate is annualised over the shifted window's days. - Lockout of k business days: the rates for the last k business days of the (observation) period are replaced by the rate of the day before them.
Formal statement, with d the day-count denominator of the leg
(360 for ACT/360, 365 for ACT/365F):
R = ( prod_i (1 + r_i n_i / d) - 1 ) * d / N, N = sum_i n_i coupon = (R + spread) * tau(accrualStart, accrualEnd)
Worked example: with no lookback, shift or lockout, no spread and
forecast fixings from a single curve P, the coupon times tau
telescopes to P(s)/P(e) - 1 (the identity the tests pin).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final OvernightConventionPlain compounding in arrears: no lookback, no shift, no lockout. -
Constructor Summary
ConstructorsConstructorDescriptionOvernightConvention(int lookbackDays, boolean observationShift, int lockoutDays) Validates the fields. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thelockoutDaysrecord component.intReturns the value of thelookbackDaysrecord component.booleanReturns the value of theobservationShiftrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
IN_ARREARS
Plain compounding in arrears: no lookback, no shift, no lockout.
-
-
Constructor Details
-
OvernightConvention
public OvernightConvention(int lookbackDays, boolean observationShift, int lockoutDays) Validates the fields.
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
lookbackDays
public int lookbackDays()Returns the value of thelookbackDaysrecord component.- Returns:
- the value of the
lookbackDaysrecord component
-
observationShift
public boolean observationShift()Returns the value of theobservationShiftrecord component.- Returns:
- the value of the
observationShiftrecord component
-
lockoutDays
public int lockoutDays()Returns the value of thelockoutDaysrecord component.- Returns:
- the value of the
lockoutDaysrecord component
-