Quant tools built with ♥︎ by Laakhay
Project description
Laakhay Quantlab
laakhay-quantlab is a high-performance, backend-agnostic quantitative computation layer designed for simulation-heavy research and production analytics. It provides a unified interface over NumPy, JAX, and PyTorch, enabling seamless switching between CPU and GPU backends without code changes.
Key Features
- Backend Agnostic: Write once, run on NumPy, JAX, or PyTorch.
- Hardware Acceleration: Transparent GPU/TPU support via JAX/Torch backends.
- Vectorized Operations: Optimized
ArrayBackendwith JIT compilation support. - Simulation Primitives: Fast Gaussian sampling, Geometric Brownian Motion (GBM), and more.
- Options & Pricing (New): Comprehensive verification and pricing of derivatives using analytical (Black-Scholes) and numerical (Monte Carlo) methods.
Ecosystem
laakhay-quantlab fits into the broader Laakhay quantitative ecosystem:
laakhay-data: Market data acquisition and normalization.laakhay-ta: Technical analysis indicators and strategy engine.laakhay-quantlab: Numerical simulation, pricing, and risk modeling.
Installation
pip install laakhay-quantlab
# extensions: [jax, jax-gpu, torch, all]
pip install "laakhay-quantlab[all]"
Quick Start: Options Pricing
The pricing module supports a wide range of exotic and vanilla options, along with Greeks calculation.
from laakhay.quantlab.pricing import (
EuropeanCall,
MarketData,
Pricer,
PricingMethod
)
# 1. Define Market Conditions
market = MarketData(spot=100.0, rate=0.05, vol=0.2)
# 2. Define Instrument
option = EuropeanCall(strike=100.0, expiry=1.0)
# 3. Price using Black-Scholes (Analytical)
bs_pricer = Pricer(method=PricingMethod.BLACK_SCHOLES)
price, greeks = bs_pricer.price_with_greeks(option, market)
print(f"Price: {price:.4f}")
print(f"Delta: {greeks.delta:.4f}")
# 4. Price using Monte Carlo (Numerical)
mc_pricer = Pricer(method=PricingMethod.MONTE_CARLO)
mc_price = mc_pricer.price(option, market)
print(f"MC Price: {mc_price:.4f}")
Documentation
See the docs/ directory for detailed guides:
- Getting Started: Installation and first steps.
- Pricing: Detailed guide on options, strategies, and pricing models.
- Backends: Configuring specific computation backends.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file laakhay_quantlab-0.1.5.tar.gz.
File metadata
- Download URL: laakhay_quantlab-0.1.5.tar.gz
- Upload date:
- Size: 51.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6521874df756164fe8795fb05096f79dbfe67e1d1d625b7ce88b756526a19df
|
|
| MD5 |
efe565600b6dae264cb108024bc7ad41
|
|
| BLAKE2b-256 |
c7cec7eca3c01d6f7a82bb62ef0cdbe4807f3410af18da876650d3f012d10490
|
File details
Details for the file laakhay_quantlab-0.1.5-py3-none-any.whl.
File metadata
- Download URL: laakhay_quantlab-0.1.5-py3-none-any.whl
- Upload date:
- Size: 81.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e24e62c39b3e76ff9b1fdf311e688577c4d5f18bcf6ab2c9fde2f53c7fee4d58
|
|
| MD5 |
d6fb849bd8fa8caf0da8a3f3cd53e64d
|
|
| BLAKE2b-256 |
3f36b755fe4ecc68310a7c36f6fcc086626b92cf4b2e24155fdf0a6193308820
|