Skip to main content

vanilla-option-pricers

Author: Artur Sepp / First recorded: 2024-06-08

Implemented in VanillaOptionPricers. Software citation: CITATION.cff.

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

It is a focused, function-based numerical library, not a derivatives framework: callers supply forwards, discount factors, maturities, and market conventions.

Install: pip install vanilla-option-pricers · Import: vanilla_option_pricers · Status: Beta

PyPI Python CI Docs License Downloads Monthly Open In Colab

Documentation: vanillaoptionpricers.readthedocs.io · package-root API · Bachelier convention · package comparison


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.

Key differentiators

  • Log-normal and absolute-normal models side by side. Black-Scholes-Merton and Bachelier functions share a forward-and-discount-factor interface. The Bachelier convention is annualised absolute normal volatility in the same units as the forward and strike.
  • 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 normalisation 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, calibration objectives, and numerical experiments or teaching examples built around explicit model inputs.

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

pip install vanilla-option-pricers

Upgrade using

pip install --upgrade vanilla-option-pricers

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.

Table of contents

  1. Why vanilla-option-pricers
  2. Installation
  3. Statement of need
  4. Overview
  5. Five-minute quickstart
  6. Examples
  7. Testing
  8. Changelog
  9. Feedback & contributing
  10. Citation
  11. Ecosystem
  12. License
  13. Disclaimer

Statement of need

Every option-chain, volatility-surface and stochastic-volatility workflow in the stack needs the same small set of vanilla operations — a forward-based price, its Greeks, and the implied volatility that recovers a quote — applied to arrays of strikes and expiries without a derivatives framework around them. vanilla-option-pricers is that layer: it supplies the vanilla pricing used by option-chain-analytics and stochvolmodels, with the Bachelier convention stated explicitly and the inverse-option branches of Lucic and Sepp (2024) available for coin-denominated workflows. No research paper is implemented in this package beyond those branches.

Paper Implemented analytics Where
Lucic, V. and Sepp, A. (2024), Valuation and Hedging of Cryptocurrency Inverse Options, Quantitative Finance 24(7), 851–869 The 'IC' and 'IP' inverse-workflow branches of the pricing and implied-volatility functions; quote, numeraire and payoff normalisation remain with the caller inverse options

Overview

The public import surface in src/vanilla_option_pricers/__init__.py is inventoried, with signatures, in the package-root API page. The functions fall into three execution tiers: 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. See array shapes and Numba and numerical accuracy and performance.

Supported 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 normalisation
Inverse-workflow put branch 'IP' Caller supplies the required market normalisation

Analytics at a glance

Area What the package computes
Black-Scholes-Merton Forward-based vanilla prices and Greeks from forward, strike, maturity, volatility, option type and discount factor (compute_bsm_vanilla_price and the aligned-array and chain helpers); see pricing and Greeks
Bachelier Absolute-normal prices, Greeks and forward-delta strike conversion (compute_normal_price, compute_normal_slice_prices) in annualised absolute normal volatility, the same units as the forward and strike, including negative forwards; see the Bachelier convention
Implied volatility Scalar, slice and chain inversion of caller-supplied prices (infer_bsm_implied_vol, infer_normal_implied_vol); see implied volatility
Inverse-option branches 'IC'/'IP' branches for coin-denominated workflows; see inverse options
Execution tiers Scalar Numba kernels, compiled slice/grid/chain loops, and five numpy.vectorize wrappers

Five-minute quickstart

This scalar price-to-implied-volatility round trip works from any directory after installation:

from vanilla_option_pricers import compute_bsm_vanilla_price, infer_bsm_implied_vol

forward, discfactor, ttm, strike, vol = 101.25, 0.99, 0.25, 105.0, 0.20
price = compute_bsm_vanilla_price(forward, strike, ttm, vol, "C", discfactor)
implied_vol = infer_bsm_implied_vol(
    forward, ttm, strike, price, discfactor, "C"
)
print(f"call_price={price:.6f} implied_vol={implied_vol:.8f}")
call_price=2.481051 implied_vol=0.20000000

Examples

Highlighted examples

For arrays, chains, parity checks, and the Bachelier convention, clone the repository and 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 absolute Bachelier volatility 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.

Open In Colab

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.

Runnable examples

Deterministic, offline-first examples live in examples/ (see examples/README.md):

