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 Details

    • OisSwap

      public OisSwap(LocalDate start, LocalDate end, double fixedRate, int paymentsPerYear, DayCount dayCount, BusinessCalendar calendar, BusinessCalendar.Roll roll)
      Creates an instance of a OisSwap record class.
      Parameters:
      start - the value for the start record component
      end - the value for the end record component
      fixedRate - the value for the fixedRate record component
      paymentsPerYear - the value for the paymentsPerYear record component
      dayCount - the value for the dayCount record component
      calendar - the value for the calendar record component
      roll - the value for the roll record component
  • Method Details

    • paymentDates

      public List<LocalDate> paymentDates()
      Adjusted payment dates.
    • annuity

      public double annuity(DiscountCurve discount)
      sum tau_i P(t_i) per unit notional.
    • parRate

      public double parRate(DiscountCurve discount)
      The par fixed rate on discount.
    • payerPv

      public double payerPv(DiscountCurve discount)
      PV per unit notional of paying fixed, receiving the compounded overnight rate.
    • pillarDate

      public LocalDate pillarDate()
      Description copied from interface: CurveInstrument
      The last date the instrument depends on; the bootstrap places a pillar there.
      Specified by:
      pillarDate in interface CurveInstrument
    • quote

      public double quote()
      Description copied from interface: CurveInstrument
      The market quote as a decimal rate (0.03 = 3%).
      Specified by:
      quote in interface CurveInstrument
    • withQuote

      public OisSwap withQuote(double quote)
      Description copied from interface: CurveInstrument
      The same instrument with a different quote (used for bump-and-rebuild risk).
      Specified by:
      withQuote in interface CurveInstrument
    • impliedQuote

      public double impliedQuote(DiscountCurve discount, DiscountCurve projection)
      Description copied from interface: CurveInstrument
      The quote implied by the curves, in the units of CurveInstrument.quote().
      Specified by:
      impliedQuote in interface CurveInstrument
    • 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
    • fixedRate

      public double fixedRate()
      Returns the value of the fixedRate record component.
      Returns:
      the value of the fixedRate record component
    • paymentsPerYear

      public int paymentsPerYear()
      Returns the value of the paymentsPerYear record component.
      Returns:
      the value of the paymentsPerYear record component
    • dayCount

      public DayCount dayCount()
      Returns the value of the dayCount record component.
      Returns:
      the value of the dayCount record component
    • calendar

      public BusinessCalendar calendar()
      Returns the value of the calendar record component.
      Returns:
      the value of the calendar record component
    • roll

      public BusinessCalendar.Roll roll()
      Returns the value of the roll record component.
      Returns:
      the value of the roll record component