vanilla-option-pricers
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
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, 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.10numba >= 0.60.0numpy >= 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 normalisation |
| Inverse-workflow put branch | 'IP' |
Caller supplies the required market normalisation |
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
For arrays, chains, parity checks, and the Bachelier convention, clone the repository and use the authoritative deterministic workflow:
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.
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.
Continue with the Bachelier convention, package-root API, and package comparison guides.
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
*_vectorconvenience wrappers usenumpy.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 Artur Sepp's open-source Python stack for quantitative finance. The maintainer profile is the canonical ten-package catalogue.
| 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 |
option-chain-analytics |
Point-in-time option-chain normalisation, reconstruction, queries, and visualisation |
trendfollowing |
Trend-following systems: closed-form theory and replication |
privateassets |
Money-weighted multi-factor alpha from private-asset cash flows |
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 |
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.
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.
- Contribution: read
CONTRIBUTING.md, then browsegood first issueorhelp wantedwork.
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.2.0},
url={https://github.com/ArturSepp/VanillaOptionPricers},
note={Python package for forward-based vanilla option pricing and implied-volatility fitting}
}
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for vanilla-option-pricers 2.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| vanilla_option_pricers-2.2.0.tar.gz | 26.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| vanilla_option_pricers-2.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 53.2 kB
Release files / vanilla_option_pricers-2.2.0.tar.gz
| Download URL | vanilla_option_pricers-2.2.0.tar.gz |
|---|---|
| Size | 26.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
17fba01a59c5e1331486d107dd1760e425fe2e24aec86e4cb8a32453be02b179
|
|
BLAKE2b-256 checksum How to use checksums |
32f6de8c70dc9e6c7cef602adf461ca8d54b36dc4565be4478b5b390b11b9ad9
|
| 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 Sep 8, 2026.
Transparency logRelease files / vanilla_option_pricers-2.2.0-py3-none-any.whl
| Download URL | vanilla_option_pricers-2.2.0-py3-none-any.whl |
|---|---|
| Size | 26.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7215048ebf45bd6753836c9d70aea38501aaca302dbfadac8e8aa602fe97aae3
|
|
BLAKE2b-256 checksum How to use checksums |
840b8d41697c8083c4c279ff5fa4d8887339cfe218d0064083018149dc005f99
|
| 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 Sep 8, 2026.
Transparency log