Class Ndf

java.lang.Object
com.quantfinlib.fx.Ndf

public final class Ndf extends Object
A non-deliverable forward: the FX forward for restricted currencies (INR, KRW, TWD, BRL, CNY, ...) where the local currency never moves. The trade cash-settles in the deliverable (usually USD, the base) currency against an official fixing published before settlement.

Two dates matter, and they differ:

  • Fixing date — when the official reference rate (e.g. the RBI INR reference rate, KFTC18 for KRW, PTAX for BRL) is observed. It precedes settlement by the restricted currency's fixing lag — typically two local business days, one for BRL/PTAX.
  • Settlement date — when the USD difference amount pays.

Settlement to the buyer of base currency (long USD in USDINR), paid in base currency, is the market-standard formula

   amount = baseNotional × (fixing − contractRate) / fixing

— the division by the fixing converts the quote-currency difference back into deliverable currency. Pricing is ordinary forward machinery (SwapPointsCurve) plus these conventions, which is why NDF desks quote points just like deliverable forwards.

  • Method Summary

    Modifier and Type
    Method
    Description
    double
     
    double
     
     
    static int
    The fixing lag this library books for a restricted currency code.
    double
    Undiscounted mark-to-market in base currency: the settlement formula evaluated at the curve's forward to the fixing date — the date the payoff actually references.
    double
    markToMarket(SwapPointsCurve current, YieldCurve baseDiscount)
    Discounted mark-to-market: the expected settlement discounted from the settlement date on a base-currency (USD) zero curve, ACT/365 from the curve's spot.
    static Ndf
    of(CurrencyPair pair, double baseNotional, double contractRate, LocalDate fixingDate, LocalDate settlementDate)
    Explicit dates (broken dates, historical bookings).
    static Ndf
    of(CurrencyPair pair, LocalDate tradeDate, String tenor, double contractRate, double baseNotional)
    Books an NDF at a market tenor: settlement from the pair's tenor arithmetic, fixing walked back by the restricted (quote) currency's lag counted in local (quote-calendar) business days — the market convention: an RBI/KFTC/PTAX fixing publishes on its local business days regardless of USD holidays.
     
    double
    settlementAmount(double fixingRate)
    Cash settlement in base (deliverable) currency once the official fixing publishes.
     
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Method Details

    • of

      public static Ndf of(CurrencyPair pair, LocalDate tradeDate, String tenor, double contractRate, double baseNotional)
      Books an NDF at a market tenor: settlement from the pair's tenor arithmetic, fixing walked back by the restricted (quote) currency's lag counted in local (quote-calendar) business days — the market convention: an RBI/KFTC/PTAX fixing publishes on its local business days regardless of USD holidays. Pass real holiday calendars via CurrencyPair.withCalendars(com.quantfinlib.rates.BusinessCalendar, com.quantfinlib.rates.BusinessCalendar) for production dates.
    • of

      public static Ndf of(CurrencyPair pair, double baseNotional, double contractRate, LocalDate fixingDate, LocalDate settlementDate)
      Explicit dates (broken dates, historical bookings).
    • fixingLagDays

      public static int fixingLagDays(String currency)
      The fixing lag this library books for a restricted currency code.
    • settlementAmount

      public double settlementAmount(double fixingRate)
      Cash settlement in base (deliverable) currency once the official fixing publishes. Positive pays the base buyer.
    • markToMarket

      public double markToMarket(SwapPointsCurve current)
      Undiscounted mark-to-market in base currency: the settlement formula evaluated at the curve's forward to the fixing date — the date the payoff actually references.

      An NDF inside its fixing window (fixing date at or before the curve's spot date) has no forward to read — the curve starts at spot. The best curve-only estimate of an imminent or just-published fixing is the spot outright, so the mark degrades to that instead of throwing mid-lifecycle (an aged FxSwap leg gets the same keep-marking treatment). Once the official fixing prints, the right number is settlementAmount(double) with the actual fixing — a curve cannot know it.

    • markToMarket

      public double markToMarket(SwapPointsCurve current, YieldCurve baseDiscount)
      Discounted mark-to-market: the expected settlement discounted from the settlement date on a base-currency (USD) zero curve, ACT/365 from the curve's spot.
    • pair

      public CurrencyPair pair()
    • baseNotional

      public double baseNotional()
    • contractRate

      public double contractRate()
    • fixingDate

      public LocalDate fixingDate()
    • settlementDate

      public LocalDate settlementDate()
    • toString

      public String toString()
      Overrides:
      toString in class Object