← ClaudeAtlas

implied-vol-surfacelisted

Build a volatility surface that is not silently arbitrageable - invert prices to implied vols, fit a smile, check butterfly and calendar arbitrage, and interpolate between maturities. TRIGGER - implied volatility solver, Newton diverges, bisection bracket, "implied vol returns 0.001", "no implied volatility for this option", price below intrinsic, BelowIntrinsicException; SVI, raw SVI, Gatheral, svi calibration, a b rho m sigma, SviSmileSection; volatility smile, skew, surface fitting, total variance, log-moneyness; butterfly arbitrage, negative implied density, Durrleman g(k), calendar spread arbitrage, static arbitrage check, Gatheral and Jacquier 2014; interpolating the vol surface, "my interpolated surface has arbitrage", "vol interpolation between expiries". SKIP for pricing one option and the models themselves - Heston, CRR, SABR, Monte Carlo (option-pricing-models), for library choice, Greek units and licences (derivatives-pricing), and for option chain data and historical chains (options-backtesting).
howard-lynn-ye/fin-skills · ★ 1 · AI & Automation · score 77
Install: claude install-skill howard-lynn-ye/fin-skills
# Implied vol surface A surface is three separate problems — **invert**, **fit**, **interpolate** — and each has a way of being wrong that produces a number instead of an error. Every figure below is printed by `scripts/vol_surface.py` (runs in **5.1 s**; vollib and QuantLib are optional, imported inside functions). ✅ Measured means this file produced it on 2026-09-09 with QuantLib 1.43, vollib 1.0.11, numpy 2.2.6, scipy 1.13.0, Python 3.11.3. The synthetic truth is a Heston surface, so the "right answer" at any strike and maturity is known. > **The rule:** invert with a bracketed solver on a **relative** price tolerance that refuses > sub-intrinsic prices; fit in **total variance**; run **g(k) ≥ 0** and **dw/dt ≥ 0** on every > fit; and interpolate maturities in **total variance at fixed log-moneyness** — never in vol. ## 1. Inverting a price — the solver is the easy half ✅ **Round trip over 27 cases** (sigma ∈ {0.10, 0.30, 0.80} × K/S ∈ {0.7, 1.0, 1.3} × T ∈ {0.05, 1, 3}, OTM side): worst |recovered − true| = **3.1e-14**. ✅ **vollib** (Jaeckel's *Let's Be Rational*) on the identical cases: worst |mine − vollib| = **3.2e-14**. Two independent methods, agreement at the last bit — the inversion itself is a solved problem. ⚠️ **`py_vollib` is not installed here; `vollib` 1.0.11 is.** `py_vollib` is a deprecated shim — see `../../../fin-libraries/skills/lib-vollib/SKILL.md`. The import used is `vollib.black_scholes_merton.implied_volatility`, which takes `q`. ### 1a. 🚨 A