VelesQuant
VelesQuant is a high-performance financial valuation library written in C++ and exposed to Python using pybind11. It provides tools for pricing complex financial derivatives using advanced models and numerical techniques.
Quick Start
VelesQuant provides high-level Python wrappers in velesquant.models for ease of use.
import numpy as np
from velesquant.models import SabrModel, HestonModel, HullWhiteModel
from velesquant.market.curves import DiscountCurve
# --- SABR Volatility Model ---
sabr = SabrModel(maturity=1.0, forward=100.0, beta=0.5)
# Calibrate to market data
strikes = [90.0, 100.0, 110.0]
quotes = [0.25, 0.20, 0.22] # Implied volatilities
sabr.calibrate(strikes=strikes, quotes=quotes, calibration_target="Volatility")
print(f"Calibrated SABR: alpha={sabr.alpha:.4f}, nu={sabr.nu:.4f}, rho={sabr.rho:.4f}")
# Get implied volatility for a strike
iv = sabr.implied_vol(105.0)
# --- Heston Stochastic Volatility ---
heston = HestonModel(spot=100.0, var0=0.04, kappa=2.0, theta=0.04, xi=0.3, rho=-0.7, seed=42)
# Price a vanilla option
price = heston.price_option(maturity=1.0, forward=100.0, strike=100.0, option_type="call")
# --- Hull-White Interest Rate Model ---
# 1. Define a Discount Curve
curve = DiscountCurve(
times=[0.0, 1.0, 5.0, 10.0],
dfs=[1.0, 0.95, 0.80, 0.65]
)
# 2. Initialize Model
hw = HullWhiteModel(kappa=0.1, sigma=0.01)
# 3. Price a Swaption
from velesquant.instruments.rates import Swaption
swaption = Swaption(expiry=1.0, tenor=5.0, strike=0.03, pay_frequency=0.5)
price = hw.price(swaption, curve)
# 4. Simulate Short Rate (Vectorized)
times = np.array([0.25, 0.5, 0.75, 1.0])
paths = hw.simulate(times, curve)
Available Models
| Model | Class | Description |
|---|---|---|
| SABR | SabrModel |
Stochastic Alpha Beta Rho volatility model |
| Heston | HestonModel |
Stochastic variance model |
| Local Vol | LocalVolModel |
Local volatility from SABR slices |
| Hull-White | HullWhiteModel |
1-Factor short rate model |
| ShortRate2F | ShortRate2FPDEModel |
2-Factor G2++ short rate model |
| CMS | CMSModel |
Constant Maturity Swap pricing |
| CMS Spread | CMSSpreadModel |
CMS Spread Option pricing (Copula) |
| Basket | LogNormalBasketModel |
Multi-asset Log-Normal Basket |
| Quantoed CMS | QuantoedCMSModel |
Quantoed Constant Maturity Swap |
| Quantoed Spread | QuantoedCMSSpreadModel |
Quantoed CMS Spread Option |
| Heston Hull-White | HybridHWModel |
Hybrid Equity-Interest Rate Model |
For a comprehensive list of supported financial instruments and their pricing methods, please refer to Supported Instruments.
Performance
VelesQuant is built for extreme performance:
- C++20 Core: Leveraging modern language features for safety and speed.
- SIMD Optimized: Critical numerical paths are designed for vectorization.
- Multi-threaded: Parallel PDE solvers and Monte Carlo simulations utilizing OpenMP.
- QuantLib Integration: Built on top of the industry-standard QuantLib library.
Testing
Python Tests
The recommended way to develop is using uv for lightning-fast environment management:
uv sync --all-extras
uv run pytest
Alternatively, using standard pip:
pip install ".[dev]"
pytest
If using poetry:
poetry run pytest
C++ Tests
./build/tests_cpp/velesquant_tests
Contributing
We welcome contributions! Please follow these steps:
- Bug Reports: Open an issue describing the bug and providing a reproducible example.
- Feature Requests: Use the issue tracker to propose new features.
- Pull Requests:
- Fork the repository.
- Create a feature branch.
- Ensure all C++ and Python tests pass.
- Submit a PR with a clear description of changes.
License
Metadata
Release files for VelesQuant 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| velesquant-0.1.0.tar.gz | 222.4 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| velesquant-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.28+ x86-64 | Details |
| velesquant-0.1.0-cp312-cp312-macosx_11_0_arm64.whl | CPython 3.12 | CPython 3.12 | macOS 11.0+ ARM64 | Details |
| velesquant-0.1.0-cp312-cp312-macosx_10_9_x86_64.whl | CPython 3.12 | CPython 3.12 | macOS 10.9+ x86-64 | Details |
| velesquant-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.28+ x86-64 | Details |
| velesquant-0.1.0-cp311-cp311-macosx_11_0_arm64.whl | CPython 3.11 | CPython 3.11 | macOS 11.0+ ARM64 | Details |
| velesquant-0.1.0-cp311-cp311-macosx_10_9_x86_64.whl | CPython 3.11 | CPython 3.11 | macOS 10.9+ x86-64 | Details |
Total release size: 49.6 MB
Release files / velesquant-0.1.0.tar.gz
| Download URL | velesquant-0.1.0.tar.gz |
|---|---|
| Size | 222.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
76e6965e55df145308d74cb08fa5414f60912986d9daab235eeea99602f7d44e
|
|
BLAKE2b-256 checksum How to use checksums |
3f751b6cbcaea5b3b6751926d2801dcd4f8ad38a8d85b49340e771d248997042
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 27, 2026.
Transparency logRelease files / velesquant-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl
| Download URL | velesquant-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 3.2 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
add21641f9bafe462f4e52671aebbf6816f1d1d5eceb35da79ef9dbb948e773c
|
|
BLAKE2b-256 checksum How to use checksums |
5ae369a1642cfa7ae978711a26f3e21def9d5134f86a0a84dc855f543452a82a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 27, 2026.
Transparency logRelease files / velesquant-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | velesquant-0.1.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 10.4 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
06d96a3ee68b47a1a1e878cae0de3aafede1b8f73992c062186256bab8dc20ff
|
|
BLAKE2b-256 checksum How to use checksums |
6a6ecffa760595fee5744b500013a2b8ca7287228768568d4b2fcb1fa93d2216
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 27, 2026.
Transparency logRelease files / velesquant-0.1.0-cp312-cp312-macosx_10_9_x86_64.whl
| Download URL | velesquant-0.1.0-cp312-cp312-macosx_10_9_x86_64.whl |
|---|---|
| Size | 11.1 MB |
| Tags | CPython 3.12 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
1de7b5872ba5eafe99c2d0de5bb086e6ac09b804a54f7d94bbdbca99599c1a18
|
|
BLAKE2b-256 checksum How to use checksums |
8f8e724d27049489a1301e02f4d201edb80ad2a84d2383ed48ef4a25c787ecaf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 27, 2026.
Transparency logRelease files / velesquant-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl
| Download URL | velesquant-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 3.2 MB |
| Tags | CPython 3.11 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
1c0d943d4a1d980bc3879d2986cfd033d31815269b1f2b5d3619fa574a94e0e0
|
|
BLAKE2b-256 checksum How to use checksums |
913475bc4149932df31a3fd0d099e3cdf76d070bafc5d55b44060f4b632e3dbf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 27, 2026.
Transparency logRelease files / velesquant-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | velesquant-0.1.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 10.4 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
09d3b4796361765c18f394b137d1b8799a7870ed7a394b6e611bb688a221a550
|
|
BLAKE2b-256 checksum How to use checksums |
27e4dde86d236479f45405f695056055f7a147d1a93648938037948f2210f896
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 27, 2026.
Transparency logRelease files / velesquant-0.1.0-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | velesquant-0.1.0-cp311-cp311-macosx_10_9_x86_64.whl |
|---|---|
| Size | 11.1 MB |
| Tags | CPython 3.11 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
736d1d34181b7a28f3a50f2e27c6be9bd28a40c3a1f496f801bc61795a6efb3e
|
|
BLAKE2b-256 checksum How to use checksums |
7e4d0c118be17a650c6d7c31a5a03f377abea2a315510d55f96f47aa82c3626f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 27, 2026.
Transparency log