TQBTHEQUANTBATEMAN
TQB/ learn/ volatility/ volatility surfaceEN · DARK
Volatility · front-office

Volatility surface

A market-consistent map across strike and maturity—and a hypothesis about everything between the quotes

BY THE END, YOU CAN

01Read a surface as linked smile and term slices rather than a decorative 3D object.

02Distinguish quoted nodes, interpolation choices and model-generated dynamics.

03Use total variance and option-price checks to reason about static arbitrage.

04Connect the surface to vanilla marking, local volatility, stochastic volatility and hedge behavior.

01
INTUITION

Separate the quote from the quantity inferred from it.

A volatility surface stacks option-implied volatility across strike and expiry. Every visible point is a compact encoding of an option price under a stated convention; every gap between liquid points is a modelling decision.

01

A smile slice answers how downside, ATM and upside options differ at one expiry.

02

A term slice answers how the market distributes uncertainty and event risk through time.

03

The fitted surface marks vanilla books today. A dynamics model determines how it moves tomorrow.

02
WHY MARKETS CARE

Start from executable inputs and conventions.

Desks need continuous values for marking, interpolation, scenario risk and calibration even though only a sparse set of options trades reliably.

INSTRUMENTS

listed or OTC vanilla grids

variance-sensitive products

barriers and digitals

forward-start and cliquet structures

QUOTE CONVENTION

This lesson uses spot moneyness K/S and ACT/365-like maturity for education. Production equity, FX and rates surfaces require their native forward, delta, premium, ATM and normal/lognormal conventions.

03
MATHEMATICS

Transform quotes without losing units or arbitrage constraints.

Formula · Definition

Surface coordinate

(k,T)↦σimp(k,T),k=log⁡(K/FT)(k,T)\mapsto \sigma_{imp}(k,T),\qquad k=\log(K/F_T)

Forward log-moneyness makes strike geometry comparable across maturities.

Open in Analytics
Formula · Definition

Total variance

w(k,T)=σimp2(k,T)Tw(k,T)=\sigma_{imp}^2(k,T)T

Many no-arbitrage and interpolation questions are more naturally expressed in total variance than volatility.

Open in Analytics
Formula · Full derivation

Risk-neutral density

∂KKC(K,T)=D(0,T) fSTQ(K)≥0\partial_{KK}C(K,T)=D(0,T)\,f_{S_T}^{\mathbb Q}(K)\ge 0

Convex call prices imply a non-negative risk-neutral terminal density.

Open in Analytics
Formula · Full derivation

Dupire local variance

σloc2(K,T)=∂TC+(r−q)K∂KC+qC12K2∂KKC\sigma_{loc}^2(K,T)=\frac{\partial_T C+(r-q)K\partial_K C+qC}{\tfrac12K^2\partial_{KK}C}

A sufficiently smooth arbitrage-consistent vanilla surface identifies one local-volatility diffusion.

Open in Analytics
Full derivation
Full derivation

From a call-price surface to local volatility

Dupire’s result is an inversion of the forward equation. It shows why surface smoothness and convexity are numerical requirements, not styling preferences.

  1. 01

    Assume risk-neutral local dynamics

    Let instantaneous volatility depend on state and time while the drift remains risk-neutral.

    dSt=(r−q)Stdt+σloc(St,t)StdWtdS_t=(r-q)S_tdt+\sigma_{loc}(S_t,t)S_tdW_t
  2. 02

    Write the forward density equation

    The transition density evolves under the Fokker–Planck equation associated with the diffusion.

    ∂Tp=−∂S((r−q)Sp)+12∂SS(σloc2S2p)\partial_T p=-\partial_S((r-q)Sp)+\tfrac12\partial_{SS}(\sigma_{loc}^2S^2p)
  3. 03

    Differentiate option prices by strike

    Breeden–Litzenberger links the strike curvature of call prices to the discounted risk-neutral density.

    ∂KKC=D(0,T)p(K,T)\partial_{KK}C=D(0,T)p(K,T)
  4. 04

    Differentiate by maturity

    Insert the forward density evolution into the maturity derivative of the call payoff integral and integrate by parts.

    C(K,T)=D(0,T)∫K∞(S−K)p(S,T)dSC(K,T)=D(0,T)\int_K^{\infty}(S-K)p(S,T)dS
  5. 05

    Isolate local variance

    Rearrange the resulting forward PDE. A non-positive denominator or noisy derivative makes the inferred local variance unstable.

    σloc2=∂TC+(r−q)K∂KC+qC12K2∂KKC\sigma_{loc}^2=\frac{\partial_T C+(r-q)K\partial_K C+qC}{\tfrac12K^2\partial_{KK}C}

A surface is simultaneously market data, an interpolation object and an input to dynamics. Those roles should never be silently conflated.

Inputs
  • k = log(K/F_T): log-forward moneyness
  • w(k,T) = σ_imp²(k,T)T: total implied variance
  • C(K,T): call-price surface
  • σ_loc(K,T): local volatility
Assumptions and limits
  • Sparse wings force extrapolation choices.
  • A perfect static fit does not guarantee realistic forward dynamics.
  • Volatility-space interpolation can hide option-price arbitrage.
05
MODEL / PRICING

Invert, fit, and reprice the market instruments.

METHOD

