1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// Copyright 2026 Regit.io — Nicolas Koenig
// SPDX-License-Identifier: Apache-2.0
//! Arbitrage-free SVI volatility surfaces in pure Rust.
//!
//! `regit-svi` parametrises the implied volatility smile and surface with the
//! Stochastic Volatility Inspired (SVI) family — Raw SVI (Gatheral 2004),
//! SVI Jump-Wings, and the Surface SVI (SSVI) of Gatheral & Jacquier (2014) —
//! together with calibration to market quotes and explicit static-arbitrage
//! checks (butterfly and calendar-spread).
//!
//! Designed for auditability: every formula is hand-rolled from primary paper
//! sources with no external dependencies. A regulator, quant auditor, or new
//! engineer can trace every number to a citable derivation in [`MATH.md`].
//!
//! [`MATH.md`]: https://github.com/org-regit-io/regit-svi/blob/main/MATH.md
//!
//! # Quick start
//!
//! ```
//! use regit_svi::{Quote, calibration::quasi_explicit};
//!
//! // Market quotes for one maturity: (log-moneyness, total variance, weight).
//! let quotes = [
//! Quote::new(-0.20, 0.0512, 1.0).unwrap(),
//! Quote::new(-0.10, 0.0432, 1.0).unwrap(),
//! Quote::new( 0.00, 0.0400, 1.0).unwrap(),
//! Quote::new( 0.10, 0.0420, 1.0).unwrap(),
//! Quote::new( 0.20, 0.0480, 1.0).unwrap(),
//! ];
//!
//! // Calibrate a raw SVI slice (quasi-explicit, de Marco-Martini).
//! let fit = quasi_explicit::calibrate("es).unwrap();
//!
//! // Evaluate total variance and implied volatility anywhere on the slice.
//! let w = fit.slice.total_variance(0.05);
//! let vol = fit.slice.implied_vol(0.05, 1.0).unwrap();
//! assert!(w > 0.0 && vol > 0.0);
//!
//! // Certify the slice is free of butterfly arbitrage.
//! assert!(fit.butterfly_free);
//! ```
//!
//! # Architecture
//!
//! ```text
//! types log-moneyness, total variance, market quotes (Quote)
//! errors typed errors for parametrisation, conversion, calibration
//! math numerical primitives — Nelder-Mead, Levenberg-Marquardt,
//! linear least-squares (Cholesky), Brent root-finder
//!
//! raw Raw SVI w(k) = a + b(rho(k-m) + sqrt((k-m)^2 + sigma^2))
//! jw SVI Jump-Wings parametrisation (trader-facing parameters)
//! ssvi Surface SVI w(k, theta) — arbitrage-free whole-surface form
//! convert conversions between Raw, Jump-Wings, and SSVI slices
//!
//! arbitrage butterfly (g(k) >= 0) and calendar-spread checks
//! density risk-neutral density implied by a slice
//!
//! calibration/
//! quasi_explicit de Marco-Martini / Zeliade quasi-explicit slice fit
//! least_squares direct Levenberg-Marquardt slice fit
//! ssvi joint SSVI surface calibration
//!
//! surface multi-slice surface assembly and interpolation
//! ```
//!
//! Part of [Regit OS](https://www.regit.io) — the operating system for
//! investment products. From Luxembourg.
// ─── Re-exports for ergonomic top-level access ─────────────────────────────
pub use ;
pub use CalibrationResult;
pub use ;
pub use DensityReport;
pub use ;
pub use SviJw;
pub use RawSvi;
pub use ;
pub use Surface;
pub use ;