Class Ndf
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 TypeMethodDescriptiondoubledoublestatic intfixingLagDays(String currency) The fixing lag this library books for a restricted currency code.doublemarkToMarket(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.doublemarkToMarket(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 Ndfof(CurrencyPair pair, double baseNotional, double contractRate, LocalDate fixingDate, LocalDate settlementDate) Explicit dates (broken dates, historical bookings).static Ndfof(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.pair()doublesettlementAmount(double fixingRate) Cash settlement in base (deliverable) currency once the official fixing publishes.toString()
-
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 viaCurrencyPair.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
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
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
FxSwapleg gets the same keep-marking treatment). Once the official fixing prints, the right number issettlementAmount(double)with the actual fixing — a curve cannot know it. -
markToMarket
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
-
baseNotional
public double baseNotional() -
contractRate
public double contractRate() -
fixingDate
-
settlementDate
-
toString
-