Normalize option quotes, infer implied volatilities, choose a stable coordinate system, fit each slice, connect maturities and validate reconstructed premiums and static-arbitrage diagnostics.

CALIBRATION

The educational workbench exposes level, skew, curvature and term slope directly. Production calibration minimizes weighted premium or volatility errors subject to stability, liquidity and no-arbitrage constraints.

Implementation with current QuantLib

Current QuantLib 1.42 introduced PiecewiseBlackVarianceSurface for ragged grids and provides Black variance surfaces, smile sections and SABR structures. A library supplies tested representations; the user must still choose conventions, quotes, interpolation and extrapolation deliberately.

API authority: upstream QuantLib reference pinned in the source registry.
06PYTHON IMPLEMENTATIONOpen the implementation and checks.
ARCHITECTURE
  • Store source quotes and fitted state separately.
  • Evaluate one deterministic grid in the framework-free quant layer.
  • Drive heatmap, smile, term and 3D views from the same values.
  • Always provide exact readouts and a 2D/table alternative to 3D.
PYTHON 3 · NUMPY / SCIPY

Vectorized educational surface

Build one deterministic surface grid with explicit parameters, units and sanity checks.

REUSABLE EXAMPLE
01from __future__ import annotations
02
03from dataclasses import dataclass
04import numpy as np
05from numpy.typing import NDArray
06
07FloatArray = NDArray[np.float64]
08
09@dataclass(frozen=True)
10class SurfaceShape:
11 atm: float = 0.20
12 skew: float = -0.18
13 curvature: float = 0.55
14 term_slope: float = 0.025
15
16def educational_surface(
17 log_moneyness: FloatArray,
18 maturity: FloatArray,
19 shape: SurfaceShape,
20) -> FloatArray:
21 """Return a deterministic teaching surface; never market data."""
22 if np.any(maturity <= 0.0):
23 raise ValueError("maturity must be positive")
24 vol = (
25 shape.atm
26 + shape.skew * log_moneyness
27 + shape.curvature * log_moneyness**2
28 + shape.term_slope * np.log1p(maturity)
29 )
30 return np.maximum(vol, 0.01)
31
32tenors = np.array([7 / 365, 30 / 365, 0.25, 0.5, 1.0, 2.0])
33moneyness = np.linspace(0.70, 1.30, 25)
34k = np.log(moneyness)[None, :]
35t = tenors[:, None]
36surface = educational_surface(k, t, SurfaceShape())
37
38assert surface.shape == (tenors.size, moneyness.size)
39assert np.isfinite(surface).all() and np.all(surface > 0.0)
40print(f"ATM 1Y: {surface[4, 12]:.2%}")
EXPECTED OUTPUTATM 1Y: 21.73%shape: 6 maturities × 25 moneyness nodes
SANITY CHECKS

✓ All maturities are positive.

✓ Every output is finite and positive.

✓ The result is explicitly synthetic and not a calibration.

07
INTERACTIVE LAB

One surface, four linked views.

LOADING VISUAL ENGINEBuilding one deterministic surface grid…
08
FRONT OFFICE

Where the model meets the book.

ON THE DESK
“The mark is a surface. The hedge is a view about how that surface moves.”
VISIBLE INPUTS

bid/offer vanilla grid

spot and forwards

discount/dividend curves

corporate-action calendar

expiry/settlement conventions

CALIBRATION

Fit liquid nodes more strongly, preserve bid/offer awareness and inspect residuals in premium as well as volatility space.

RISK

vega buckets

vanna and volga

skew/term scenarios

spot-vol correlation

calendar roll

DAILY WORKFLOW
  1. ingest and timestamp quotes
  2. normalize strikes/deltas
  3. clean crossed or stale nodes
  4. fit
  5. reprice quotes
  6. publish surface and risk
  7. monitor drift
Production failure modes
  • stale spot or forward
  • calendar-arbitrage from interpolation
  • wing extrapolation instability
  • quote holes
  • parameter jumps across recalibrations
  • cache and version mismatch
09MACRO CONNECTIONOpen the transmission channel.
MACRO CONNECTION

A surface is a map of event pricing

Macro regimes affect the level, asymmetry and timing of protection demand rather than moving every option uniformly.

01Inflation / growth surprisetransmits

changes policy and earnings distribution

02Rates and forwardtransmits

move carry and moneyness coordinates

03Risk sentimenttransmits

changes downside protection demand

04Surfaceoutput

reprices level, skew and term structure

10COMMON PITFALLSOpen the failure checklist.
01

Treating a smooth plot as proof of no arbitrage.

02

Mixing spot and forward moneyness.

03

Fitting mid quotes without spreads or liquidity weights.

04

Using a static surface as a claim about future smile dynamics.

05

Showing synthetic scenarios as market observations.

11SOURCES / FURTHER READINGOpen sources and continue the track.
research

Lectures 04 and 07 — implied and stochastic volatility

Research path for the volatility progression; all explanations and implementation are original.

Source
Computational Finance Course
Author
L. A. Grzelak
Ref
main
OPEN ORIGINAL SOURCE ↗
implementation reference

ql/termstructures/volatility and QuantLib 1.42 release notes

Current implementation reference for smile sections, SABR and variance-surface representations.

Source
QuantLib upstream
Author
QuantLib contributors
Ref
v1.42.1
OPEN ORIGINAL SOURCE ↗