Record Class OisSwap
java.lang.Object
java.lang.Record
com.quantfinlib.rates.OisSwap
- All Implemented Interfaces:
CurveInstrument
public record OisSwap(LocalDate start, LocalDate end, double fixedRate, int paymentsPerYear, DayCount dayCount, BusinessCalendar calendar, BusinessCalendar.Roll roll)
extends Record
implements CurveInstrument
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).
Compounding the overnight rate over a period and discounting on the
same OIS curve telescopes: the floating leg is worth
P(start) - P(end). The par rate is therefore
K_par = (P(start) - P(t_n)) / sum_i tau_i P(t_i)
with tau from dayCount on the adjusted schedule from
BusinessCalendar.schedule(LocalDate, LocalDate, int, BusinessCalendar.Roll).
Only the discount curve enters; the projection argument is ignored.
-
Constructor Summary
ConstructorsConstructorDescriptionOisSwap(LocalDate start, LocalDate end, double fixedRate, int paymentsPerYear, DayCount dayCount, BusinessCalendar calendar, BusinessCalendar.Roll roll) Creates an instance of aOisSwaprecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleannuity(DiscountCurve discount) sum tau_i P(t_i)per unit notional.calendar()Returns the value of thecalendarrecord component.dayCount()Returns the value of thedayCountrecord component.end()Returns the value of theendrecord component.final booleanIndicates whether some other object is "equal to" this one.doubleReturns the value of thefixedRaterecord component.final inthashCode()Returns a hash code value for this object.doubleimpliedQuote(DiscountCurve discount, DiscountCurve projection) The quote implied by the curves, in the units ofCurveInstrument.quote().doubleparRate(DiscountCurve discount) The par fixed rate ondiscount.doublepayerPv(DiscountCurve discount) PV per unit notional of paying fixed, receiving the compounded overnight rate.Adjusted payment dates.intReturns the value of thepaymentsPerYearrecord component.The last date the instrument depends on; the bootstrap places a pillar there.doublequote()The market quote as a decimal rate (0.03 = 3%).roll()Returns the value of therollrecord component.start()Returns the value of thestartrecord component.final StringtoString()Returns a string representation of this record class.withQuote(double quote) The same instrument with a different quote (used for bump-and-rebuild risk).
-
Constructor Details
-
OisSwap
public OisSwap(LocalDate start, LocalDate end, double fixedRate, int paymentsPerYear, DayCount dayCount, BusinessCalendar calendar, BusinessCalendar.Roll roll) Creates an instance of aOisSwaprecord class.- Parameters:
start- the value for thestartrecord componentend- the value for theendrecord componentfixedRate- the value for thefixedRaterecord componentpaymentsPerYear- the value for thepaymentsPerYearrecord componentdayCount- the value for thedayCountrecord componentcalendar- the value for thecalendarrecord componentroll- the value for therollrecord component
-
-
Method Details
-
paymentDates
-
annuity
sum tau_i P(t_i)per unit notional. -
parRate
The par fixed rate ondiscount. -
payerPv
PV per unit notional of paying fixed, receiving the compounded overnight rate. -
pillarDate
Description copied from interface:CurveInstrumentThe last date the instrument depends on; the bootstrap places a pillar there.- Specified by:
pillarDatein interfaceCurveInstrument
-
quote
public double quote()Description copied from interface:CurveInstrumentThe market quote as a decimal rate (0.03 = 3%).- Specified by:
quotein interfaceCurveInstrument
-
withQuote
Description copied from interface:CurveInstrumentThe same instrument with a different quote (used for bump-and-rebuild risk).- Specified by:
withQuotein interfaceCurveInstrument
-
impliedQuote
Description copied from interface:CurveInstrumentThe quote implied by the curves, in the units ofCurveInstrument.quote().- Specified by:
impliedQuotein interfaceCurveInstrument
-
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
Returns the value of thestartrecord component.- Returns:
- the value of the
startrecord component
-
end
Returns the value of theendrecord component.- Returns:
- the value of the
endrecord component
-
fixedRate
public double fixedRate()Returns the value of thefixedRaterecord component.- Returns:
- the value of the
fixedRaterecord component
-
paymentsPerYear
public int paymentsPerYear()Returns the value of thepaymentsPerYearrecord component.- Returns:
- the value of the
paymentsPerYearrecord component
-
dayCount
Returns the value of thedayCountrecord component.- Returns:
- the value of the
dayCountrecord component
-
calendar
Returns the value of thecalendarrecord component.- Returns:
- the value of the
calendarrecord component
-
roll
Returns the value of therollrecord component.- Returns:
- the value of the
rollrecord component
-