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.1.6.tar.gz (59.0 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.1.6-py3-none-any.whl (97.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for laakhay_quantlab-0.1.6.tar.gz
Algorithm Hash digest
SHA256 25166f277bf3a494df252ea0d13278325ba6ac106526203af5da56c67583e9d8
MD5 b4588d4ca0b7f7655d59c0f9883afb63
BLAKE2b-256 9bf55b24e3a11465f18afeb38c62ea2ab7d7a843e49bc527b6ec104743ad3c91

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laakhay_quantlab-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 672a5ab36eb8cbe8f653dbd6bade6fbbe997cf82de5aa29af61b45bb2bb00b2e
MD5 b997a85899162791eac1816044708369
BLAKE2b-256 5e71312b226b497e5f69651f694c615d92622d26be838bbb2eecfe0f446ba6af

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