The finance developer workbenchSearch the reference Development · 0.1.4 · unpublished

@insiderfinance/totalfinance/volatility/surface

VolatilitySurface · field contracts

Page 2 of 2. Back to the entry point or find this declaration.

Name / typeMeaning & unitOptional / default
return.slices
SurfaceSlice[]

unitless by name
Required / declared member
No @default declared; consult the signature and description.
return.ssvi
SSVIParameters
The global SSVI parameters when `model: 'ssvi'`, else `undefined`.
unitless by name
Optional
No @default declared; consult the signature and description.
return.toJSON
() => VolatilitySurfaceSnapshot
Serialize the surface to a plain, JSON-safe {@link VolatilitySurfaceSnapshot} (no closures). Restore it with {@link VolatilitySurface.fromJSON}; the pair round-trips `iv()` identically on all six models.
unitless by name
Required / declared member
No @default declared; consult the signature and description.
return.toRows
() => SurfaceRow[]
The smile-chart / heatmap feed: one {@link SurfaceRow} per (slice, stored strike), with `logMoneyness = ln(strike/forward)` and the stored `delta`/`iv`. Per the workspace missing-value policy (WS2.12), any non-finite chart-facing numeric is emitted as `null` (never `NaN`, never omitted).
unitless by name
Required / declared member
No @default declared; consult the signature and description.
shock
(shifts: { parallel?: number; skewTilt?: number; }, { sticky }?: { sticky?: 'strike' | 'moneyness'; }) => VolatilitySurface
Return a NEW surface with a shifted vol structure, produced WITHOUT re-fitting: each stored IV sample gains a `parallel` offset plus a `skewTilt · k` skew rotation (`k = ln(K/forward)`, log-moneyness), the per-slice deltas are recomputed from the shifted IVs, and only the interpolators are rebuilt. The shock is echoed in the new surface's `assumptions.shock`. `sticky`: `'strike'` (default) pins the tilt to each stored strike's own log-moneyness vs the slice forward; `'moneyness'` lets the same additive shift travel with moneyness. Because the shift is applied to the stored strike-indexed IV samples, both modes coincide at the stored strikes in this eager v1 — the distinction only matters once a surface is re-anchored to a new spot/forward, which this method does not do; the requested mode is recorded in `assumptions.shock.sticky` so a caller that later re-anchors knows how the tilt was meant to travel. Parametric models (`svi`/`sabr`/`heston`) have no closed-form shock, so the current smile is SAMPLED at each slice's stored strikes, those samples are shifted, and the result DEGRADES to `'interpolated'` with a `volatility.shock_degraded_to_interpolated` `warn` — the parametric fit is not re-fit. Non-parametric models (`raw`/`interpolated`/`smoothed`) are preserved.
unitless by name
Required / declared member
No @default declared; consult the signature and description.
shock(__1)
{ sticky?: 'strike' | 'moneyness'; }

unitless by name
Optional
No @default declared; consult the signature and description.
shock(__1).sticky
'strike' | 'moneyness'

unitless by name
Optional
No @default declared; consult the signature and description.
shock(shifts)
{ parallel?: number; skewTilt?: number; }

unitless by name
Required / declared member
No @default declared; consult the signature and description.
shock(shifts).parallel
number

unitless by name
Optional
No @default declared; consult the signature and description.
shock(shifts).skewTilt
number

