Skip to main content

Crate moru_quant

Crate moru_quant 

Source
Expand description

§moru-quant

Rust library for quantitative finance and derivatives valuation: option pricing, implied volatility, Greeks, yield curves, and finite-difference / Monte Carlo engines.

The repository’s docs/design/architecture.md describes the planned module layout.

§API map

ModulePurposeStart from
mathSpecial functions: standard normal PDF, CDF, inverse CDFmath::normal::cdf
analyticClosed-form prices: generalized Black–Scholes–Mertonanalytic::bsm::Inputs::new, then analytic::bsm::price

Every fallible function returns Error, which names the rejected input and its value, or the derived quantity that is not representable.

§Example

use moru_quant::analytic::bsm::{self, Inputs};
use moru_quant::analytic::OptionType;

// Futures option (Black 1976): cost of carry b = 0.
let inputs = Inputs::new(19.0, 19.0, 0.10, 0.0, 0.28, 0.75)?;
let call = bsm::price(OptionType::Call, &inputs);
assert!((call - 1.7011).abs() < 5e-5);

Modules§

analytic
Closed-form option pricing.
math
Numerical building blocks shared by the pricing modules.

Enums§

Error
An input rejected at the API boundary.
Input
A named input of a pricing function.