56 releases

new 0.2.4 Apr 24, 2024
0.2.3 Mar 15, 2024
0.1.1 Mar 4, 2024
0.0.42 Dec 21, 2023
0.0.2 Oct 4, 2022

#1 in Finance

Download history 15/week @ 2024-01-01 49/week @ 2024-01-08 8/week @ 2024-01-15 35/week @ 2024-01-22 19/week @ 2024-01-29 17/week @ 2024-02-12 374/week @ 2024-02-19 289/week @ 2024-02-26 1198/week @ 2024-03-04 593/week @ 2024-03-11 116/week @ 2024-03-18 67/week @ 2024-03-25 218/week @ 2024-04-01 128/week @ 2024-04-08 127/week @ 2024-04-15

4,642 downloads per month

MIT/Apache

2MB
21K SLoC

License Crates.io Crates.io GitHub Repo stars

GitHub Workflow Status Codecov Dependencies

Discord

A Rust library for quantitative finance.

🎯 If you are an experienced quant developer in any language and would like to help out, feel free to contact me!

Modules

Module Description
autodiff Algorithmic adjoint differentiation (AAD) for efficiently computing gradients of scalar output functions $f: \mathbb{R}^n \rightarrow \mathbb{R}$.
data Data types that can be used for pricing and similar tasks (curves, term-structures, surfaces, etc). Methods for reading and writing data from/to various sources (CSV, JSON, Parquet). Can also download data from Yahoo! Finance.
error RustQuant error handling module.
instruments Various implementations for instruments like Bonds and Options, and the pricing of them. Others coming in the future (swaps, futures, CDSs, etc).
iso A few ISO code implementations. Currently: ISO-4217 (currency codes), ISO-3166 (country codes), ISO-10383 (market identifier codes).
math Statistical distributions and their related functions (PDF, CDF, CF, etc), 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 Currently only linear and logistic regression, along with k-nearest neighbours classification are implemented. More to come in the future.
macros Currently only plot_vector!() and assert_approx_equal!().
models Various models commonly used in quantitative finance, such as the various forms of Brownian Motion, short rate models, curve models, etc.
money Implementations for Cashflows, Currencies, and Quotes, and similar types.
portfolio Implementation of a portfolio type, which is a collection (HashMap) of Positions.
stochastics Stochastic process generators for Brownian Motion (standard, arithmetic, fractional, and geometric) and various short-rate models (CIR, OU, Vasicek, Hull-White, etc).
time Time and date functionality, such as DayCounter, calendars, constants, conventions, schedules, etc.
trading Currently only a basic limit order book (LOB). Hopefully adding additional trading tools in the future.

Examples

See /examples for various uses of RustQuant. You can run them with:

cargo run --example <example>

[!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.

Dependencies

~41–57MB
~834K SLoC