Expand description
§volsurf
Production-ready volatility surface library for derivatives pricing.
Provides the full pipeline: raw option quotes → implied vol extraction → parametric surface fitting → arbitrage-free enforcement → local vol / pricing engine input.
§Architecture
implied— Implied volatility extraction (Black, Bachelier, displaced diffusion)smile— Single-tenor smile models (SVI, SABR, cubic spline)surface— Multi-tenor surface construction (SSVI, eSSVI, piecewise)local_vol— Dupire local volatility extraction
§Design
- Newtypes for inputs and outputs.
Vol,Variancewrap return values to prevent accidental mixing.Strike,Tenorwrap inputs for compile-time parameter-swap safety — e.g.,black_vol(Tenor(0.5), Strike(100.0))cannot be transposed. - No panics. Every fallible operation returns
Result. Library code never callsunwrap()orexpect(). - Immutable surfaces. Once constructed, a surface cannot be modified. No interior mutability, no observer pattern.
- Thread-safe. All traits require
Send + Sync. Surfaces can be shared viaArc<dyn VolSurface>across pricing threads. - Serializable. All value types and model structs implement Serde
Serialize/Deserializewith validation on deserialization where invariants exist (SVI, SABR, SSVI, eSSVI parameters).
Modules§
- calibration
- Calibration configuration types shared across smile models.
- conventions
- Market conventions for volatility surfaces.
- error
- Error types for the volsurf library.
- implied
- Implied volatility extraction from option prices.
- local_
vol - Local volatility extraction from implied volatility surfaces.
- smile
- Single-tenor volatility smile models.
- surface
- Multi-tenor volatility surface construction.
- types
- Core domain types for volatility surface construction.
Structs§
- Data
Filter - Pre-calibration data filter for strike/vol cleaning.
- Strike
- Strike price
Kof an option contract. - Tenor
- Time to expiry
Tin years (annualized). - Variance
- Total variance
σ²Tor instantaneous varianceσ². - Vol
- Implied volatility
σ, measured as annualized standard deviation.
Enums§
- Option
Type - Option type: call or put.
- VolSurf
Error - Errors that can occur during volatility surface construction and queries.
- Weighting
Scheme - Weighting scheme for calibration objective function.
Traits§
- Local
Vol - Local volatility surface: σ_loc(T, K).
- Smile
Section - A single-tenor volatility smile.
- VolSurface
- A full volatility surface: (expiry, strike) → vol.
Functions§
- apply_
filter - Filter
(strike, vol)pairs by log-moneyness and minimum vol.
Type Aliases§
- Result
- Convenience type alias for results in this crate.