moru_quant/lib.rs
1//! # moru-quant
2//!
3//! Rust library for quantitative finance and derivatives valuation: option
4//! pricing, implied volatility, Greeks, yield curves, and finite-difference /
5//! Monte Carlo engines.
6//!
7//! The repository's `docs/design/architecture.md` describes the planned
8//! module layout.
9//!
10//! ## API map
11//!
12//! | Module | Purpose | Start from |
13//! |---|---|---|
14//! | [`math`] | Special functions: standard normal PDF, CDF, inverse CDF | [`math::normal::cdf`] |
15//! | [`analytic`] | Closed-form prices: generalized Black–Scholes–Merton | [`analytic::bsm::Inputs::new`], then [`analytic::bsm::price`] |
16//!
17//! Every fallible function returns [`Error`], which names the rejected
18//! input and its value, or the derived quantity that is not representable.
19//!
20//! ## Example
21//!
22//! ```
23//! use moru_quant::analytic::bsm::{self, Inputs};
24//! use moru_quant::analytic::OptionType;
25//!
26//! // Futures option (Black 1976): cost of carry b = 0.
27//! let inputs = Inputs::new(19.0, 19.0, 0.10, 0.0, 0.28, 0.75)?;
28//! let call = bsm::price(OptionType::Call, &inputs);
29//! assert!((call - 1.7011).abs() < 5e-5);
30//! # Ok::<(), moru_quant::Error>(())
31//! ```
32
33pub mod analytic;
34mod error;
35pub mod math;
36
37pub use error::{Error, Input};