Package com.quantfinlib.fx
@NullMarked
package com.quantfinlib.fx
FX market conventions and instruments, from spot dates to NDFs. The
main classes:
CurrencyPair (pip/precision tables, T+1/T+2
spot lags, dual-calendar tenor dates with modified-following and end-end),
SwapPointsCurve (quoted forward points →
outrights, broken dates linear in days, covered-interest-parity carry),
FxSwap (near/far legs, points MTM, roll cost),
Ndf (fixing vs settlement lags per restricted
currency, USD-settled difference amounts),
FxVolSurface (delta-quoted smiles — ATM DNS,
RR/BF wings, premium-adjusted delta↔strike solving),
FixingRisk (WM/R-window TWAP/VWAP tracking
error and participation), and the hot-path pieces:
marketdata.AggregatedBook (lowlatency since 4.0) (zero-alloc multi-venue BBO
with venue attribution) (the streaming cross-rate engine, which runs on
the market-data bus, moved to marketdata.CrossRateEngine in the
low-latency artifact in 3.0),
FxTierBook (per-LP size-tier ladders:
sweep cost and full-amount quotes), LpScorecard
(streaming last-look analytics: reject rate, hold, post-reject markout),
LpRouter (expected-all-in routing that prices
rejects into the decision) and SyntheticCross
(direct-vs-legs execution arithmetic with spread composition).
Since 4.0. AggregatedBook is
com.quantfinlib.marketdata.AggregatedBook in quant-finance-
library-lowlatency (module com.quantfinlib.lowlatency), with the
same API. See docs/MIGRATION_4.0.md.
-
ClassDescriptionHow two leg prices compose into a cross rate.Market conventions for an FX currency pair: quotation precision, pip size, spot lag, and settlement-date arithmetic against both currencies' holiday calendars.Analytics for benchmark-fixing exposure — the risk concentrated in the short calculation window of an official fix (WM/R 4pm London, the RBI reference rate an NDF settles on, an equity closing auction).An FX swap: two offsetting FX exchanges (buy, or sell, base currency on the near date; sell, or buy, it back on the far date).Tiered multi-LP FX book: the depth structure e-FX actually has.FX volatility surface built from the market's delta-quoted smile: ATM, 25-delta risk reversal and butterfly, optionally 10-delta wings.Which strike the ATM vol refers to.Accumulates per-expiry delta quotes, then solves strikes once in
FxVolSurface.Builder.build().What the quoted butterfly is.How the quoted deltas are defined (Reiswich and Wystup 2010, table 1).One expiry's solved smile: absolute strikes and vols, low to high strike.Last-look-aware LP router: chooses where to send an FX clip by expected all-in price, not displayed price.Streaming per-LP execution quality: the taker-side answer to last look.A non-deliverable forward: the FX forward for restricted currencies (INR, KRW, TWD, BRL, CNY, ...) where the local currency never moves.FX forward (swap-points) curve: the market's quoted forward points per tenor, turned into outright forwards for any settlement date.Accumulates tenor/points quotes, then freezes them into a curve.Direct-versus-synthetic cross execution arithmetic: an FX cross (EURJPY) can be dealt directly or replicated through its liquid legs (buy EURUSD, buy USDJPY), and the cheaper route changes with every quote — direct cross books are thin outside London hours while the USD legs stay tight.Vanna-volga adjusted one-touch (pays at expiry), the FX market convention for smile-consistent touch prices (Wystup 2006, FX Options and Structured Products, section 1.5 on vanna-volga pricing; Bossens, Rayée, Skantzos and Deelstra 2010, "Vanna-volga methods applied to FX derivatives", IJTAF 13(8)).