Options analytics · Python
Arbitrage checks fire on 85 % of ticks once quotes carry 0.0005 IV noise
An implied-volatility solver, SVI smile fits and static-arbitrage checks, run on a seeded simulated option chain. The solver and fits hold up. The arbitrage checks need a noise threshold before a live flag means anything.
Synthetic data: simulated option chain, seed 7.160 quotes, expiries 7, 30, 60, 90 daysOne seed
How noise-sensitive are the checks?
Quote noise of 0.05 vol points trips the butterfly check on 85 % of ticks
Each quote's IV gets independent noise. Once that noise exceeds a butterfly's value, the convexity check fires even though the underlying surface has no arbitrage.
False alarms rise from none to every tick as noise grows from 0.0002 to 0.002
Share of ticks with at least one violation · 40 ticks per level · seed 7
| IV noise sd | Vol points | Ticks flagged | Share | Violations per tick | Butterfly |
|---|---|---|---|---|---|
| 0.0002 (default) | 0.02 | 0 of 40 | 0 % | 0.00 | 0 of 0 |
| 0.0005 | 0.05 | 34 of 40 | 85 % | 1.57 | 63 of 63 |
| 0.0010 | 0.1 | 40 of 40 | 100 % | 5.58 | 223 of 223 |
| 0.0020 | 0.2 | 40 of 40 | 100 % | 12.80 | 512 of 512 |
Every flag here is a false alarm. The simulated surface passes every check at the default noise (0 of 40 ticks flagged). The chain has no bid-ask spread, so 0 of 798 flags could be compared with the cost of trading them.
How well does SVI fit?
SVI misses held-out strikes by 0.021–0.114 vol points; the 7-day fit is 3.54× worse than in-sample
In-sample error is the fit on all out-of-the-money strikes. Held-out error refits on two thirds of them and scores every third strike. Beyond 7 days, held-out error stays at or below 0.030 vol points. The 7-day gap is not overfitting: the two-thirds fit already misses its own 13 training strikes by 0.104, so with fewer strikes the short-dated smile is fit poorly everywhere.
Held-out residuals are widest on the 7-day smile
Quote IV minus SVI fit · vol points · one panel per expiry
| Expiry | In-sample RMSE | ⅔-fit train RMSE | Held-out RMSE | Held-out ÷ in-sample | ATM IV | 25-delta skew | min g(k) |
|---|---|---|---|---|---|---|---|
| 7 days | 0.032 | 0.104 | 0.114 | 3.54× | 13.0 % | 5.36 | 0.215 |
| 30 days | 0.018 | 0.014 | 0.021 | 1.17× | 14.5 % | 6.26 | 0.280 |
| 60 days | 0.017 | 0.017 | 0.030 | 1.79× | 15.5 % | 6.20 | 0.360 |
| 90 days | 0.017 | 0.013 | 0.028 | 1.64× | 16.0 % | 5.30 | 0.422 |
SVI is expected to fit here. The simulator generates SVI-shaped smiles and adds noise of sd 0.02 vol points, so in-sample error mostly measures that noise. This tests the fitting code, not whether SVI suits real markets.
Is the IV solver exact?
The solver recovers every identifiable contract to within 2.5 × 10−12
10,000 random contracts are priced with Black-Scholes and solved back. 400 have too little vega for their volatility to be identifiable, so they are excluded rather than reported as solved.
| Round trip | Value |
|---|---|
| Random contracts | 10,000 |
| Identifiable (vega above 10−4 × spot) | 9,600 |
| Identifiable but unsolved | 0 |
| Recovered exactly (error 0) | 2,152 |
| Median absolute error | 2.2 × 10−16 |
| Max absolute error | 2.5 × 10−12 |
| Solved by the Brent fallback | 21 % |
Does vectorizing pay?
The vectorized solver is 1.81× faster than a scalar loop on 10,000 options
Both solvers agree to within 2.2 × 10−12. The gain is modest, and 24 % of these options need the Brent fallback.
| Options | Scalar loop (ms) | Vectorized (ms) | Speedup | Brent fallback | Max diff |
|---|---|---|---|---|---|
| 1,000 | 26.3 | 16.1 | 1.64× | 22 % | 4.5 × 10−13 |
| 10,000 | 278.6 | 154.1 | 1.81× | 24 % | 2.2 × 10−12 |
Timing depends on the machine. This build ran on x86_64 Linux, Python 3.12.16. The Pages build re-times on every deploy, so these numbers change with the runner.
Methodology
How this was measured
The simulator draws one tick of 160 calls and puts across 4 expiries around spot 5,000. Each expiry's true smile is a raw-SVI curve from simulator.py, and each quote's IV gets independent normal noise.
Implied volatilities are solved with Newton steps and a Brent fallback, fit per expiry with SVI, and checked for static arbitrage. The noise sweep reruns the same seed at 4 noise levels for 40 ticks each.
What this shows
- The solver is exact to 2.5 × 10−12 wherever vega is identifiable.
- SVI fits a simulated smile to 0.021–0.114 vol points on held-out strikes.
- Butterfly checks need a noise threshold: 0.05 vol points of quote noise flags 85 % of ticks.
What it doesn't show
- Behavior on market quotes. Every number here is simulated.
- Whether SVI is the right model, since the simulator generates SVI smiles.
- Extrapolation: held-out strikes sit between training strikes.
- Variation across seeds. This is one seed and one tick.
Reproduce
Run it yourself
git clone https://github.com/allenwang0/volatilityscanner.git && cd volatilityscanner
make setup PYTHON=python3.12
.venv/bin/python report.py --seed 7 --out docs/index.html # this page
.venv/bin/python main.py --seed 7 # live dashboardEnvironment for this build · 6 rows
| Field | Value |
|---|---|
| Machine | x86_64 Linux, Python 3.12.16 |
| NumPy | 2.4.6 |
| SciPy | 1.17.1 |
| Seed | 7 |
| Commit | 5fb0923 |
| Built | 2026-11-26 |