Skip to content

Derivatives

Black-Scholes-Merton options

Price, Greeks and implied volatility of European calls and puts on an asset with a continuous dividend yield.

Model id
derivatives.black_scholes_merton, version 1
Domain
Derivatives
Evidence
standard
Cost class
instant: A closed-form calculation; a hosted run may take up to 2 seconds.

Formula

d1=ln⁡(S/K)+(r−q+σ2/2)TσTd_1 = \frac{\ln(S/K) + (r - q + \sigma^2/2)T}{\sigma\sqrt{T}}d2=d1−σTd_2 = d_1 - \sigma\sqrt{T}c=Se−qTN(d1)−Ke−rTN(d2)c = S e^{-qT} N(d_1) - K e^{-rT} N(d_2)p=Ke−rTN(−d2)−Se−qTN(−d1)p = K e^{-rT} N(-d_2) - S e^{-qT} N(-d_1)c−p=Se−qT−Ke−rTc - p = S e^{-qT} - K e^{-rT}Δc=e−qTN(d1),Γ=e−qTn(d1)SσT\Delta_c = e^{-qT} N(d_1), \quad \Gamma = \frac{e^{-qT} n(d_1)}{S \sigma \sqrt{T}}ν=Se−qTn(d1)T\nu = S e^{-qT} n(d_1) \sqrt{T}

Where

SS
Price of the underlying asset now spot
KK
Strike price strike
rr
Risk-free rate per year, continuously compounded risk_free_rate
qq
Dividend yield per year, continuously compounded dividend_yield
σ\sigma
Volatility of the asset's return per year volatility
TT
Time to expiry, in years years
d1d_1
The first standardized distance the normal distribution is read at
d2d_2
The second: the first less the volatility over the time to expiry
NN
The standard normal cumulative distribution
nn
The standard normal density
cc
Price of a European call price
pp
Price of a European put price
Δc\Delta_c
The call's delta delta
Γ\Gamma
Gamma, the same for a call and a put gamma
ν\nu
Vega: the change in price per unit of volatility vega

Each symbol's field is named beside it; the inputs and outputs, with their units and bounds, are under Variables, and the citations give each formula's source.

Variables

Rates, returns and yields are decimals: 0.05 is five percent. Bounds in brackets include their end; in parentheses they exclude it.

Inputs

Price, Greeks and the put-call parity residual (price): 8 inputs
Inputs of the calculation price
NameDescription
Option typeoption_typetextA call (the right to buy) or a put (to sell)
Spotspotmoney · [0.01, 1e+07]Price of the underlying asset now
Strikestrikemoney · [0.01, 1e+07]Strike price
Yearsyearsyears · [0.001, 100]Time to expiry, in years
Risk free raterisk_free_raterate · [-0.1, 1]Risk-free rate per year, continuously compounded
Dividend yielddividend_yieldrate · [-0.1, 1]Dividend yield per year, continuously compounded
CalculationcalculationtextPrice, Greeks and the put-call parity residual
Volatilityvolatilityvolatility · [0.001, 5]Volatility of the asset's return per year
Volatility implied by a price (implied_volatility): 8 inputs
Inputs of the calculation implied_volatility
NameDescription
Option typeoption_typetextA call (the right to buy) or a put (to sell)
Spotspotmoney · [0.01, 1e+07]Price of the underlying asset now
Strikestrikemoney · [0.01, 1e+07]Strike price
Yearsyearsyears · [0.001, 100]Time to expiry, in years
Risk free raterisk_free_raterate · [-0.1, 1]Risk-free rate per year, continuously compounded
Dividend yielddividend_yieldrate · [-0.1, 1]Dividend yield per year, continuously compounded
CalculationcalculationtextVolatility implied by a price
Option priceoption_pricemoney · [0, 1e+12]The option's price

Outputs

Price, Greeks and the put-call parity residual (price): 9 outputs
Outputs of the calculation price
NameDescription
CalculationcalculationtextPrice, Greeks and the put-call parity residual
Pricepricemoney · [0, 1e+15]Option price
Deltadeltaratio · [-100000, 100000]Change in price per unit of spot
Gammagammaratio · [0, 1e+12]Change in delta per unit of spot
Vegavegamoney · [0, 1e+15]Change in price per 1.00 of volatility
Thetathetamoney · [-1e+15, 1e+15]Change in price per year that passes
Rhorhomoney · [-1e+15, 1e+15]Change in price per 1.00 of the risk-free rate
Dividend rhodividend_rhomoney · [-1e+15, 1e+15]Change in price per 1.00 of the dividend yield
Put call parity residualput_call_parity_residualmoney · [-1e+15, 1e+15]Call less put less (S e^-qT - K e^-rT): zero up to rounding
Volatility implied by a price (implied_volatility): 4 outputs
Outputs of the calculation implied_volatility
NameDescription
CalculationcalculationtextVolatility implied by a price
Implied volatilityimplied_volatilityvolatility · [0.001, 5]Volatility whose price is the price given; null when the price is outside the no-arbitrage bounds or the solver's range
Lower boundlower_boundmoney · [0, 1e+15]No-arbitrage lower bound on the price
Upper boundupper_boundmoney · [0, 1e+15]No-arbitrage upper bound on the price