unitless by name
Optional
No @default declared; consult the signature and description.
slice
(expiry: string | number) => SurfaceSlice | undefined
The smile at an expiry (exact label or nearest by `t`), or `undefined` if none.
unitless by name
Required / declared member
No @default declared; consult the signature and description.
slice().return.deltas
number[]
Call-delta `e^{−qt}·N(d1)` at each strike (the smile's delta axis, for skew lookups).
unitless by name
Required / declared member
No @default declared; consult the signature and description.
slice().return.essvi
ESSVIParameters
The globally-calibrated eSSVI parameters when `model: 'essvi'` (shared across all slices).
unitless by name
Optional
No @default declared; consult the signature and description.
slice().return.expiry
string

unitless by name
Required / declared member
No @default declared; consult the signature and description.
slice().return.forward
number
Forward `S·e^{(r−q)t}`.
unitless by name
Required / declared member
No @default declared; consult the signature and description.
slice().return.heston
HestonParameters
The globally-calibrated Heston parameters when `model: 'heston'` (shared across all slices).
unitless by name
Optional
No @default declared; consult the signature and description.
slice().return.impliedVolatilities
number[]

unitless by name
Required / declared member
No @default declared; consult the signature and description.
slice().return.sabr
SabrParameters
Fitted SABR parameters when `model: 'sabr'` (absent if the slice fell back to interpolation).
unitless by name
Optional
No @default declared; consult the signature and description.
slice().return.ssvi
SSVIParameters
The globally-calibrated SSVI parameters when `model: 'ssvi'` (shared across all slices).
unitless by name
Optional
No @default declared; consult the signature and description.
slice().return.strikes
number[]

unitless by name
Required / declared member
No @default declared; consult the signature and description.
slice().return.svi
SVIParameters
Fitted raw-SVI parameters when `model: 'svi'` (absent if the slice fell back to interpolation).
unitless by name
Optional
No @default declared; consult the signature and description.
slice().return.timeToExpiryYears
number
Time to expiry in years (ACT/365F).
years (decimal)
Required / declared member
No @default declared; consult the signature and description.
slice(expiry)
string | number

unitless by name
Required / declared member
No @default declared; consult the signature and description.
slices
SurfaceSlice[]

unitless by name
Required / declared member
No @default declared; consult the signature and description.
ssvi
SSVIParameters
The global SSVI parameters when `model: 'ssvi'`, else `undefined`.
unitless by name
Optional
No @default declared; consult the signature and description.
ssvi.phi
import('@insiderfinance/totalfinance/volatility').SSVIPhi
Curvature function.
unitless by name
Required / declared member
No @default declared; consult the signature and description.
ssvi.phi.eta
number

unitless by name
Required / declared member
No @default declared; consult the signature and description.
ssvi.phi.gamma
number

unitless by name
Required / declared member
No @default declared; consult the signature and description.
ssvi.phi.kind
('heston') | ('power-law')

unitless by name
Required / declared member
No @default declared; consult the signature and description.
ssvi.phi.lambda
number

unitless by name
Required / declared member
No @default declared; consult the signature and description.
ssvi.rho
number
Global skew `ρ ∈ (−1, 1)`.
unitless by name
Required / declared member
No @default declared; consult the signature and description.
ssvi.thetaTerm
{ timeToExpiryYears: number; theta: number; }[]
ATM total-variance knots `(t, θ)`, strictly increasing in both (calendar-arbitrage-free).
unitless by name
Required / declared member
No @default declared; consult the signature and description.
toJSON
() => VolatilitySurfaceSnapshot
Serialize the surface to a plain, JSON-safe {@link VolatilitySurfaceSnapshot} (no closures). Restore it with {@link VolatilitySurface.fromJSON}; the pair round-trips `iv()` identically on all six models.
unitless by name
Required / declared member
No @default declared; consult the signature and description.
toJSON().return.assumptions
Assumptions<{ shock?: SurfaceShock; }>

unitless by name
Required / declared member
No @default declared; consult the signature and description.
toJSON().return.config
{ cosineExpansionTerms: number; dividendYield: number; riskFreeRate: number; sabrBeta: number; sabrVolatilityType: SabrVolatilityType; smoothingBandwidth?: number; }
Config knobs needed to rebuild the per-slice interpolators without re-solving from quotes.
unitless by name
Required / declared member
No @default declared; consult the signature and description.
toJSON().return.config.cosineExpansionTerms
number

unitless by name
Required / declared member
No @default declared; consult the signature and description.
toJSON().return.config.dividendYield
number

decimal rate (0.05 = 5%)
Required / declared member
No @default declared; consult the signature and description.
toJSON().return.config.riskFreeRate
number

decimal rate (0.05 = 5%)
Required / declared member
No @default declared; consult the signature and description.
toJSON().return.config.sabrBeta
number

unitless by name
Required / declared member
No @default declared; consult the signature and description.
toJSON().return.config.sabrVolatilityType
SabrVolatilityType

unitless by name
Required / declared member
No @default declared; consult the signature and description.
toJSON().return.config.smoothingBandwidth
number

unitless by name
Optional
No @default declared; consult the signature and description.
toJSON().return.diagnostics
Diagnostics

unitless by name
Required / declared member
No @default declared; consult the signature and description.
toJSON().return.essvi
ESSVIParameters
The global eSSVI parameters when `model: 'essvi'`.
unitless by name
Optional
No @default declared; consult the signature and description.
toJSON().return.heston
HestonParameters
The global Heston parameters when `model: 'heston'`.
unitless by name
Optional
No @default declared; consult the signature and description.
toJSON().return.model
SurfaceModel

unitless by name
Required / declared member
No @default declared; consult the signature and description.
toJSON().return.points
SurfacePoint[]

unitless by name
Required / declared member
No @default declared; consult the signature and description.
toJSON().return.referenceSpot
number

unitless by name
Required / declared member
No @default declared; consult the signature and description.
toJSON().return.schemaVersion
string

unitless by name
Required / declared member
No @default declared; consult the signature and description.
toJSON().return.slices
SurfaceSlice[]

unitless by name
Required / declared member
No @default declared; consult the signature and description.
toJSON().return.ssvi
SSVIParameters
The global SSVI parameters when `model: 'ssvi'`.
unitless by name
Optional
No @default declared; consult the signature and description.
toRows
() => SurfaceRow[]
The smile-chart / heatmap feed: one {@link SurfaceRow} per (slice, stored strike), with `logMoneyness = ln(strike/forward)` and the stored `delta`/`iv`. Per the workspace missing-value policy (WS2.12), any non-finite chart-facing numeric is emitted as `null` (never `NaN`, never omitted).
unitless by name
Required / declared member
No @default declared; consult the signature and description.