statisTracker
07 // Methodology

Models, conventions, limits

Every number on this platform is produced by the in-repo TypeScript quant engine (src/lib/quant), unit-tested against textbook values, finite-difference Greeks, and Monte Carlo cross-checks. This page states the models, their conventions, and their limits.

1. Black–Scholes–Merton pricing and Greeks

European options on dividend-paying equities are priced under Merton (1973) with continuous yield q:

d₁ = [ln(S/K) + (r − q + σ²/2)T] / (σ√T),   d₂ = d₁ − σ√T
C = S e⁻ᑫᵀ N(d₁) − K e⁻ʳᵀ N(d₂),   P = K e⁻ʳᵀ N(−d₂) − S e⁻ᑫᵀ N(−d₁)

The engine reports delta, gamma, vega, theta, rho plus the second-order vanna (∂Δ/∂σ), volga (∂vega/∂σ), and charm (∂Δ/∂t). The normal CDF is Hart's double-precision rational approximation (West 2005); all Greeks are verified against central finite differences in the test suite. Time is ACT/365; r comes from the 13-week T-bill (^IRX) each session.

2. Implied volatility

Inversion uses safeguarded Newton–Raphson seeded with Brenner–Subrahmanyam, maintaining a shrinking bisection bracket so a bad vega step can never escape, with Brent's method as the fallback. Round-trip accuracy is ~10⁻⁶ vol points wherever an option carries measurable time value.

3. American options — Leisen–Reimer lattice

Listed single-name options are American. The DerivLab engine prices them on a Leisen–Reimer (1996) binomial lattice with Peizer–Pratt method-2 inversion — strike-centered nodes give smooth O(1/n²) convergence versus CRR's oscillating O(1/n). The early-exercise premium is reported as American minus European on the same lattice. Smile construction uses OTM contracts where the early-exercise premium is smallest (and zero for calls on non-dividend payers, by Merton).

4. Monte Carlo engine

Risk-neutral GBM with antithetic variates and deterministic seeding (mulberry32 + Box–Muller). The pricer panel runs 60k paths in the browser and reports the 95% confidence interval next to the analytic and lattice values — agreement across three independent methods is the correctness argument.

5. Forward, carry, and put–call parity

C − P = e⁻ʳᵀ (F − K) ⇒ F = K + eʳᵀ (C − P)

Each strike with two-sided call and put quotes yields an implied forward; the median across the 11 strikes nearest spot is the robust estimate. Implied carry follows from F = S e⁽ʳ⁻ᑫ⁾ᵀ — this q absorbs dividends and borrow, which matters for hard-to-borrow names.

6. Smile fitting — raw SVI

Per expiry, total implied variance w(k) = σ²T at log-moneyness k = ln(K/F) is fitted with Gatheral's raw SVI:

w(k) = a + b [ρ(k − m) + √((k − m)² + s²)]

calibrated by multi-start Nelder–Mead least squares with penalty terms enforcing b ≥ 0, |ρ| < 1, s > 0 and w ≥ 0. The Durrleman g-function is exposed for butterfly-arbitrage checks. Only OTM mid quotes with spread/mid ≤ 150% enter the fit.

7. Risk-neutral density — Breeden–Litzenberger

f(K) = eʳᵀ ∂²C/∂K²,   P(S_T > K) = −eʳᵀ ∂C/∂K

Differentiating raw quotes amplifies noise, so the density is taken on a dense strike grid priced off the fitted SVI smile (±4 standard deviations in log space, 241 nodes, non-uniform central differences). Tests confirm the density integrates to 1, its mean recovers the forward, and its exceedance matches N(d₂) under a flat smile.

8. Realized volatility estimators

Close-to-close, Parkinson, Garman–Klass, Rogers–Satchell, Yang–Zhang (drift-independent, overnight-aware — the headline RV on the dashboard), and RiskMetrics EWMA (λ = 0.94), all annualized on 252 days. The IV−RV spread on the dashboard is the classic variance risk-premium proxy.

9. Prediction markets as digital options

A YES contract paying $1 at price c is a cash-or-nothing digital: its no-arbitrage value is the discounted risk-neutral probability. The options side of the same event is priced from the exceedance curve; with a smile, the replication-consistent digital includes the skew correction −vega·∂σ/∂K (vertical-spread limit). Supporting tools: Kalshi fee model (7% · c · (1−c)), overround removal (proportional and power de-vig), Kelly sizing f* = p − (1−p)c/(1−c), Brier and log scoring, and two-venue arbitrage detection (YES on A + NO on B < $1).

10. Cross-market basis — read it honestly

The basis (market YES − options-implied probability) is not free alpha. Legitimate wedges include: risk premia (option densities are risk-neutral; event prices embed real-world beliefs plus risk aversion), venue fees and collateral yield, settlement-term mismatches (official close vs last trade; touch contracts settle on any print), the American/European approximation, the ±21-day expiry alignment tolerance, and 15-minute delayed quotes. Touch contracts use the reflection approximation P(touch) ≈ 2·P(beyond at expiry), exact only for driftless GBM. The dashboard flags |basis| > 5pp for investigation, not execution.

Data sources & limitations

CBOE delayed quotes (chains, exchange IV/Greeks), Yahoo Finance (bars, spot, ^IRX) with Stooq fallback, Polymarket Gamma API, Kalshi trade API v2, Manifold API. All free, delayed, unauthenticated endpoints — this is a research and demonstration platform, not an execution system. The Python research pipeline under research/ reproduces the vol-surface and cross-market studies offline with pandas, following the patterns in Python for Algorithmic Trading Cookbook (2nd ed.).