Class SwapPointsCurve

java.lang.Object
com.quantfinlib.fx.SwapPointsCurve

public final class SwapPointsCurve extends Object
FX forward (swap-points) curve: the market's quoted forward points per tenor, turned into outright forwards for any settlement date.

Forward FX does not trade as outright prices — it trades as points (pips to add to spot) at standard tenors (ON, 1W, 1M, 3M, ...). This class stores the pillar dates resolved through CurrencyPair.tenorDate(java.time.LocalDate, java.lang.String) (so modified-following / end-end are already applied) and interpolates points linearly in actual days between pillars — the interbank convention for broken dates. Beyond the last pillar it extrapolates the slope of the final segment; before the first pillar it interpolates from zero points at spot.

Covered interest parity connects the curve to rates: with continuously compounded rates, F = S * exp((r_quote - r_base) * tau). The impliedCarry(java.time.LocalDate) accessor inverts that, giving the rate differential the points imply — the bridge to rates.YieldCurve bootstrapping and the input NDF pricing needs for restricted currencies.

The curve is immutable after SwapPointsCurve.Builder.build(); lookups are allocation-free (binary search over primitive arrays), so a pricing loop can call outright(java.time.LocalDate) per tick if needed.

  • Method Details

    • builder

      public static SwapPointsCurve.Builder builder(CurrencyPair pair, LocalDate tradeDate, double spotRate)
    • forwardPoints

      public double forwardPoints(LocalDate valueDate)
      Interpolated forward points (price terms) for a settlement date: linear in actual days, anchored at zero on the spot date.
    • outright

      public double outright(LocalDate valueDate)
      Outright forward: spot plus interpolated points.
    • outright

      public double outright(String tenor)
      Outright forward for a market tenor of this curve's pair.
    • impliedCarry

      public double impliedCarry(LocalDate valueDate)
      Continuously compounded rate differential (quote minus base) implied by covered interest parity at a date: ln(F/S) / tau, ACT/365. Positive when the quote currency yields more (points ascending).
    • spotDate

      public LocalDate spotDate()
      The spot settlement date all pillar offsets are measured from.
    • spotRate

      public double spotRate()
    • pair

      public CurrencyPair pair()
    • pillarTenors

      public String[] pillarTenors()
      Pillar tenors in date order (diagnostics/reporting).