Module fx_vol
Expand description
FX volatility surfaces: delta-quoted smiles per expiry, as a market-data store.
FX options quote in delta: a smile is an at-the-money vol and the vols of
puts and calls at stated deltas — 25P, ATM, 25C — under an explicit
DeltaConvention. Each node is a DeltaQuote, the option the market
names, and a surface stacks one smile per expiry for one currency pair.
A vol is read in strike space: at the query’s forward and base
discount factor every node resolves to the strike at which an option of
its kind has its delta, and the vol interpolates linearly in log-moneyness
ln(K/F) between adjacent node strikes, flat beyond the wings. Across
expiries each quote’s vol is linear in total variance σ²τ in the
surface’s day count, flat in vol beyond the ends — the rule that keeps
calendar arbitrage out of interpolated points.
Like the fixings and spot stores this one holds passive f64 node vols
and lifts them: a view resolves the node strikes and interpolates in the
pricing mode, so a queried vol carries the adjoints of the nodes it read
and of the forward and discount factor that placed them, and vega per node
arrives on its own risk axis from the ordinary risk pass.
The passive Garman-Kohlhagen delta arithmetic lives here too, because a
delta-quoted node needs it to find its strike and this layer sits below
the models: delta is contract-term arithmetic in plain f64, and stays
that way.
Structs§
- FxVol
Smile - One expiry’s smile:
(quote, vol)nodes, from the lowest strike’s quote to the highest’s — puts, ATM, calls. - FxVol
Surface - A delta-quoted vol surface for one pair: one smile per expiry, every smile quoting the same deltas.
- FxVol
View - A surface lifted into mode
R.
Enums§
- Delta
Convention - The four market delta conventions: spot or forward, plain or premium-adjusted (
Pa). A call is a call on the base currency, premium in the quote currency; a premium-adjusted delta subtracts the base-currency premium. - Delta
Quote - Where a node sits on a delta-quoted smile: the option the market names
and the delta it names it at. Spelled as the market does —
25Pis the 25-delta put,ATMthe delta-neutral straddle,25Cthe 25-delta call. - FxVol
Error - A surface that cannot be built or cannot answer.
Constants§
Functions§
- delta
- The signed Garman-Kohlhagen delta of a vanilla under
convention, per unit base notional — calls positive, puts negative. Passive contract-term arithmetic: this is how a trade is described, not how it is priced. - delta_
in 🔒 - The signed Garman-Kohlhagen delta of a vanilla under
convention, per unit base notional — calls positive, puts negative — with every input in the mode. - node_
strike_ 🔒in - The strike at which an option of the quote’s kind has the quote’s delta,
under
convention, at the node’s ownvol— the forward, the discount factor and the vol in the mode, so the strike carries their adjoints. - read_
smile_ 🔒in - The vol at
strikeon a smile whose node vols arevolsin the mode: every node placed at its strike, then linear inln(K/F)between the adjacent node strikes and flat beyond the wings. A single node is the whole smile.