VolCurve fits an implied volatility smile for a single option expiry using the SVI parametrization. After calling fit, you can query implied volatilities, total variance, option prices, and all standard Greeks across any set of strikes. You can also derive the full risk-neutral probability distribution from the fitted smile via implied_distribution.
Constructor
Calibration algorithm. Currently
"svi" is the supported method.Pricing model used for implied volatility inversion. Use
"black76" for options on futures or forwards, and "bs" for spot options (Black-Scholes). The choice affects how Greeks are computed and how the forward price is resolved.Quote type to fit against.
"mid" uses the midpoint of bid and ask, with last_price as a fallback when available. "last" fits against last_price.Maximum age of option quotes in calendar days, relative to the valuation date. Rows older than this threshold are excluded before fitting.
Methods
fit(chain, market, column_mapping)
fit(chain, market, column_mapping)
Calibrate the SVI smile to market data. Must be called before any query method. Returns Raises:
self for chaining.Option chain DataFrame containing a single expiry. Must include an
expiry column and at least one supported price column (last_price, or bid/ask).Market inputs providing the risk-free rate, valuation date, and underlying price.
Optional mapping in the form
{"dataframe_column": "oipd_column"}. For example, {"type": "option_type"} means your DataFrame has a type column and OIPD should treat it as option_type. See Standard columns for the target names.The fitted
VolCurve instance (self), enabling method chaining.ValueError if the expiry column is missing, invalid, or contains multiple expiries. CalculationError if calibration fails.implied_vol(strikes)
implied_vol(strikes)
total_variance(strikes)
total_variance(strikes)
iv_results(domain, points, include_observed)
iv_results(domain, points, include_observed)
Return a DataFrame comparing the fitted smile against market observations. Useful for inspecting calibration quality.
Optional
(min_strike, max_strike) range. Inferred from the data when omitted.Number of strike points to sample for the fitted curve.
Whether to include observed market IV columns (bid IV, ask IV, last IV) in the output.
DataFrame with columns including
strike and fitted_iv, plus optional observed market IV columns when include_observed=True.plot(x_axis, y_axis, include_observed, figsize, title, xlim, ylim)
plot(x_axis, y_axis, include_observed, figsize, title, xlim, ylim)
Plot the fitted implied volatility smile.
X-axis mode.
"log_moneyness" requires a positive forward price in fit metadata.Metric on the y-axis.
Whether to overlay observed market data points.
Figure size as (width, height) in inches.
Custom title. Auto-generated from fit metadata when omitted.
Optional x-axis limits.
Optional y-axis limits.
The rendered matplotlib figure.
price(strikes, call_or_put)
price(strikes, call_or_put)
Calculate theoretical option prices using the fitted volatility and the configured pricing engine.
One or more strike prices.
Option type. Put prices are derived via put-call parity.
Theoretical option prices.
delta(strikes, call_or_put)
delta(strikes, call_or_put)
gamma(strikes)
gamma(strikes)
vega(strikes)
vega(strikes)
theta(strikes, call_or_put)
theta(strikes, call_or_put)
rho(strikes, call_or_put)
rho(strikes, call_or_put)
greeks(strikes, call_or_put)
greeks(strikes, call_or_put)
Calculate all Greeks at once and return them as a single DataFrame.
One or more strike prices.
Option type for directional Greeks (delta, theta, rho).
DataFrame with columns
strike, delta, gamma, vega, theta, and rho.implied_distribution(grid_points, cdf_violation_policy)
implied_distribution(grid_points, cdf_violation_policy)
Derive the risk-neutral probability distribution from the fitted smile. Returns a Raises:
ProbCurve.Native probability grid size.
None uses the adaptive default policy.Policy for CDF monotonicity violations.
"warn" repairs and warns; "raise" fails on material violations.The implied risk-neutral probability distribution.
ValueError if fit has not been called.Properties
At-the-money implied volatility, defined at Strike = Forward Price. Returned in decimal form (e.g.,
0.20 for 20%).The parity-implied forward price used in calibration. Returns
None if not available.Fitted SVI parameters:
a, b, rho, m, and sigma.Calibration diagnostics captured during fitting, such as
{"rmse": 0.0012}.A 1-element tuple containing the fitted expiry timestamp. Returns an empty tuple if the curve has not been fitted.
Immutable snapshot of the market inputs used during calibration.
Structured diagnostic events for this curve. Inspect
.warning_diagnostics.events for data-quality and model-risk details.