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
Where
- Price of the underlying asset now
spot - Strike price
strike - Risk-free rate per year, continuously compounded
risk_free_rate - Dividend yield per year, continuously compounded
dividend_yield - Volatility of the asset's return per year
volatility - Time to expiry, in years
years - The first standardized distance the normal distribution is read at
- The second: the first less the volatility over the time to expiry
- The standard normal cumulative distribution
- The standard normal density
- Price of a European call
price - Price of a European put
price - The call's delta
delta - Gamma, the same for a call and a put
gamma - 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
| Name | Unit | Bounds | Description |
|---|---|---|---|
Option typeoption_typetext | text | A call (the right to buy) or a put (to sell) | |
Spotspotmoney · [0.01, 1e+07] | money | [0.01, 1e+07] | Price of the underlying asset now |
Strikestrikemoney · [0.01, 1e+07] | money | [0.01, 1e+07] | Strike price |
Yearsyearsyears · [0.001, 100] | years | [0.001, 100] | Time to expiry, in years |
Risk free raterisk_free_raterate · [-0.1, 1] | rate | [-0.1, 1] | Risk-free rate per year, continuously compounded |
Dividend yielddividend_yieldrate · [-0.1, 1] | rate | [-0.1, 1] | Dividend yield per year, continuously compounded |
Calculationcalculationtext | text | Price, Greeks and the put-call parity residual | |
Volatilityvolatilityvolatility · [0.001, 5] | volatility | [0.001, 5] | Volatility of the asset's return per year |
Volatility implied by a price (implied_volatility): 8 inputs
| Name | Unit | Bounds | Description |
|---|---|---|---|
Option typeoption_typetext | text | A call (the right to buy) or a put (to sell) | |
Spotspotmoney · [0.01, 1e+07] | money | [0.01, 1e+07] | Price of the underlying asset now |
Strikestrikemoney · [0.01, 1e+07] | money | [0.01, 1e+07] | Strike price |
Yearsyearsyears · [0.001, 100] | years | [0.001, 100] | Time to expiry, in years |
Risk free raterisk_free_raterate · [-0.1, 1] | rate | [-0.1, 1] | Risk-free rate per year, continuously compounded |
Dividend yielddividend_yieldrate · [-0.1, 1] | rate | [-0.1, 1] | Dividend yield per year, continuously compounded |
Calculationcalculationtext | text | Volatility implied by a price | |
Option priceoption_pricemoney · [0, 1e+12] | money | [0, 1e+12] | The option's price |
Outputs
Price, Greeks and the put-call parity residual (price): 9 outputs
| Name | Unit | Bounds | Description |
|---|---|---|---|
Calculationcalculationtext | text | Price, Greeks and the put-call parity residual | |
Pricepricemoney · [0, 1e+15] | money | [0, 1e+15] | Option price |
Deltadeltaratio · [-100000, 100000] | ratio | [-100000, 100000] | Change in price per unit of spot |
Gammagammaratio · [0, 1e+12] | ratio | [0, 1e+12] | Change in delta per unit of spot |
Vegavegamoney · [0, 1e+15] | money | [0, 1e+15] | Change in price per 1.00 of volatility |
Thetathetamoney · [-1e+15, 1e+15] | money | [-1e+15, 1e+15] | Change in price per year that passes |
Rhorhomoney · [-1e+15, 1e+15] | money | [-1e+15, 1e+15] | Change in price per 1.00 of the risk-free rate |
Dividend rhodividend_rhomoney · [-1e+15, 1e+15] | money | [-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] | money | [-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
| Name | Unit | Bounds | Description |
|---|---|---|---|
Calculationcalculationtext | text | Volatility implied by a price | |
Implied volatilityimplied_volatilityvolatility · [0.001, 5] | volatility | [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] | money | [0, 1e+15] | No-arbitrage lower bound on the price |
Upper boundupper_boundmoney · [0, 1e+15] | money | [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
- 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)
- 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)
- 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, orrun_modelwith 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:
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())
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