Record Class TermRateLeg
java.lang.Object
java.lang.Record
com.quantfinlib.rates.TermRateLeg
- Record Components:
start- unadjusted effective dateend- unadjusted maturityspread- spread over the index (simple)convention- schedule, day count, calendar and payment lagfixingLagDays- business days from fixing to accrual start,>= 0fixings- 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 Summary
ConstructorsConstructorDescriptionTermRateLeg(LocalDate start, LocalDate end, double spread, LegConvention convention, int fixingLagDays, FixingHistory fixings) Validates the fields. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconventionrecord component.doublecouponRate(LegConvention.Period period, DiscountCurve projection) The coupon rate (index rate plus spread) of one period, from published fixings where they exist and the projection curve otherwise.end()Returns the value of theendrecord component.final booleanIndicates whether some other object is "equal to" this one.fixingDate(LegConvention.Period period) The fixing date of a period:fixingLagDaysbusiness days before its accrual start.intReturns the value of thefixingLagDaysrecord component.fixings()Returns the value of thefixingsrecord component.final inthashCode()Returns a hash code value for this object.periods()The leg's accrual periods.doublespread()Returns the value of thespreadrecord component.start()Returns the value of thestartrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TermRateLeg
public TermRateLeg(LocalDate start, LocalDate end, double spread, LegConvention convention, int fixingLagDays, FixingHistory fixings) Validates the fields.
-
-
Method Details
-
periods
Description copied from interface:FloatLegThe leg's accrual periods. -
fixingDate
The fixing date of a period:fixingLagDaysbusiness days before its accrual start.- Parameters:
period- one ofperiods()- Returns:
- the fixing date
-
couponRate
Description copied from interface:FloatLegThe coupon rate (index rate plus spread) of one period, from published fixings where they exist and the projection curve otherwise.- Specified by:
couponRatein interfaceFloatLeg- Parameters:
period- one ofFloatLeg.periods()projection- projection curve (its valuation date is the valuation date)- Returns:
- the annualised coupon rate
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
start
-
end
-
spread
-
convention
Returns the value of theconventionrecord component.- Returns:
- the value of the
conventionrecord component
-
fixingLagDays
public int fixingLagDays()Returns the value of thefixingLagDaysrecord component.- Returns:
- the value of the
fixingLagDaysrecord component
-
fixings
-