quantrs/lib.rs
1//!
2//! This crate is designed to be simple and easy to use library for options pricing, portfolio optimization, and risk analysis. It is not intended to be a full-fledged quantitative finance library.
3//! The goal is to provide library for pricing options, calculating greeks, and performing basic risk analysis without the need to write complex code or have a PhD in reading quantlib documentation.
4//! The library is still in the early stages of development, and many features are not yet implemented.
5//!
6//! Compared to other popular options pricing libraries, quantrs is _significantly_ faster:
7//! - **29x faster** than `QuantLib` (python bindings)
8//! - **113x faster** than `py_vollib`
9//! - **15x faster** than `RustQuant`
10//! - **2.7x faster** than `Q-Fin`
11//!
12//! _You can find the benchmarks at [quantrs.pages.dev/report](https://quantrs.pages.dev/report/)_.
13//!
14//! ## Options Pricing
15//!
16//! For now quantrs only supports options pricing. The following features are available:
17//!
18//! - Option types: European, American, Asian, Rainbow, Binary Cash-or-Nothing, Binary Asset-or-Nothing
19//! - Option pricing: Black-Scholes, Binomial Tree, Monte Carlo Simulation
20//! - Greeks: Delta, Gamma, Theta, Vega, Rho
21//! - Implied volatility
22//!
23//! ```rust
24//! use quantrs::options::*;
25//!
26//! let option = BinaryOption::cash_or_nothing(Instrument::new().with_spot(100.0), 85.0, 0.78, OptionType::Call);
27//! let model = BlackScholesModel::new(0.05, 0.2);
28//! let price = model.price(&option);
29//! let greeks = Greeks::calculate(&model, &option);
30//! ```
31
32#![allow(unused_variables)]
33
34#[macro_use]
35mod macros {
36 pub mod logging_macros;
37 pub mod math_macros;
38 pub mod validation_macros;
39}
40
41pub mod options;