SSVI Volatility Surface¶
quantflow.options.ssvi.VarianceCurve
pydantic-model
¶
Bases: BaseModel
Monotone interpolated total ATM variance curve.
The curve stores total ATM variances \(\theta_i = w(0, \tau_i)\) at strictly increasing maturities \(\tau_i\). Static arbitrage requires the total ATM variance curve to be non decreasing:
The nodes are validated to satisfy this condition, then interpolated with a shape preserving cubic Hermite spline (PCHIP). For non decreasing nodes, PCHIP is monotone between nodes and therefore preserves the condition.
Fields:
-
ttm(list[DecimalNumber]) -
theta(list[DecimalNumber])
theta
pydantic-field
¶
Total ATM variances at each maturity, same length as ttm, positive and non decreasing
total_variance
¶
Interpolated total ATM variance \(\theta(\tau)\).
| PARAMETER | DESCRIPTION |
|---|---|
ttm
|
Time to maturity in years, scalar or array
TYPE:
|
Source code in quantflow/options/ssvi.py
derivative
¶
Derivative \(d\theta / d\tau\) of the interpolated variance curve.
| PARAMETER | DESCRIPTION |
|---|---|
ttm
|
Time to maturity in years, scalar or array
TYPE:
|
Source code in quantflow/options/ssvi.py
is_non_decreasing
¶
quantflow.options.ssvi.SSVI
pydantic-model
¶
Bases: BaseModel
Surface SVI (SSVI) parametrisation of the implied volatility surface, introduced by Gatheral and Jacquier (2014).
The SSVI parametrisation expresses the total implied variance \(w(k) = \sigma^2(k) \cdot \tau\) as a function of log-strike \(k = \log(K/F)\) and the total ATM variance \(\theta_\tau = w(0, \tau)\):
The shape function \(\varphi\) uses the power law form:
Each instance represents the surface through shared parameters \(\rho\), \(\eta\) and \(\gamma\) together with a monotone total ATM variance curve \(\theta(\tau)\). A single maturity slice is represented by a one node [VarianceCurve][quantflow.options.ssvi.SSVI.VarianceCurve].
Use fit_surface to jointly calibrate the global parameters and variance curve across several maturities. A surface built this way is free of static arbitrage provided each slice satisfies no_butterfly_arbitrage and the ATM variance curve is non decreasing in maturity, \(d\theta / d\tau \geq 0\).
Fields:
-
rho(Decimal) -
eta(Decimal) -
gamma(Decimal) -
variance_curve(VarianceCurve)
rho
pydantic-field
¶
Correlation parameter controlling the skew of the smile. Negative values produce a left-skewed smile (typical for equities), positive values produce a right skew. Must satisfy \(|\rho| < 1\).
eta
pydantic-field
¶
Level of the power law shape function \(\varphi\). Larger values steepen the smile away from the money. Must be strictly positive.
gamma
pydantic-field
¶
Exponent of the power law shape function \(\varphi\), controlling how the smile curvature decays as the at-the-money total variance grows. Must lie in \((0, 1]\).
variance_curve
pydantic-field
¶
Monotone interpolated total ATM variance curve \(\theta(\tau) = \sigma_{ATM}^2 \cdot \tau\).
phi
¶
Power law shape function \(\varphi(\theta(\tau))\).
| PARAMETER | DESCRIPTION |
|---|---|
ttm
|
Time to maturity in years, scalar or array
TYPE:
|
Source code in quantflow/options/ssvi.py
total_variance
¶
Total implied variance \(w(k, \tau)\).
Returns an array broadcast from the shapes of \(k\) and \(\tau\).
| PARAMETER | DESCRIPTION |
|---|---|
k
|
Log-moneyness log(K/F), scalar or array
TYPE:
|
ttm
|
Time to maturity in years, scalar or array
TYPE:
|
Source code in quantflow/options/ssvi.py
iv
¶
Implied volatility \(\sigma(k, \tau) = \sqrt{w(k, \tau) / \tau}\).
Returns an array of the same shape as \(k\). The SSVI total variance is strictly positive for \(|\rho| < 1\), so no clipping is required.
| PARAMETER | DESCRIPTION |
|---|---|
k
|
Log-moneyness log(K/F), scalar or array
TYPE:
|
ttm
|
Time to maturity in years, scalar or array
TYPE:
|
Source code in quantflow/options/ssvi.py
no_butterfly_arbitrage
¶
True if the slice satisfies the sufficient conditions for absence of butterfly arbitrage.
The conditions, from Theorem 4.2 of Gatheral and Jacquier (2014), are:
| PARAMETER | DESCRIPTION |
|---|---|
ttm
|
Optional maturity to check. All curve nodes are checked when omitted
TYPE:
|
Source code in quantflow/options/ssvi.py
no_static_arbitrage
¶
fit_surface
classmethod
¶
Jointly fit the SSVI surface to several maturity slices via non-linear least squares.
The global parameters rho, eta and gamma are shared across all slices, while the maturity dependent total ATM variance is represented by a monotone VarianceCurve. The fitted variables are the shared parameters \(\rho\), \(\eta\) and \(\gamma\), plus positive increments for the total ATM variance curve. The increment parameterisation guarantees \(d\theta / d\tau \geq 0\).
| PARAMETER | DESCRIPTION |
|---|---|
slices
|
One (log-moneyness, implied volatilities, time to maturity) tuple per maturity slice
TYPE:
|
Source code in quantflow/options/ssvi.py
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 | |
fit_vol_surface
classmethod
¶
Fit an SSVI model to a volatility surface.
| PARAMETER | DESCRIPTION |
|---|---|
surface
|
Volatility surface with calculated implied volatilities and converged options
TYPE:
|