Skip to main content

Module fx_vol

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§

FxVolSmile
One expiry’s smile: (quote, vol) nodes, from the lowest strike’s quote to the highest’s — puts, ATM, calls.
FxVolSurface
A delta-quoted vol surface for one pair: one smile per expiry, every smile quoting the same deltas.
FxVolView
A surface lifted into mode R.

Enums§

DeltaConvention
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.
DeltaQuote
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 — 25P is the 25-delta put, ATM the delta-neutral straddle, 25C the 25-delta call.
FxVolError
A surface that cannot be built or cannot answer.

Constants§

DELTA_LABEL_ITERS 🔒
DELTA_LABEL_TOL 🔒

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 own vol — the forward, the discount factor and the vol in the mode, so the strike carries their adjoints.
read_smile_in 🔒
The vol at strike on a smile whose node vols are vols in the mode: every node placed at its strike, then linear in ln(K/F) between the adjacent node strikes and flat beyond the wings. A single node is the whole smile.