Calculator

Run the model on your own inputs, starting from its example. Rates are decimals: 0.05 is five percent. The run goes to the pyeconomics API on this site: your values travel only in the request, and nothing is stored.

Loading the calculator…

Worked example

Example six_month_call. Inputs:

{
  "calculation": "price",
  "dividend_yield": 0,
  "option_type": "call",
  "risk_free_rate": 0.1,
  "spot": 42,
  "strike": 40,
  "volatility": 0.2,
  "years": 0.5
}

Outputs:

{
  "calculation": "price",
  "delta": 0.779131290942669,
  "dividend_rho": -16.36175710979605,
  "gamma": 0.04996267040591185,
  "price": 4.759422392871535,
  "put_call_parity_residual": 1.7763568394002505e-15,
  "rho": 13.982045913360281,
  "theta": -4.559092194592626,
  "vega": 8.813415059602853
}

Assumptions

  • The asset's price follows geometric Brownian motion with a constant volatility, and pays a continuous dividend yield.
  • The risk-free rate is constant and continuously compounded; trading is continuous, frictionless and free of arbitrage.
  • The option is European: it can be exercised only at expiry.
  • Greeks are per unit: vega and the rhos per 1.00 of volatility or rate, theta per year of calendar time.

Limitations

  • Results are the formula's outputs for the inputs given, not a valuation of a traded contract or trading advice.
  • A constant volatility ignores the smile and skew of traded options; an implied volatility is the one number that reproduces one price.
  • The implied volatility is searched for in [0.001, 5]; a price outside the no-arbitrage bounds, or one only a volatility outside that range gives, returns null with a warning.
  • American exercise is out of scope (derivatives.binomial_tree prices it).

Evidence

Status: standard. Textbook consensus, such as bond duration or the CAPM formula.

Every model declares one status: standard (textbook consensus), practitioner (a widely used convention), contested (under active debate), rejected (failed out of sample) or historical (a superseded methodology).

Syllabus

The 2027 CFA® Program's topic areas this model relates to, as factual tags. Each links to CFA Institute's page for its level; pyeconomics holds none of the curriculum's text.

Citations

  1. Black, F. and Scholes, M. (1973). The Pricing of Options and Corporate Liabilities. Journal of Political Economy, 81(3), 637-654. doi:10.1086/260062 (Equation (13), the value of a European call)
  2. Merton, R. C. (1973). Theory of Rational Option Pricing. The Bell Journal of Economics and Management Science, 4(1), 141-183. doi:10.2307/3003143 (The extension of the call formula to a continuous dividend yield)
  3. Hull, J. C. (2018). Options, Futures, and Other Derivatives, 10th ed. Pearson. https://openlibrary.org/isbn/9780134472089 (Chapters 15, 17 and 19 (the Black-Scholes-Merton model, options on assets with a dividend yield, the Greek letters)). ISBN 9780134472089

Changelog

  • Version 1: First version.

Use it elsewhere

Documentation
The model's reference page
REST API
GET or POST /v1/models/derivatives.black_scholes_merton/run
MCP tool
derivatives_black_scholes_merton, or run_model with the model's id; both give the same result. Connect an assistant
Command line
pyeconomics models run derivatives.black_scholes_merton --help

The worked example, from Python and from the command line:

Python
import pyeconomics

inputs = {
    "calculation": "price",
    "dividend_yield": 0,
    "option_type": "call",
    "risk_free_rate": 0.1,
    "spot": 42,
    "strike": 40,
    "volatility": 0.2,
    "years": 0.5,
}
result = pyeconomics.run("derivatives.black_scholes_merton", inputs)
print(result.to_json())
Command line
pyeconomics models run derivatives.black_scholes_merton --inputs - <<'JSON'
{
  "calculation": "price",
  "dividend_yield": 0,
  "option_type": "call",
  "risk_free_rate": 0.1,
  "spot": 42,
  "strike": 40,
  "volatility": 0.2,
  "years": 0.5
}
JSON