Options¶
The options module provides classes and functions for pricing and calibrating options.
Volatility Surface¶
The central class is VolSurface, which represents the implied volatility surface for an asset across all strikes and maturities. It holds:
- a SpotPrice for the underlying asset
- a sorted tuple of VolCrossSection objects, one per maturity
Each VolCrossSection contains the forward price at that maturity and a tuple of Strike objects. Each Strike holds a call and/or put as an OptionPrices, which in turn pairs a bid and ask OptionPrice.
A surface is typically constructed via VolSurfaceLoader,
which accepts price inputs incrementally and builds the surface through its surface() method.
The lower-level GenericVolSurfaceLoader
provides the same functionality with a user-defined security type.
Pricing¶
| Class | Description |
|---|---|
| black_price | Undiscounted Black call/put prices in forward space |
| BlackSensitivities | Black model sensitivities (Greeks) in forward space |
| implied_black_volatility | Implied Black volatility via Newton's method |
| SVI | SVI parameterisation of a single-maturity volatility smile |
| SSVI | SSVI parameterisation of the full volatility surface |
| DIVFMPricer | Deep Implied Volatility Factor Model pricer |
| OptionPricer | Option pricing with stochastic process models |
| VolModelCalibration | Base class for calibrating vol models (Heston and BNS variants) to a surface |
| PutCallParity | Put-call parity relationships between calls, puts and forwards |
| moneyness | Conversions between strike, log-strike and moneyness |
Price Classes¶
| Class | Description |
|---|---|
| Price | Base bid/ask price for any security |
| SpotPrice | Spot bid/ask price of an underlying asset |
| FwdPrice | Forward bid/ask price at a specific maturity |
| OptionPrice | Single-sided option price with implied volatility and convergence flag |
| OptionPrices | Paired bid and ask OptionPrice for a given strike and option type |
Input Classes¶
The input classes are plain data containers used to serialize and deserialize volatility surface data, for example when storing or transmitting a snapshot of the surface.
| Class | Description |
|---|---|
| VolSurfaceInputs | Top-level container: asset name, reference date, and a list of inputs |
| VolSurfaceInput | Base input with bid, ask, open interest and volume |
| SpotInput | Input for a spot price |
| ForwardInput | Input for a forward price with maturity |
| OptionInput | Input for an option with strike, maturity, type, and optional implied vols |
A VolSurface can be round-tripped via: