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.4.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.1.4-py3-none-any.whl (81.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: laakhay_quantlab-0.1.4.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.1.4.tar.gz
Algorithm Hash digest
SHA256 a396477a2003d5dda9a66d87770e261e5ee7a3c367961cb98ff088c13e1e155a
MD5 1c636d6702d3ba10cc8828d0d49c7f11
BLAKE2b-256 191ad64671211542cbc396ea528ceffa284d3d1b0089ecc7925b27d0f2455cf2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laakhay_quantlab-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 35b864e86199ebb8d307b35a4a64072fbccd849a31e109c6149de4d81f183da6
MD5 90ed0f1f9be9916fabe7a1f8540ece6d
BLAKE2b-256 162d4c65fe43e9b2b43e8db247f0adad481b8efed0eed067750dc21bdfbe0a59

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