rustyqlib/lib.rs
1//! # RustyQLib
2//!
3//! A lightweight quantitative finance library for pricing derivatives and
4//! performing risk analysis.
5//!
6//! The crate is organised into asset-class modules:
7//!
8//! - [`core`] — shared building blocks: traits ([`core::traits::Instrument`]),
9//! quotes, term structures, interpolation and data models
10//! - [`equity`] — equity options, forwards and futures with Black-Scholes,
11//! binomial, Monte Carlo and finite-difference engines
12//! - [`rates`] — interest-rate instruments (deposits, FRAs) and curve building
13//! - [`risk`] — VaR / Expected Shortfall, portfolio scenario risk, volatility
14//! estimation, performance statistics and VaR backtesting
15//! - [`cmdty`] — commodity options
16//! - [`utils`] — random number generation, stochastic processes and the
17//! JSON/CLI plumbing used by the `rustyqlib` binary
18//!
19//! # Example
20//!
21//! Pricing contracts from JSON is the primary workflow (see the `examples/`
22//! directory in the repository); the same types can be constructed directly
23//! and priced through the [`core::traits::Instrument`] trait.
24
25pub mod cmdty;
26pub mod core;
27pub mod equity;
28pub mod rates;
29pub mod risk;
30pub mod utils;
31
32pub use crate::core::curves::{Compounding, CurveInput, InterpolationMethod, Tenor, YieldCurve};
33pub use crate::core::errors::RustyQLibError;
34pub use crate::core::results::{Greeks, PricingResult};
35pub use crate::equity::black76::FuturesSettlement;
36pub use crate::equity::builder::EquityOptionBuilder;
37pub use crate::core::depth::{DepthLevel, MarketDepth};
38pub use crate::core::market::{
39 BumpMode, Depth, Discount, Market, MarketKey, RiskFactor, Shock, Spot, Vol,
40};
41pub use crate::core::quotes::Quote;
42pub use crate::core::calendar::{BusinessDayConvention, Calendar, DateGeneration, Period, Schedule};
43pub use crate::core::daycount::DayCountConvention;
44pub use crate::core::traits::Instrument;
45pub use crate::core::vols::{VolInput, VolSurface};