Skip to content

Phase 3: implied variance — BSM, de-Americanization, MFIV, VIX replication - #5

Merged
NavyBlueCheese merged 2 commits into
mainfrom
phase-3/implied-variance
Jul 9, 2026
Merged

Phase 3: implied variance — BSM, de-Americanization, MFIV, VIX replication#5
NavyBlueCheese merged 2 commits into
mainfrom
phase-3/implied-variance

Conversation

@NavyBlueCheese

Copy link
Copy Markdown
Owner

What was built

  • black_scholes.py — BSM (Merton dividend-yield / Garman-Kohlhagen form), analytic greeks, bracketed-Brent IV inversion with static no-arbitrage checks.
  • american.py — CRR binomial (European/American) and de-Americanization: FXE quotes are inverted against the American price, removing the early-exercise premium before any European machinery runs. The Brent bracket floor respects the CRR constraint sigma > |r-q| sqrt(dt).
  • mfiv.py — the full VIX white-paper methodology: parity forward (with a carry-forward fallback for thin ETF chains), K0 selection robust to quoteless strikes, zero-bid wing truncation, minutes-based constant-maturity interpolation, AM/PM settlement conventions (third-Friday SPX 09:30 ET vs weeklies/ETF 16:00 ET).
  • rates.py — DFF/ESTR to continuously-compounded ACT/365.
  • scripts/build_implied.py — replicated VIX from scraped _SPX snapshots + the FXE MFIV (EVZ continuation), with reconciliation report; scripts/early_exercise_study.py — the section-1.5 study on library code (matches the Phase 0 scratchpad: worst case 6.57%).

Test results

104 passed, coverage 92.6%, mypy --strict clean. Ground-truth highlights: hypothesis IV round-trip over sigma in [0.001, 5.0]; greeks vs finite differences; CRR converges to BSM and the American call with q=0 equals the European (Merton); de-Americanization round-trips and naive European inversion demonstrably overstates vol on the predicted side; MFIV on a synthetic BS chain recovers sigma-squared within the measured 0.5% strike-discreteness and is insensitive to wing extension; the zero-bid truncation rule is pinned strike-by-strike.

Real-data findings (the interesting part)

  1. First _SPX replication: 17.11 from 204+108 strikes (29.5/32.5-day bracket). The snapshot predates today's close, so the first matched published-VIX comparison lands with tomorrow's scrape; MAD accrues daily from here.
  2. The 2026-07-08 FXE snapshot has zero-bid OTM wings on every expiry — ITM sides quoted, strip unusable. MFIV correctly refuses. Response (ADR 0002 addendum): the scrape task now fires twice daily with the mid-US-morning run as primary; term selection runs over usable expiries only (min_strip_strikes). This quote-quality regime is plausibly part of why CBOE decommissioned EVZ, and it goes in the paper.

Decisions taken autonomously (per gate delegation)

Carry-forward fallback with q = EUR overnight for FXE; K0 stepped to the nearest quoted strike when the literal white-paper K0 is quoteless; DFF/ESTR converted 365 ln(1+R/360); multi-root expiries resolved to the root with more two-sided quotes.

@NavyBlueCheese
NavyBlueCheese merged commit a240b46 into main Jul 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant