Record Class RateFuture

java.lang.Object
java.lang.Record
com.quantfinlib.rates.RateFuture
Record Components:
meanReversion - Hull-White a, per year, >= 0
sigma - Hull-White short-rate volatility (absolute, per sqrt year), >= 0
All Implemented Interfaces:
CurveInstrument

public record RateFuture(LocalDate start, LocalDate end, double rate, DayCount dayCount, double meanReversion, double sigma) extends Record implements CurveInstrument
A short-term interest rate future (3M SOFR/Euribor style) on the index period [start, end], quoted by its futures rate rate = (100 - price)/100.

Futures are margined daily, so the futures rate exceeds the forward rate by a convexity adjustment. Under the Hull-White one-factor model dr = (theta(t) - a r) dt + sigma dW the adjustment between the continuously compounded futures and forward rates over [t1, t2] is (Hull, Options, Futures and Other Derivatives, 10th ed. 2018, Technical Note 1; Kirikos and Novak 1997, "Convexity conundrums", Risk 10(3)):

  futures_cc - forward_cc = B(t1,t2)/(t2-t1) * [ B(t1,t2)(1 - e^{-2 a t1}) + 2 a B(0,t1)^2 ] * sigma^2 / (4a)
  B(s,u) = (1 - e^{-a(u-s)}) / a

with the Ho-Lee limit sigma^2 t1 t2 / 2 as a -> 0 (Hull 2018, section 6.3), used when meanReversion == 0. Following Hull, the adjustment is applied to continuously compounded rates over the curve's time axis: the implied futures rate is (exp((f_cc + CA)(t2 - t1)) - 1)/tau, f_cc the projection curve's average forward over [t1, t2] and tau from the day count. Set sigma = 0 for no adjustment.

  • Constructor Details

    • RateFuture

      public RateFuture(LocalDate start, LocalDate end, double rate, DayCount dayCount, double meanReversion, double sigma)
      Creates an instance of a RateFuture 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
      meanReversion - the value for the meanReversion record component
      sigma - the value for the sigma record component
  • Method Details

    • ofPrice

      public static RateFuture ofPrice(LocalDate start, LocalDate end, double price, DayCount dayCount, double meanReversion, double sigma)
      From an exchange price, rate = (100 - price)/100.
    • hullWhiteConvexity

      public static double hullWhiteConvexity(double t1, double t2, double meanReversion, double sigma)
      Hull-White convexity adjustment (continuously compounded futures minus forward rate) for an index period from t1 to t2 years.
    • convexityAdjustment

      public double convexityAdjustment(DiscountCurve curve)
      This future's adjustment on the curve's time axis.
    • 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 RateFuture 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
    • meanReversion

      public double meanReversion()
      Returns the value of the meanReversion record component.
      Returns:
      the value of the meanReversion record component
    • sigma

      public double sigma()
      Returns the value of the sigma record component.
      Returns:
      the value of the sigma record component