Record Class OvernightConvention

java.lang.Object
java.lang.Record
com.quantfinlib.rates.OvernightConvention
Record Components:
lookbackDays - business days of lookback (or shift), >= 0
observationShift - 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_j come 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 Details

    • IN_ARREARS

      public static final OvernightConvention 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

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • lookbackDays

      public int lookbackDays()
      Returns the value of the lookbackDays record component.
      Returns:
      the value of the lookbackDays record component
    • observationShift

      public boolean observationShift()
      Returns the value of the observationShift record component.
      Returns:
      the value of the observationShift record component
    • lockoutDays

      public int lockoutDays()
      Returns the value of the lockoutDays record component.
      Returns:
      the value of the lockoutDays record component