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
str
default:"svi"
Calibration algorithm. Currently
"svi" is the supported method.Literal['black76', 'bs']
default:"black76"
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.Literal['mid', 'last']
default:"mid"
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.int
default:"3"
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.pd.DataFrame
required
Option chain DataFrame containing a single expiry. Must include an
expiry column and at least one supported price column (last_price, or bid/ask).MarketInputs
required
Market inputs providing the risk-free rate, valuation date, and underlying price.
dict[str, str] | None
default:"None"
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.VolCurve
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.
tuple[float, float] | None
default:"None"
Optional
(min_strike, max_strike) range. Inferred from the data when omitted.int
default:"200"
Number of strike points to sample for the fitted curve.
bool
default:"True"
Whether to include observed market IV columns (bid IV, ask IV, last IV) in the output.
pd.DataFrame
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.
Literal['strike', 'log_moneyness']
default:"strike"
X-axis mode.
"log_moneyness" requires a positive forward price in fit metadata.Literal['iv', 'total_variance']
default:"iv"
Metric on the y-axis.
bool
default:"True"
Whether to overlay observed market data points.
tuple[float, float]
default:"(10, 5)"
Figure size as (width, height) in inches.
str | None
default:"None"
Custom title. Auto-generated from fit metadata when omitted.
tuple[float, float] | None
default:"None"
Optional x-axis limits.
tuple[float, float] | None
default:"None"
Optional y-axis limits.
matplotlib.figure.Figure
The rendered matplotlib figure.
price(strikes, call_or_put)
price(strikes, call_or_put)
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.
float | Sequence[float] | np.ndarray
required
One or more strike prices.
Literal['call', 'put']
default:"call"
Option type for directional Greeks (delta, theta, rho).
pd.DataFrame
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.int | None
default:"None"
Native probability grid size.
None uses the adaptive default policy.Literal['warn', 'raise']
default:"warn"
Policy for CDF monotonicity violations.
"warn" repairs and warns; "raise" fails on material violations.ProbCurve
The implied risk-neutral probability distribution.
ValueError if fit has not been called.Properties
float
At-the-money implied volatility, defined at Strike = Forward Price. Returned in decimal form (e.g.,
0.20 for 20%).float | None
The parity-implied forward price used in calibration. Returns
None if not available.dict
Fitted SVI parameters:
a, b, rho, m, and sigma.dict
Calibration diagnostics captured during fitting, such as
{"rmse": 0.0012}.tuple
A 1-element tuple containing the fitted expiry timestamp. Returns an empty tuple if the curve has not been fitted.
ResolvedMarket
Immutable snapshot of the market inputs used during calibration.
WarningDiagnostics
Structured diagnostic events for this curve. Inspect
.warning_diagnostics.events for data-quality and model-risk details.