|
1 | | -# Option Pricing |
| 1 | +# Options |
2 | 2 |
|
3 | | -The `options` module provides classes and functions for pricing and analyzing options. |
4 | | -The main class is the [VolSurface][quantflow.options.surface.VolSurface] class which is used to represent a volatility surface for a given asset. |
5 | | -A volatility surface is usually created via a [VolSurfaceLoader][quantflow.options.surface.VolSurfaceLoader] object. |
| 3 | +The `options` module provides classes and functions for pricing and calibrating options. |
| 4 | + |
| 5 | +## Volatility Surface |
| 6 | + |
| 7 | +The central class is [VolSurface][quantflow.options.surface.VolSurface], which represents |
| 8 | +the implied volatility surface for an asset across all strikes and maturities. It holds: |
| 9 | + |
| 10 | +- a [SpotPrice][quantflow.options.surface.SpotPrice] for the underlying asset |
| 11 | +- a sorted tuple of [VolCrossSection][quantflow.options.surface.VolCrossSection] objects, one per maturity |
| 12 | + |
| 13 | +Each [VolCrossSection][quantflow.options.surface.VolCrossSection] contains the forward price |
| 14 | +at that maturity and a tuple of [Strike][quantflow.options.surface.Strike] objects. |
| 15 | +Each [Strike][quantflow.options.surface.Strike] holds a call and/or put as an |
| 16 | +[OptionPrices][quantflow.options.surface.OptionPrices], which in turn pairs a bid and ask |
| 17 | +[OptionPrice][quantflow.options.surface.OptionPrice]. |
| 18 | + |
| 19 | +A surface is typically constructed via [VolSurfaceLoader][quantflow.options.surface.VolSurfaceLoader], |
| 20 | +which accepts price inputs incrementally and builds the surface through its `surface()` method. |
| 21 | +The lower-level [GenericVolSurfaceLoader][quantflow.options.surface.GenericVolSurfaceLoader] |
| 22 | +provides the same functionality with a user-defined security type. |
| 23 | + |
| 24 | +## Price Classes |
| 25 | + |
| 26 | +| Class | Description | |
| 27 | +|---|---| |
| 28 | +| [Price][quantflow.options.surface.Price] | Base bid/ask price for any security | |
| 29 | +| [SpotPrice][quantflow.options.surface.SpotPrice] | Spot bid/ask price of an underlying asset | |
| 30 | +| [FwdPrice][quantflow.options.surface.FwdPrice] | Forward bid/ask price at a specific maturity | |
| 31 | +| [OptionPrice][quantflow.options.surface.OptionPrice] | Single-sided option price with implied volatility and convergence flag | |
| 32 | +| [OptionPrices][quantflow.options.surface.OptionPrices] | Paired bid and ask [OptionPrice][quantflow.options.surface.OptionPrice] for a given strike and option type | |
| 33 | + |
| 34 | +## Input Classes |
| 35 | + |
| 36 | +The input classes are plain data containers used to serialize and deserialize volatility surface data, |
| 37 | +for example when storing or transmitting a snapshot of the surface. |
| 38 | + |
| 39 | +| Class | Description | |
| 40 | +|---|---| |
| 41 | +| [VolSurfaceInputs][quantflow.options.inputs.VolSurfaceInputs] | Top-level container: asset name, reference date, and a list of inputs | |
| 42 | +| [VolSurfaceInput][quantflow.options.inputs.VolSurfaceInput] | Base input with bid, ask, open interest and volume | |
| 43 | +| [SpotInput][quantflow.options.inputs.SpotInput] | Input for a spot price | |
| 44 | +| [ForwardInput][quantflow.options.inputs.ForwardInput] | Input for a forward price with maturity | |
| 45 | +| [OptionInput][quantflow.options.inputs.OptionInput] | Input for an option with strike, maturity, type, and optional implied vols | |
| 46 | + |
| 47 | +A [VolSurface][quantflow.options.surface.VolSurface] can be round-tripped via: |
| 48 | + |
| 49 | +```python |
| 50 | +inputs = surface.inputs() # VolSurface -> VolSurfaceInputs |
| 51 | +surface = surface_from_inputs(inputs) # VolSurfaceInputs -> VolSurface |
| 52 | +``` |
0 commit comments