regit_blackscholes/lib.rs
1// Copyright 2026 Regit.io — Nicolas Koenig
2// SPDX-License-Identifier: Apache-2.0
3
4//! Zero-dependency Black-Scholes options pricing engine in pure Rust.
5//!
6//! Covers four European pricing models — Black-Scholes-Merton, Black-76,
7//! Bachelier, and Displaced Diffusion — with all 17 analytic Greeks through
8//! 3rd order and a multi-strategy implied volatility solver.
9//!
10//! Designed for auditability: every algorithm is hand-rolled from primary
11//! paper sources with no external math dependencies. A regulator, quant
12//! auditor, or new engineer can trace every number to a citable formula.
13//!
14//! # Models
15//!
16//! - [`models::black_scholes`] — Vanilla European, continuous dividend (Merton 1973)
17//! - [`models::black76`] — Futures/forwards (Black 1976)
18//! - [`models::bachelier`] — Normal model for rates near/below zero
19//! - [`models::displaced`] — Shifted log-normal (Rubinstein 1983)
20//!
21//! # Architecture
22//!
23//! ```text
24//! types/errors → math primitives (ncdf, npdf) → pricing models
25//! → greeks (analytic, 17 total)
26//! → implied volatility (solver chain)
27//! ```
28//!
29//! Part of [Regit OS](https://www.regit.io) — the operating system for
30//! investment products. From Luxembourg.
31
32pub mod errors;
33pub mod greeks;
34pub mod iv;
35pub mod math;
36pub mod models;
37pub mod types;
38
39// ─── Re-exports for ergonomic top-level access ─────────────────────────────
40
41pub use errors::{IvError, PricingError};
42pub use iv::IvSolver;
43pub use models::bachelier::BachelierParams;
44pub use models::black76::Black76Params;
45pub use models::displaced::DisplacedParams;
46pub use types::{Float, Greeks, GreeksCalc, ImpliedVol, Model, OptionParams, OptionType, Pricing};