Record Class Fra

java.lang.Object
java.lang.Record
com.quantfinlib.rates.Fra
All Implemented Interfaces:
CurveInstrument

public record Fra(LocalDate start, LocalDate end, double rate, DayCount dayCount) extends Record implements CurveInstrument
A forward rate agreement on the index period [start, end] at fixed rate rate. The FRA settles at start the discounted value of (L - K) * tau; its par rate is the projection forward L = (P_p(start)/P_p(end) - 1)/tau whatever the discount curve, because the settlement amount is discounted at the fixing itself (ISDA FRA discounting). Dates are taken as already adjusted.
  • Constructor Details

    • Fra

      public Fra(LocalDate start, LocalDate end, double rate, DayCount dayCount)
      Creates an instance of a Fra record class.
      Parameters:
      start - the value for the start record component
      end - the value for the end record component
      rate - the value for the rate record component
      dayCount - the value for the dayCount record component
  • Method Details

    • 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 Fra 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
    • rate

      public double rate()
      Returns the value of the rate record component.
      Returns:
      the value of the rate record component
    • dayCount

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