Skip to main content

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 ArrayBackend with 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:

  1. laakhay-data: Market data acquisition and normalization.
  2. laakhay-ta: Technical analysis indicators and strategy engine.
  3. 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

laakhay_quantlab-0.0.1.tar.gz (52.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

laakhay_quantlab-0.0.1-py3-none-any.whl (81.1 kB view details)

Uploaded Python 3

File details

Details for the file laakhay_quantlab-0.0.1.tar.gz.

File metadata

  • Download URL: laakhay_quantlab-0.0.1.tar.gz
  • Upload date:
  • Size: 52.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.4

File hashes

Hashes for laakhay_quantlab-0.0.1.tar.gz
Algorithm Hash digest
SHA256 09dbdee913e969ca2af9d9a09134caa3d4022d611a52aa433f47cfffb9c41a4b
MD5 eadb31b7022150919e0de34c235afb3e
BLAKE2b-256 8b885a2ed01c9e22bc013b20416e6ce17029e62cc160983974a7493ab8e71418

See more details on using hashes here.

File details

Details for the file laakhay_quantlab-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for laakhay_quantlab-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9772476e9ab06d2ff2d4836289fa69ea0ba8d2f4fc3f8ce604f57133590a548c
MD5 6bf2bf732e78fa7adee6978e1b8b1a29
BLAKE2b-256 e3564a78f6d2ecd254718a1c3f9e4a1fa9ebb43a8802a445ba3e9a7982b822aa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page