# iv-signal-scanner Options signal tool using risk-neutral density from Deribit IV data — skew, tails, and distribution shape as trading signals. ## What it does Pulls live implied volatility data from Deribit for a given BTC options expiry, reconstructs the risk-neutral probability density function using Breeden-Litzenberger, and generates directional signals based on four independent metrics: - **Skew** — asymmetry between put and call side of the distribution - **Tails** — excess mass in the tails relative to a normal distribution - **Peak** — sharpness/flatness of the PDF around the ATM strike - **Band** — probability concentration in a +-3% band around spot Signals only fire when all four agree (unanimous voting). Includes a synthetic backtest mode that generates random IV surfaces and labels outcomes using GBM simulation — no live API needed for testing. ## Usage ```bash pip install -r requirements.txt python app.py ``` **Live mode** — enter an expiry (e.g. `28MAR25`) and hit Fetch. The app pulls instruments from Deribit, prices them via Black-Scholes, fits a spline to the IV surface, and plots the recovered PDF with signal output. **Backtest mode** — runs N synthetic cases with randomised IV surfaces (configurable skew, curvature, ATM vol ranges). Each case is labelled bullish/bearish based on a simulated GBM path, then compared against the signal output. ## Requirements - Python 3.8+ - Deribit public API access (no auth needed for market data) ``` matplotlib numpy requests scipy ``` tkinter is included with standard Python installs. ## Notes Breeden-Litzenberger requires a smooth, dense IV surface — the app uses spline interpolation with Gaussian smoothing to handle gaps in Deribit's strike ladder. Results are sensitive to IV data quality, especially for near-expiry or low-liquidity expiries.