Expand description
Volatility derivatives: variance swaps (and the volatility-swap strike under GBM).
A variance swap pays notional * (realized variance - strike) at
maturity, with realized variance the annualized mean of squared log
returns (no mean subtraction — the market convention). Its fair
strike is model-free by the log-contract replication
(Demeterfi-Derman-Kamal-Zou 1999):
K_var = (2/T) * [ int_0^F P(K)/K^2 dK + int_F^inf C(K)/K^2 dK ]with undiscounted OTM option prices struck off the forward. On a
flat surface the integral collapses to sigma^2 exactly (the
test checks to 1e-6); a skewed smile adds the convexity that makes
variance strikes trade above ATM vol squared.
The volatility swap (paying realized vol) needs the distribution,
not just the expectation: under GBM the exact fair strike is the
chi-distribution mean sigma * sqrt(2/n) * Gamma((n+1)/2) / Gamma(n/2) — below sigma for finite sampling by Jensen.
Structs§
- Variance
Swap - A (possibly seasoned) variance swap.
- Variance
Swap Data - JSON contract data (
"product_type": "variance_swap").
Functions§
- fair_
corridor_ variance_ strike - Fair corridor variance strike: variance accrues only while the
spot is inside
[low, high](Carr-Lewis), which truncates the replication integral to the corridor’s strikes:K_corr = (2/T) int_low^high Q(K)/K^2 dK. Corridors are exactly additive: adjacent corridors sum to the full variance strike (tested), and the full-line corridor reproducesfair_variance_strike. - fair_
gamma_ swap_ strike - Fair gamma-swap strike: the spot-weighted variance
(1/T) int (S_t/S_0) sigma_t^2 dt, replicated by theS ln Scontract with a1/Kstrike kernel: - fair_
variance_ strike - Model-free fair variance strike by the log-contract replication.
smile(strike) -> implied vol; integration over ten ATM standard deviations of log-strike with a fine Simpson rule. - realized_
corridor_ variance - Realized leg of a corridor variance swap: squared returns accrue
when the previous observation was inside
[low, high](the standard convention). - realized_
gamma_ variance - Realized leg of a gamma swap over a spot path: the annualized
spot-weighted squared returns
(A/n) sum (S_i/S_0) ln(S_i/S_{i-1})^2. - realized_
variance - Annualized realized variance of a log-return series, market convention (mean not subtracted).
- volatility_
swap_ strike_ gbm - Exact fair volatility-swap strike under GBM with
observationssampling dates:sigma sqrt(2/n) Gamma((n+1)/2)/Gamma(n/2), the mean of the chi distribution — strictly belowsigma, converging to it as sampling densifies.