ProbSurface extends single-expiry probability analysis to the full term structure. It calibrates a volatility smile at each listed expiry inside your horizon, interpolates between those pillars, and lets you query densities, CDFs, and quantiles within the calibrated range. The walkthrough below covers the complete workflow from data download to per-maturity slicing.
Fetch chain
Pass The returned
horizon to sources.fetch_chain to automatically fetch every listed expiry within the requested window. The horizon string uses w for weeks, m for months, and y for years.chain_surface is a single DataFrame containing all expiries. The snapshot_surface is a VendorSnapshot with .asof, .underlying_price, and .vendor.Fit
ProbSurface.from_chain fits SVI smiles at each expiry and wires up a total-variance interpolator for arbitrary-maturity queries.failure_policy is "skip_warn", so individual expiries that fail to calibrate are skipped and recorded as WorkflowWarning events rather than aborting the whole fit. Pass failure_policy="raise" to make the first failure fatal.Fan chart
plot_fan draws risk-neutral quantile bands across all fitted maturities, giving you an at-a-glance view of how uncertainty spreads over time.
Query
The
t parameter accepts a year-fraction float, including decimals, or a date-like value. Both forms work on pdf, cdf, and quantile, as long as the maturity falls within the fitted range.When you pass a date that falls between two fitted expiry pillars,
ProbSurface interpolates the volatility surface using a total-variance linear interpolator, then materializes the probability distribution at that synthetic maturity.Slice
List the expiries that were successfully fitted with
surface.expiries, then call surface.slice(expiry) to get a ProbCurve at any listed maturity. A sliced ProbCurve supports all the same query methods as one built directly from ProbCurve.from_chain.ProbSurface.from_chain requires at least two expiries. If your chain contains only one expiry, OIPD raises a CalculationError and asks you to use ProbCurve.from_chain instead. Surface queries are limited to positive maturities up to the last fitted expiry.