MCPcopy Index your code
hub / github.com/avhz/RustQuant

github.com/avhz/RustQuant @RustQuant_autodiff-v0.4.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release RustQuant_autodiff-v0.4.0 ↗ · + Follow
1,604 symbols 3,476 edges 196 files 435 documented · 27%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

<a href="#license" alt="license">
    <img alt="License" src="https://img.shields.io/badge/Dual_License-MIT_and_Apache_2.0-black?logo=apache"></a>
<a href="#version" alt="version">
    <img alt="Crates.io" src="https://img.shields.io/crates/v/RustQuant?logo=rust&color=black"></a>
<a href="#downloads" alt="downloads">

    <img alt="Crates.io User Total Downloads" src="https://img.shields.io/crates/udt/178069">
<a href="#stars" alt="stars">
    <img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/avhz/RustQuant?logo=github&color=black"></a>







<a href="#build" alt="build">
    <img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/avhz/RustQuant/cargo_build.yml"></a>
<a href="#codecov" alt="codecov">
    <img alt="Codecov" src="https://img.shields.io/codecov/c/gh/avhz/RustQuant"></a>
<a href="#deps" alt="deps">
    <img alt="Dependencies" src="https://deps.rs/repo/github/avhz/RustQuant/status.svg"></a>
<a href="https://app.fossa.com/projects/git%2Bgithub.com%2Favhz%2FRustQuant?ref=badge_shield" alt="FOSSA Status"><img src="https://app.fossa.com/api/projects/git%2Bgithub.com%2Favhz%2FRustQuant.svg?type=shield"/></a>







<a href="#discord" alt="discord">
    <img alt="Discord" src="https://img.shields.io/discord/1146771658082881636?logo=discord"></a>

A Rust library for quantitative finance.

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

Email Discord Latest Changes
RustQuantContact@gmail.com https://discord.gg/gMdv8Hpuwr Changelog

Modules

Module Description
autodiff Algorithmic adjoint differentiation (AAD) for efficiently computing gradients of scalar output functions $f: \mathbb{R}^n \rightarrow \mathbb{R}$.
cashflows Implementations for Cashflows and Quotes, and similar types.
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 Implementations for financial instruments like Bonds, Options, and Money, including their pricing. Future additions will include swaps, futures, CDSs, etc.
iso A few ISO code implementations: 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.
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.

FOSSA Status

Extension points exported contracts — how you extend this code

Instrument (Interface)
Instrument trait The trait provides a common interface for all instruments. All instruments can be queried for their net [6 …
crates/RustQuant_instruments/src/instrument.rs
Calendar (Interface)
Calendar trait. [25 implementers]
crates/RustQuant_time/src/calendar.rs
Distribution (Interface)
Base trait for all distributions. Provides common methods for all distributions. All distributions must implement this t [8 …
crates/RustQuant_math/src/distributions/distribution.rs
Gradient (Interface)
Return the derivative/s *with-respect-to* the chosen variables. This allows you to get the gradient of a function with r [5 …
crates/RustQuant_autodiff/src/gradient.rs
StochasticProcess (Interface)
(no doc) [17 implementers]
crates/RustQuant_stochastics/src/process.rs
ActivationFunction (Interface)
Activation functions. [3 implementers]
crates/RustQuant_ml/src/activations.rs
YahooFinanceReader (Interface)
Yahoo! Finance data reader trait. [1 implementers]
crates/RustQuant_data/src/yahoo.rs
Quote (Interface)
Trait to define financial quotes. [1 implementers]
crates/RustQuant_cashflows/src/quotes.rs

Core symbols most depended-on inside this repo

exp
called by 223
crates/RustQuant_autodiff/src/overload.rs
sqrt
called by 152
crates/RustQuant_autodiff/src/overload.rs
cdf
called by 102
crates/RustQuant_math/src/distributions/gamma.rs
push
called by 86
crates/RustQuant_autodiff/src/graph.rs
powi
called by 80
crates/RustQuant_autodiff/src/overload.rs
var
called by 75
crates/RustQuant_autodiff/src/graph.rs
ln
called by 64
crates/RustQuant_autodiff/src/overload.rs
powf
called by 64
crates/RustQuant_autodiff/src/overload.rs

Shape

Method 873
Function 508
Class 157
Enum 33
Interface 33

Languages

Rust100%

Modules by API surface

crates/RustQuant_instruments/src/options/option_models.rs60 symbols
crates/RustQuant_autodiff/src/overload.rs56 symbols
crates/RustQuant_math/src/statistic.rs45 symbols
crates/RustQuant_time/src/utilities.rs37 symbols
crates/RustQuant_time/src/day_counting.rs37 symbols
crates/RustQuant_instruments/src/options/implied_volatility.rs35 symbols
crates/RustQuant_instruments/src/options/black_scholes_merton.rs32 symbols
crates/RustQuant_math/src/distributions/bernoulli.rs31 symbols
crates/RustQuant_instruments/src/options/finite_difference_pricer.rs29 symbols
crates/RustQuant_math/src/sequences.rs28 symbols
crates/RustQuant_instruments/src/fx/currency.rs26 symbols
crates/RustQuant_cashflows/src/cashflow.rs25 symbols

For agents

$ claude mcp add RustQuant \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page