Testing

uv sync --locked --group test
uv run --no-sync pytest
uv run --locked --only-group lint ruff check src/vanilla_option_pricers/ examples/

The suite needs no market data, network access or optional dependencies. See CONTRIBUTING.md for the development commands and numerical-change rules.

Changelog

Release history is maintained in CHANGELOG.md.

Feedback & contributing

  • Bug or unsupported edge case: open the bug-report form with the package/Python versions, platform, quote convention, inputs, expected result, and actual result.
  • Feature: open the feature-request form with the payoff, quote convention, or model edge case that is unsupported, your current workaround, and the smallest useful API.
  • Question or methodology: search or open an issue and name the function, quote convention, or model involved.
  • Contribution: read CONTRIBUTING.md, then browse good first issue or help wanted work.

Citation

A machine-readable citation is available in CITATION.cff.

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

@software{sepp2026vanillaoptionpricers,
  title={VanillaOptionPricers: Numba-vectorised Black-Scholes-Merton and Bachelier prices, Greeks, and implied-volatility fits over NumPy arrays},
  author={Sepp, Artur},
  year={2026},
  version={2.3.0},
  url={https://github.com/ArturSepp/VanillaOptionPricers},
  note={Python package for forward-based vanilla option pricing and implied-volatility fitting}
}
@article{lucicsepp2024,
  title={Valuation and hedging of cryptocurrency inverse options},
  author={Lucic, Vladimir and Sepp, Artur},
  journal={Quantitative Finance},
  volume={24},
  number={7},
  pages={851--869},
  year={2024}
}

Ecosystem

This package is part of an open-source Python stack for quantitative finance. The ArturSepp profile is the canonical catalogue:

Package Purpose
qis Performance analytics, backtesting, and factsheet reporting
optimalportfolios Portfolio construction and rolling backtesting
factorlasso Sparse factor-model estimation
bbg-fetch Bloomberg data in pandas DataFrames
option-chain-analytics Point-in-time option-chain data and queries
vanilla-option-pricers (this package) Numba-vectorised BSM and Bachelier pricing
stochvolmodels Stochastic-volatility pricing and calibration
trendfollowing Closed-form trend-following analytics
privateassets Multi-factor PME for private assets
goal-based-allocation Goal-based allocation under regime-switching jump-diffusions

vanilla-option-pricers is standalone and depends only on NumPy and Numba. It supplies the vanilla pricing layer used by option-chain-analytics and stochvolmodels; those packages own point-in-time chain workflows and stochastic-volatility models respectively.

License

MIT — see LICENSE.txt.

Disclaimer

vanilla-option-pricers is distributed FREE & WITHOUT ANY WARRANTY under the MIT License. See LICENSE.txt in the release for details. Use the routes in Feedback & contributing for bugs, feature requests and methodology questions.

Metadata

Release files for vanilla-option-pricers 2.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vanilla-option-pricers 2.3.0
File Size Uploaded Provenance Actions
vanilla_option_pricers-2.3.0.tar.gz 48.5 kB With provenance Details for vanilla_option_pricers-2.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vanilla-option-pricers 2.3.0
File Interpreter ABI Platform Actions
vanilla_option_pricers-2.3.0-py3-none-any.whl Python 3 none any Details for vanilla_option_pricers-2.3.0-py3-none-any.whl

Total release size: 97.1 kB

Release files / vanilla_option_pricers-2.3.0.tar.gz

Download URL vanilla_option_pricers-2.3.0.tar.gz
Size 48.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d0b07aebae2f71a673293f588db032ab05df2df4b72bf18b8239fa9a796f6a2f
BLAKE2b-256 checksum
How to use checksums
f3d1729196657a5f7b96da99d5440677755ac6c4cb5c6a91c88a749362e0fb24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

Release files / vanilla_option_pricers-2.3.0-py3-none-any.whl

Download URL vanilla_option_pricers-2.3.0-py3-none-any.whl
Size 48.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
66a62a14c5644fbce81ad0b961aa8fca9ff317f16f22e2ec11dc9a671b05a4cc
BLAKE2b-256 checksum
How to use checksums
ea0448d7e22e90f14356bc772832e772b4ace9ee3c58bf705e2eb555b48387bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

Security for vanilla-option-pricers 2.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for vanilla_option_pricers-2.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page