"""Lock della conclusione 2026-06-26: il gamma scalping (long-vol) su BTC/ETH PERDE strutturalmente — è lo specchio del VRP01, dal lato sbagliato del premio. Guardia contro ri-litigare l'idea "scalping con copertura in opzioni" come edge. Diario docs/diary/2026-06-26-gamma-scalp-options.md.""" import sys from pathlib import Path ROOT = Path(__file__).resolve().parents[1] sys.path.insert(0, str(ROOT)) sys.path.insert(0, str(ROOT / "scripts" / "research")) from options_gamma_scalp import ( # type: ignore # noqa: E402 _bs_straddle, gamma_scalp_asset, rv_iv_diagnostic, to_daily_voltgt, _metrics, ) def test_bs_straddle_positive_and_increasing_in_vol(): """Premio straddle ATM > 0 e cresce con la vol implicita (sanity del pricer).""" p_lo = _bs_straddle(100.0, 100.0, 7 / 365.25, 0.30) p_hi = _bs_straddle(100.0, 100.0, 7 / 365.25, 0.90) assert p_lo > 0 assert p_hi > p_lo def test_long_gamma_loses_when_rv_below_iv_synthetic(): """Sintetico: con prezzo PIATTO (RV=0) e IV>0, il long gamma deve perdere (solo theta).""" # P&L per step = DG*(r^2 - sigma^2 dt); con r=0 ogni step e' -DG*sigma^2*dt < 0. from options_gamma_scalp import OPT_FEE_FRAC # noqa: F401 sig = 0.60 # se RV=0 il gamma_pnl e' strettamente negativo -> ritorno negativo. Verifico via il segno # del contributo per-step a r=0. r = 0.0 contrib = (r * r - sig * sig * (1.0 / 365.25)) assert contrib < 0 def test_iv_exceeds_or_near_daily_rv_btc(): """BTC: a campionamento giornaliero l'IV (DVOL) >= RV in media -> il long gamma paga il VRP.""" d = rv_iv_diagnostic("BTC") assert d["iv"] > 0 and d["rv_daily"] > 0 assert d["spread_daily"] > 0.0 # IV - RV_1d > 0 su BTC (lato short paga) def test_naked_gamma_scalp_standalone_sharpe_negative(): """La conclusione: il book gamma-scalp nudo (BTC+ETH) ha Sharpe standalone NEGATIVO.""" wB = gamma_scalp_asset("BTC", mode="naked") wE = gamma_scalp_asset("ETH", mode="naked") daily = to_daily_voltgt(wB, wE) assert daily.std() > 0 assert _metrics(daily)["sharpe"] < 0.0