Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/avhz/RustQuant

Rust library for quantitative finance.
https://github.com/avhz/RustQuant

finance machine-learning math mathematics option-pricing quantitative-finance quantlib regression rust rust-lang statistics stochastic-processes trading

Last synced: 24 days ago
JSON representation

Rust library for quantitative finance.

Lists

README

        

![](./images/logo.png)



License

Crates.io

Crates.io

GitHub Repo stars



GitHub Workflow Status

Codecov

Dependencies



Discord

A Rust library for quantitative finance.

:dart: I want to hit a stable `v0.1.0` by the end of 2023, so any feedback or contributions are strongly welcomed!

| Email | Discord | Latest Changes |
|:----------------------------:|:-------------------------------:|:---------------------------:|
| | | [Changelog](./CHANGELOG.md) |

## Modules

| Module | Description |
|--------|-------------|
| [`autodiff`](https://docs.rs/RustQuant/latest/RustQuant/autodiff/index.html) | Algorithmic adjoint differentiation (AAD) for efficiently computing gradients of scalar output functions $f: \mathbb{R}^n \rightarrow \mathbb{R}$. |
| [`curves`](https://docs.rs/RustQuant/latest/RustQuant/curves/index.html) | Curves and surfaces, such as the yield curve and volatility surface. |
| [`data`](https://docs.rs/RustQuant/latest/RustQuant/data/index.html) | Methods for reading and writing data from/to various sources (CSV, JSON, Parquet). Can also download data from Yahoo! Finance. |
| [`error`](https://docs.rs/RustQuant/latest/RustQuant/error/index.html) | RustQuant error handling module. |
| [`instruments`](https://docs.rs/RustQuant/latest/RustQuant/instruments/index.html) | Various implementations for instruments like `Bonds` and `Options`, and the pricing of them. Others coming in the future (swaps, futures, CDSs, etc). |
| [`iso`](https://docs.rs/RustQuant/latest/RustQuant/iso/index.html) | A few ISO code implementations. Currently: ISO-4217 (currency codes), ISO-3166 (country codes), ISO-10383 (market identifier codes). |
| [`math`](https://docs.rs/RustQuant/latest/RustQuant/math/index.html) | Fast Fourier Transform (FFT), numerical integration (double-exponential quadrature), optimisation/root-finding (gradient descent, Newton-Raphson), and risk-reward metrics. Also some sequence methods such as `linspace` and `cumsum`. |
| [`ml`](https://docs.rs/RustQuant/latest/RustQuant/ml/index.html) | Currently only linear and logistic regression, along with k-nearest neighbours classification are implemented. More to come in the future. |
| [`macros`](https://docs.rs/RustQuant/latest/RustQuant/macros/index.html) | Currently only `plot_vector!()` and `assert_approx_equal!()`. |
| [`money`](https://docs.rs/RustQuant/latest/RustQuant/money/index.html) | Implementations for `Cashflows`, `Currencies`, and `Quotes`, and similar types. |
| [`portfolio`](https://docs.rs/RustQuant/latest/RustQuant/portfolio/index.html) | Implementation of a portfolio type, which is a collection (`HashMap`) of `Position`s. |
| [`statistics`](https://docs.rs/RustQuant/latest/RustQuant/statistics/index.html) | Density, distribution, moment-generating, and characteristic functions, and other distribution related functions for common distributions. |
| [`stochastics`](https://docs.rs/RustQuant/latest/RustQuant/stochastics/index.html) | Stochastic process generators for Brownian Motion (standard, arithmetic, fractional, and geometric) and various short-rate models (CIR, OU, Vasicek, Hull-White, etc). Multi-factor processes coming shortly. |
| [`time`](https://docs.rs/RustQuant/latest/RustQuant/time/index.html) | Time and date functionality, such as `DayCounter`, calendars, constants, conventions, schedules, etc. |
| [`trading`](https://docs.rs/RustQuant/latest/RustQuant/trading/index.html) | Currently only a basic limit order book (LOB). Hopefully adding additional trading tools in the future. |

## Examples

See [/examples](./examples) for various uses of RustQuant. You can run them with:

```bash
cargo run --example
```

## :book: References

- John C. Hull - *Options, Futures, and Other Derivatives*
- Damiano Brigo & Fabio Mercurio - *Interest Rate Models - Theory and Practice (With Smile, Inflation and Credit)*
- Paul Glasserman - *Monte Carlo Methods in Financial Engineering*
- Andreas Griewank & Andrea Walther - *Evaluating Derivatives - Principles and Techniques of Algorithmic Differentiation*
- Steven E. Shreve - *Stochastic Calculus for Finance II: Continuous-Time Models*
- Espen Gaarder Haug - *Option Pricing Formulas*
- Antoine Savine - *Modern Computational Finance: AAD and Parallel Simulations*
- Uwe Naumann - *The Art of Differentiating Computer Programs: An Introduction to Algorithmic Differentiation*
- Jessica James & Nick Webber - *Interest Rate Modelling*

> [!NOTE]
> Disclaimer: This is currently a free-time project and not a professional financial software library. Nothing in this library should be taken as financial advice, and I do not recommend you to use it for trading or making financial decisions.