← Allen Wang Code ↗

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

85 %of 40 ticks had at least one false butterfly flag at noise sd 0.0005 (0.05 vol points). At the simulator's default 0.0002, 0 of 40 did.
SVI fit error, held-out strikes0.021–0.114 vol ptsvs 0.017–0.032 in-sample. The 7-day fit is 3.54× worse held out.RMSE per expiry · every third strike held out · one tick
IV solver round trip, max error2.5 × 10−129,600 of 10,000 contracts identifiable; 0 unsolvedRandom contracts priced exactly, then solved back
Arbitrage checks at default noise0 of 361checks violated on this tick, IV noise sd 0.0002160 quotes on one simulated tick
Vectorized solver speedup1.81×154.1 vs 278.6 ms for 10,000 options in a scalar loopx86_64 Linux, Python 3.12.16 · median of 5 runs

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

Static-arbitrage violations by quote noise, 40 ticks per level, seed 7
IV noise sdVol pointsTicks flaggedShareViolations per tickButterfly
0.0002 (default)0.020 of 400 %0.000 of 0
0.00050.0534 of 4085 %1.5763 of 63
0.00100.140 of 40100 %5.58223 of 223
0.00200.240 of 40100 %12.80512 of 512
Each bar is the share of 40 simulated ticks flagged at one IV noise sd (volatility units; ×100 for vol points). Single seed, so no interval.

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

SVI fit quality per expiry; RMSE and skew in vol points
ExpiryIn-sample RMSE⅔-fit train RMSEHeld-out RMSEHeld-out ÷ in-sampleATM IV25-delta skewmin g(k)
7 days0.0320.1040.1143.54×13.0 %5.360.215
30 days0.0180.0140.0211.17×14.5 %6.260.280
60 days0.0170.0170.0301.79×15.5 %6.200.360
90 days0.0170.0130.0281.64×16.0 %5.300.422
Residuals against the two-thirds fit. Filled dots are its training strikes; open dots are held out. All panels share both scales. The table adds ATM IV, 25-delta skew and the minimum Gatheral-Jacquier density g(k) on 201 points (a negative value would mean butterfly arbitrage).

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.

IV solver round trip, seed 7; errors in volatility units
Round tripValue
Random contracts10,000
Identifiable (vega above 10−4 × spot)9,600
Identifiable but unsolved0
Recovered exactly (error 0)2,152
Median absolute error2.2 × 10−16
Max absolute error2.5 × 10−12
Solved by the Brent fallback21 %

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.

Solver timing, median of 5 runs, x86_64 Linux, Python 3.12.16
OptionsScalar loop (ms)Vectorized (ms)SpeedupBrent fallbackMax diff
1,00026.316.11.64×22 %4.5 × 10−13
10,000278.6154.11.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 dashboard
Environment for this build · 6 rows
Build environment
FieldValue
Machinex86_64 Linux, Python 3.12.16
NumPy2.4.6
SciPy1.17.1
Seed7
Commit5fb0923
Built2026-11-26