Skip to content

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:

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.

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:

inputs = surface.inputs()          # VolSurface -> VolSurfaceInputs
surface = surface_from_inputs(inputs)  # VolSurfaceInputs -> VolSurface