Open-source numerical library
Volatility surfaces that tell you when they lie.
fast-vollib prices options, inverts implied volatility with Jäckel's solver, calibrates whole surfaces with SVI, SSVI, splines and Heston — and reports the arbitrage each fit leaves behind, instead of hiding it. NumPy, PyTorch and JAX backends, CPU or GPU, one API.
pip install fast-vollib
Option Greeks vs time
Watch gamma spike and vega collapse at the money as T → 0, while delta hardens into a step. Curves are computed live in your browser and agree with fast-vollib to (measuring…) over a 1,260-point grid.
01 · Real data
One quarter, 62 surfaces, three-fold volatility.
Across Q2 2025 the SPX 30-day at-the-money implied volatility moved by a factor of three. Drag the scrubber to walk through the quarter; drag the surface itself, or use the arrow keys, to rotate it.
At-the-money term structure
30-day ATM through the quarter
Accessible description and data
Download the time-lapse JSON — fitted surfaces on a coarse grid, no raw quotes.
02 · Calibrators
Five algorithms, one grid, one honest trade-off.
The same observations, fitted five ways and materialised on the same moneyness × maturity grid. The non-parametric spline fits closest and violates the most; SSVI and Heston are arbitrage-free by construction and pay for it in fit error; and a learned three-factor basis fits a whole surface in about a millisecond but only where its training data reached. This is the trade-off the library exists to make measurable.
Smile at the selected date
Whole-quarter scorecard
| Algorithm | Median RMSE | Median fit | Arb-free days | Mean violations | Butterfly | Calendar |
|---|
What each calibrator actually does
03 · Diagnostics
Where the surface stops being a probability.
A surface is butterfly-free exactly when Durrleman's g(k) ≥ 0, which is the same as saying the implied risk-neutral density is non-negative. Below, both are computed by fast-vollib on the fitted grid for a calm day and the tariff-shock peak. Cells marked × are genuine violations.
Durrleman g(k) on the fitted grid
Rows are maturities, columns log-moneyness. Red with means g < 0 — a butterfly-arbitrage violation.
Implied risk-neutral density
Breeden–Litzenberger density f(K) = ∂²c̃/∂K². Any excursion below zero is not a probability density.
| Algorithm | RMSE vs quotes | min g(k) | min density | Violations | Verdict |
|---|
04 · Fit quality
Fitted against the market it came from.
Implied volatilities re-solved from mid quotes with fast-vollib, binned to a coarse moneyness grid (each point is the mean of at least three quotes), against the fitted smiles. Points are market; lines are model.
At-the-money term structure
Calm days slope gently upward; a shock inverts the curve, because the fear is immediate.
Skew: σ(k = −0.10) − σ(k = +0.10)
How much more the market pays for a 10% downside strike than a 10% upside one, at each maturity.
How the market points were produced
05 · Interactive
Move the inputs, watch the Greeks.
Black–Scholes computed in your browser, so it responds instantly. The implementation is diffed against fast-vollib on every build — the measured maximum error is in the table below.
Browser vs fast-vollib
| Quantity | Call · max abs error | Put · max abs error |
|---|
06 · Simulation
Paths, and where they end up.
20,000 paths per process from fast-vollib's simulation engine — geometric Brownian motion and Heston stochastic volatility — over six months. Heston's terminal distribution carries the fatter left tail that a single volatility number cannot express.
Sample paths
Terminal distribution
07 · Benchmarks
Measured here, on stated hardware.
Loading hardware description…
| Backend | dtype | 10⁴ | 10⁵ | 10⁶ | 10⁷ |
|---|
08 · Stay in the loop
Get market-structure notes.
Occasional notes on volatility surfaces, calibration and the library's development. No spam; unsubscribe any time.