Skip to main content

VanillaOptionPricers (vanilla-option-pricers)

vanilla-option-pricers - Numba-vectorised Black-Scholes-Merton and Bachelier prices, Greeks, and implied-volatility fits over NumPy arrays for quantitative research pipelines.

Install the distribution as vanilla-option-pricers and import it as vanilla_option_pricers.

PyPI Python License CI Downloads Monthly

Why vanilla-option-pricers

Research pipelines often need focused pricing functions rather than a derivatives framework. This package provides forward-based Black-Scholes-Merton and Bachelier prices, Greeks, and implied-volatility inversion through scalar functions, aligned-array helpers, and per-expiry containers. The runtime dependency surface is limited to NumPy and Numba.

What makes it different

  • Log-normal and relative-normal models side by side. Black-Scholes-Merton and Bachelier functions share a forward-and-discount-factor interface. The detailed Bachelier volatility convention is part of the package contract and will be documented separately.
  • Implied volatility as a first-class fitter. Scalar, slice, and chain helpers recover model volatilities from caller-supplied option prices.
  • Inverse-workflow branches. The 'IC' and 'IP' codes select branches used in coin-denominated inverse-option workflows. They do not perform every quote, numeraire, or payoff normalization required by a market contract; callers remain responsible for those conversions. For the contract theory, see Lucic and Sepp (2024), Valuation and Hedging of Cryptocurrency Inverse Options, Quantitative Finance, 24(7), 851–869.
  • Two runtime dependencies. NumPy and Numba; no object hierarchy, calendar, curve, pandas, or SciPy layer.

When to use it — and when not

Use vanilla-option-pricers for forward-based vanilla prices, Greeks, and implied-volatility fits inside option-chain processing, volatility-surface preprocessing, simulation post-processing, or calibration objectives.

It is deliberately not a derivatives framework: it does not construct spots, forwards, discount curves, calendars, or settlement conventions, and it does not price American, exotic, or stochastic-volatility models. For pricing and calibration under stochastic volatility, use stochvolmodels; for portfolio-level analytics and reporting, use qis.

Installation

PyPI Installation

pip install vanilla-option-pricers

Upgrade to Latest Version

pip install --upgrade vanilla-option-pricers

Requirements

Core Dependencies

  • python >= 3.10
  • numba >= 0.60.0
  • numpy >= 2.0

The two runtime dependencies are NumPy and Numba. There is no dependency on any higher-level analytics package.

Supported Option Types

VanillaOptionPricers supports the following option types (passed as string parameters):

Option Type String Code Description
Call 'C' Standard call option
Put 'P' Standard put option
Inverse-workflow call branch 'IC' Caller supplies the required market normalization
Inverse-workflow put branch 'IP' Caller supplies the required market normalization

Quick Start

Open In Colab

Use the authoritative, deterministic pricing and IV script. It prices one aligned BSM slice, recovers the input implied volatilities, checks put-call parity, demonstrates the relative Bachelier convention, and reports cold and warm execution separately.

python examples/getting_started/pricing_and_iv.py

The rendered quickstart includes that source directly and explains its inputs and output. The script requires no market data, network access, credentials, or optional dependencies.

The Colab entry point installs the latest release from public PyPI, reports its exact version and import path, and runs the same mechanically checked workflow with no saved notebook outputs.

Execution model

The public API has distinct execution paths:

  • scalar pricing kernels are Numba dispatchers;
  • slice, grid, and chain helpers use compiled loops over aligned inputs; and
  • five *_vector convenience wrappers use numpy.vectorize.

The first Numba call includes compilation time. Runtime depends on input shape, dtype, machine, and whether the relevant signature has already been compiled; this README makes no universal timing or superiority claim.

Typical uses

The package is intended for:

  • quantitative research using forward-based European vanilla prices and Greeks;
  • option-chain and volatility-surface preprocessing;
  • calibration or simulation post-processing that needs price/volatility inversion; and
  • numerical experiments or teaching examples built around explicit model inputs.

Ecosystem

This package is part of an open-source Python stack for quantitative finance — full catalogue at github.com/ArturSepp:

Package Purpose
qis Performance analytics, factsheets, and visualisation
optimalportfolios Portfolio construction and backtesting
factorlasso Sparse factor models and factor covariance estimation
bbg-fetch Bloomberg data fetching
trendfollowing Trend-following systems: closed-form theory and replication
goal-based-allocation Dynamic MV allocation under regime-switching jump-diffusions
stochvolmodels Stochastic volatility pricing analytics
vanilla-option-pricers (this package) Numba-vectorised BSM/Bachelier prices, Greeks, and implied-volatility fits

Dependency links within the stack: optimalportfolios builds on qis and factorlasso; trendfollowing builds on qis.

Contributing

We welcome contributions! Please feel free to submit issues, feature requests, or pull requests.

Development Setup

git clone https://github.com/ArturSepp/VanillaOptionPricers.git
cd VanillaOptionPricers
pip install -e .

License

This project is licensed under the MIT License - see the LICENSE file for details.

Citation

If you use VanillaOptionPricers in your research, please cite it as:

@software{sepp2024vanillaoptionpricers,
  title={VanillaOptionPricers: Numba-vectorised Black-Scholes-Merton and Bachelier prices, Greeks, and implied-volatility fits over NumPy arrays},
  author={Sepp, Artur},
  year={2024},
  url={https://github.com/ArturSepp/VanillaOptionPricers},
  note={Python package for forward-based vanilla option pricing and implied-volatility fitting}
}

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vanilla_option_pricers-1.3.1.tar.gz (23.2 kB view details)

Uploaded Source

Built Distribution

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

vanilla_option_pricers-1.3.1-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file vanilla_option_pricers-1.3.1.tar.gz.

File metadata

  • Download URL: vanilla_option_pricers-1.3.1.tar.gz
  • Upload date:
  • Size: 23.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.7

File hashes

Hashes for vanilla_option_pricers-1.3.1.tar.gz
Algorithm Hash digest
SHA256 fac05b4792dc04acdc66f8225b66c61e4e3036f0b019e2cee77182506dd9d3b6
MD5 c607525ceebece0e86361aedae1c8f03
BLAKE2b-256 79d74fb4df77f5e66f0e33de97419c1a6fdfc4671fd8ad48c2b03f1af90f0b56

See more details on using hashes here.

File details

Details for the file vanilla_option_pricers-1.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for vanilla_option_pricers-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 673059b3803a092c0fcfc9895d3d0da18ab2d582d3a274477e15a7260a963026
MD5 3d4ce13607cbd4f6c1baca9828722750
BLAKE2b-256 8f9dd4b132658d9b8c0bd2fcb8959d8373fbbef049030f3e72a331e45777791e

See more details on using hashes here.

Release history Release notifications | RSS feed

2.1.0

2 files

2.0.0

2 files

This release

1.3.1 This release

2 files

1.3.0

1 file

1.2.3

1 file

1.2.2

2 files

1.2.1

1 file

1.1.2

1 file

1.1.1

1 file

1.0.4

1 file

1.0.3

1 file

1.0.2

1 file

1.0.1

1 file

Supported by

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