Record Class TermRateLeg

java.lang.Object
java.lang.Record
com.quantfinlib.rates.TermRateLeg
Record Components:
start - unadjusted effective date
end - unadjusted maturity
spread - spread over the index (simple)
convention - schedule, day count, calendar and payment lag
fixingLagDays - business days from fixing to accrual start, >= 0
fixings - published fixings of the index
All Implemented Interfaces:
FloatLeg

public record TermRateLeg(LocalDate start, LocalDate end, double spread, LegConvention convention, int fixingLagDays, FixingHistory fixings) extends Record implements FloatLeg
A term-rate floating leg (IBOR-style, or a term SOFR leg): each coupon is the index rate fixed fixingLagDays business days before the accrual start, plus a spread, paid with the leg's payment lag.

The index period is taken to be the accrual period (no index-tenor mismatch, the same simplification as InterestRateSwap). A coupon whose fixing date is before the valuation date uses the published fixing from FixingHistory; later ones use the projection forward (P_p(s)/P_p(e) - 1)/tau.

Worked example: with no fixing lag, no payment lag and the same schedule and day count as an InterestRateSwap floating leg, the PV equals InterestRateSwap.floatLegPv(DiscountCurve, DiscountCurve) (pinned in the tests).

  • Constructor Details

  • Method Details

    • periods

      public List<LegConvention.Period> periods()
      Description copied from interface: FloatLeg
      The leg's accrual periods.
      Specified by:
      periods in interface FloatLeg
      Returns:
      the periods, ascending
    • fixingDate

      public LocalDate fixingDate(LegConvention.Period period)
      The fixing date of a period: fixingLagDays business days before its accrual start.
      Parameters:
      period - one of periods()
      Returns:
      the fixing date
    • couponRate

      public double couponRate(LegConvention.Period period, DiscountCurve projection)
      Description copied from interface: FloatLeg
      The coupon rate (index rate plus spread) of one period, from published fixings where they exist and the projection curve otherwise.
      Specified by:
      couponRate in interface FloatLeg
      Parameters:
      period - one of FloatLeg.periods()
      projection - projection curve (its valuation date is the valuation date)
      Returns:
      the annualised coupon rate
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components 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.
    • start

      public LocalDate start()
      Returns the value of the start record component.
      Returns:
      the value of the start record component
    • end

      public LocalDate end()
      Returns the value of the end record component.
      Returns:
      the value of the end record component
    • spread

      public double spread()
      Returns the value of the spread record component.
      Returns:
      the value of the spread record component
    • convention

      public LegConvention convention()
      Returns the value of the convention record component.
      Returns:
      the value of the convention record component
    • fixingLagDays

      public int fixingLagDays()
      Returns the value of the fixingLagDays record component.
      Returns:
      the value of the fixingLagDays record component
    • fixings

      public FixingHistory fixings()
      Returns the value of the fixings record component.
      Returns:
      the value of the fixings record component