Skip to content

3. The Greeks (Black-Scholes)

Below you will find all Greeks for the Black-Scholes-Merton model as formulas, code and descriptions.

Parameters

Reference of all symbols that are used in the formulas:

$S$ = Asset price

$K$ = Strike price

$T$ = Time to maturity (in years)

$r$ = Risk-free rate

$\sigma$ = Volatility

$q$ = Annual dividend yield

$\phi(.)$ = Probability Density Function (PDF) of $\mathcal{N}(0, 1)$

$\Phi(.)$ = Cumulative Density Function (CDF) of $\mathcal{N}(0, 1)$

$d_1 = \frac{ln(\frac{S}{K}) + (r - q + \frac{1}{2}\sigma^2)T}{\sigma\sqrt{T}}$

$d_2 = d_1 - \sigma\sqrt{T}$

Vanilla Options

Vanilla options are the most common type of options. When people normally refer to a call or put option, they are referring to a vanilla option.

Delta

Symbol for Delta is $\Delta$.

Unit: percentage in decimal form.

Call

$$e^{-qT}\Phi(d_1)$$

Rate of change in option price with respect to the forward price (1st derivative). Note that this is the forward delta. For the spot delta, use spot_delta.

Source code in src/blackscholes/call.py
31
32
33
34
35
36
37
def delta(self) -> float:
    """Rate of change in option price
    with respect to the forward price (1st derivative).
    Note that this is the forward delta.
    For the spot delta, use `spot_delta`.
    """
    return exp(-self.q * self.T) * self._cdf(self._d1)

Put

$$e^{-qT}(\Phi(d_1) - 1)$$

Rate of change in option price with respect to the forward price (1st derivative). Note that this is the spot delta. For the forward delta, use forward_delta.

Source code in src/blackscholes/put.py
30
31
32
33
34
35
36
37
def delta(self) -> float:
    """
    Rate of change in option price
    with respect to the forward price (1st derivative).
    Note that this is the spot delta.
    For the forward delta, use `forward_delta`.
    """
    return exp(-self.q * self.T) * (self._cdf(self._d1) - 1)

Spot Delta

Call

$$e^{(r - q)T}\Phi(d_1)$$

Delta discounted for interest rates. For the forward delta, use delta.

Source code in src/blackscholes/call.py
39
40
41
42
43
44
def spot_delta(self) -> float:
    """
    Delta discounted for interest rates.
    For the forward delta, use `delta`.
    """
    return exp((self.r - self.q) * self.T) * self._cdf(self._d1)

Put

$$e^{(r - q)T}(\Phi(d_1) - 1)$$

Delta discounted for interest rates. For the forward delta, use delta.

Source code in src/blackscholes/put.py
39
40
41
42
43
44
def spot_delta(self) -> float:
    """
    Delta discounted for interest rates.
    For the forward delta, use `delta`.
    """
    return exp((self.r - self.q) * self.T) * (self._cdf(self._d1) - 1)

Gamma

Symbol for Gamma is $\Gamma$.

Unit: percentage in decimal form.

$$e^{-qT}\frac{\phi(d_1)}{S\sigma\sqrt{T}}$$

Rate of change in delta with respect to the underlying asset price (2nd derivative).

Source code in src/blackscholes/base.py
76
77
78
79
80
81
82
83
84
def gamma(self) -> float:
    """
    Rate of change in delta with respect to the underlying asset price (2nd derivative).
    """
    return (
        exp(-self.q * self.T)
        * self._pdf(self._d1)
        / (self.S * self.sigma * sqrt(self.T))
    )

Vega

Symbol for Vega is $\mathcal{V}$.

Unit: percentage (regular form).

$$S e^{-qT}\phi(d_1)\sqrt{T}$$

Rate of change in option price with respect to the volatility of the asset.

Source code in src/blackscholes/base.py
 96
 97
 98
 99
100
def vega(self) -> float:
    """
    Rate of change in option price with respect to the volatility of the asset.
    """
    return self.S * exp(-self.q * self.T) * self._pdf(self._d1) * sqrt(self.T)

Theta

Symbol for Theta is $\Theta$.

Unit: percentage in decimal form.

Theta value is annualized. To get the daily value, divide by 365.

Call

$$-e^{-qT}\frac{S\phi(d_1)\sigma}{2\sqrt{T}} - rKe^{-rT}\Phi(d_2) + qSe^{-qT}\Phi(d_1)$$

Rate of change in option price with respect to time (i.e. time decay).

Source code in src/blackscholes/call.py
52
53
54
55
56
57
58
59
60
61
def theta(self) -> float:
    """Rate of change in option price
    with respect to time (i.e. time decay).
    """
    return (
        (-exp(-self.q * self.T) * self.S * self._pdf(self._d1) * self.sigma)
        / (2 * sqrt(self.T))
        - (self.r * self.K * exp(-self.r * self.T) * self._cdf(self._d2))
        + self.q * self.S * exp(-self.q * self.T) * self._cdf(self._d1)
    )

Put

$$-e^{-qT}\frac{S\phi(d_1)\sigma}{2\sqrt{T}} + rKe^{-rT}\Phi(-d_2) - qSe^{-qT}\Phi(-d_1)$$

Rate of change in option price with respect to time (i.e. time decay).

Source code in src/blackscholes/put.py
52
53
54
55
56
57
58
59
60
61
62
def theta(self) -> float:
    """Rate of change in option price
    with respect to time (i.e. time decay).
    """
    return (
        (-exp(-self.q * self.T) * self.S * self._pdf(self._d1) * self.sigma)
        / (2.0 * sqrt(self.T))
    ) + (
        self.r * self.K * exp(-self.r * self.T) * self._cdf(-self._d2)
        - self.q * self.S * exp(-self.q * self.T) * self._cdf(-self._d1)
    )

Epsilon (psi)

Call

$$-STe^{-qT}\Phi(d_1)$$

Change in option price with respect to underlying dividend yield.

Also known as psi.

Source code in src/blackscholes/call.py
69
70
71
72
def epsilon(self) -> float:
    """Change in option price with respect to underlying dividend yield. \n
    Also known as psi."""
    return -self.S * self.T * exp(-self.q * self.T) * self._cdf(self._d1)

Put

$$STe^{-qT}\Phi(-d_1)$$

Change in option price with respect to underlying dividend yield.

Also known as psi.

Source code in src/blackscholes/put.py
70
71
72
73
def epsilon(self) -> float:
    """Change in option price with respect to underlying dividend yield. \n
    Also known as psi."""
    return self.S * self.T * exp(-self.q * self.T) * self._cdf(-self._d1)

Rho

Symbol for Rho is $\P$.

Unit: percentage (regular form).

Call

$$KTe^{-rT}\Phi(d_2)$$

Rate of change in option price with respect to the risk-free rate.

Source code in src/blackscholes/call.py
63
64
65
66
67
def rho(self) -> float:
    """Rate of change in option price
    with respect to the risk-free rate.
    """
    return self.K * self.T * exp(-self.r * self.T) * self._cdf(self._d2)

Put

$$-KTe^{-rT}\Phi(-d_2)$$

Rate of change in option price with respect to the risk-free rate.

Source code in src/blackscholes/put.py
64
65
66
67
68
def rho(self) -> float:
    """Rate of change in option price
    with respect to the risk-free rate.
    """
    return -self.K * self.T * exp(-self.r * self.T) * self._cdf(-self._d2)

Lambda

$$\Delta \frac{S}{V}$$

where $\Delta$ indicates the Delta Greek.

Percentage change in option value per % change in asset price. Also called gearing.

Source code in src/blackscholes/base.py
123
124
125
126
127
def lambda_greek(self) -> float:
    """Percentage change in option value per %
    change in asset price. Also called gearing.
    """
    return self.delta() * self.S / self.price()

Vanna

$$-e^{-qT}\frac{\phi(d_1) d_2}{\sigma}$$

(equivalent to $\mathcal{V}\cdot\frac{-d_2}{S\sigma\sqrt{T}}$ with Vega $\mathcal{V}=S e^{-qT}\phi(d_1)\sqrt{T}$).

Sensitivity of delta with respect to change in volatility.

Source code in src/blackscholes/base.py
129
130
131
def vanna(self) -> float:
    """Sensitivity of delta with respect to change in volatility."""
    return -exp(-self.q * self.T) * self._pdf(self._d1) * self._d2 / self.sigma

Charm

Call

$$qe^{-qT}\Phi(d_1) - e^{-qT}\phi(d_1) \frac{2(r-q)T - d_2\sigma\sqrt{T}}{2T\sigma\sqrt{T}}$$

Rate of change of delta over time (also known as delta decay).

Source code in src/blackscholes/call.py
74
75
76
77
78
79
80
81
82
def charm(self) -> float:
    """Rate of change of delta over time (also known as delta decay)."""
    return self.q * exp(-self.q * self.T) * self._cdf(self._d1) - exp(
        -self.q * self.T
    ) * self._pdf(self._d1) * (
        2.0 * (self.r - self.q) * self.T - self._d2 * self.sigma * sqrt(self.T)
    ) / (
        2.0 * self.T * self.sigma * sqrt(self.T)
    )

Put

$$-qe^{-qT}\Phi(-d_1) - e^{-qT}\phi(d_1) \frac{2(r-q)T - d_2\sigma\sqrt{T}}{2T\sigma\sqrt{T}}$$

Rate of change of delta over time (also known as delta decay).

Source code in src/blackscholes/put.py
75
76
77
78
79
80
81
82
83
def charm(self) -> float:
    """Rate of change of delta over time (also known as delta decay)."""
    return -self.q * exp(-self.q * self.T) * self._cdf(-self._d1) - exp(
        -self.q * self.T
    ) * self._pdf(self._d1) * (
        2.0 * (self.r - self.q) * self.T - self._d2 * self.sigma * sqrt(self.T)
    ) / (
        2.0 * self.T * self.sigma * sqrt(self.T)
    )

Vomma

$$\mathcal{V}\frac{d_1 d_2}{\sigma}$$

where $\mathcal{V}$ indicates the Vega Greek.

2nd order sensitivity to volatility.

Source code in src/blackscholes/base.py
138
139
140
def vomma(self) -> float:
    """2nd order sensitivity to volatility."""
    return self.vega() * self._d1 * self._d2 / self.sigma

Veta

$$-Se^{-qT}\phi(d_1)\sqrt{T} \bigg[ q+\frac{(r-q)d_1}{\sigma\sqrt{T}} - \frac{1+d_1d_2}{2T} \bigg]$$

Rate of change in vega with respect to time.

Source code in src/blackscholes/base.py
142
143
144
145
146
147
148
149
150
151
152
153
154
def veta(self) -> float:
    """Rate of change in `vega` with respect to time."""
    return (
        -self.S
        * exp(-self.q * self.T)
        * self._pdf(self._d1)
        * sqrt(self.T)
        * (
            self.q
            + (self.r - self.q) * self._d1 / (self.sigma * sqrt(self.T))
            - (1.0 + self._d1 * self._d2) / (2.0 * self.T)
        )
    )

Phi

$$e^{-rT} \frac{1}{K} \frac{1}{\sqrt{2\pi\sigma^2T}} e^{-\frac{1}{2\sigma^2 r} \bigg[ ln(\frac{K}{S}) - ((r - q) - \frac{1}{2}\sigma^2)T \bigg]^2}$$

2nd order partial derivative with respect to strike price.

Phi is used in the Breeden-Litzenberger formula.

Breeden-Litzenberger uses quoted option prices to estimate risk-neutral probabilities.

Source code in src/blackscholes/base.py
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
def phi(self) -> float:
    """2nd order partial derivative with respect to strike price. \n
    Phi is used in the Breeden-Litzenberger formula. \n
    Breeden-Litzenberger uses quoted option prices
    to estimate risk-neutral probabilities.
    """
    sigma2 = self.sigma**2
    exp_factor = (
        -1.0
        / (2.0 * sigma2 * self.T)
        * (log(self.K / self.S) - ((self.r - self.q) - 0.5 * sigma2) * self.T) ** 2
    )
    return (
        exp(-self.r * self.T)
        * (1.0 / self.K)
        * (1.0 / sqrt(2.0 * pi * sigma2 * self.T))
        * exp(exp_factor)
    )

Speed

$$-\frac{\Gamma}{S} \bigg( \frac{d_1}{\sigma\sqrt{T}} + 1 \bigg)$$

where $\Gamma$ is the Gamma Greek.

Rate of change in Gamma with respect to change in the underlying price.

Source code in src/blackscholes/base.py
175
176
177
def speed(self) -> float:
    """Rate of change in Gamma with respect to change in the underlying price."""
    return -self.gamma() / self.S * (self._d1 / (self.sigma * sqrt(self.T)) + 1.0)

Zomma

$$\Gamma \frac{d_1 d_2 - 1}{\sigma}$$

where $\Gamma$ is the Gamma Greek.

Rate of change of gamma with respect to changes in volatility.

Source code in src/blackscholes/base.py
179
180
181
def zomma(self) -> float:
    """Rate of change of gamma with respect to changes in volatility."""
    return self.gamma() * ((self._d1 * self._d2 - 1.0) / self.sigma)

Color

$$- e^{-qT}\frac{\phi(d_1)}{2ST\sigma\sqrt{T}} \bigg[2qr + 1 + \frac{2(r-q)T - d_2\sigma\sqrt{T}}{\sigma\sqrt{T}}d_1 \bigg]$$

Rate of change of gamma over time.

Source code in src/blackscholes/base.py
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
def color(self) -> float:
    """Rate of change of gamma over time."""
    return (
        -exp(-self.q * self.T)
        * self._pdf(self._d1)
        / (2.0 * self.S * self.T * self.sigma * sqrt(self.T))
        * (
            2.0 * self.q * self.T
            + 1.0
            + (
                2.0 * (self.r - self.q) * self.T
                - self._d2 * self.sigma * sqrt(self.T)
            )
            / (self.sigma * sqrt(self.T))
            * self._d1
        )
    )

Ultima

$$\frac{-\mathcal{V}}{\sigma^2} \big[ d_1 d_2 (1 - d_1 d_2) + d_1^2 + d_2^2 \big]$$

where $\mathcal{V}$ indicates the Vega Greek.

Sensitivity of vomma with respect to change in volatility.

3rd order derivative of option value to volatility.

Source code in src/blackscholes/base.py
201
202
203
204
205
206
207
208
209
210
def ultima(self) -> float:
    """Sensitivity of vomma with respect to change in volatility. \n
    3rd order derivative of option value to volatility.
    """
    d1d2 = self._d1 * self._d2
    return (
        -self.vega()
        / self.sigma**2
        * (d1d2 * (1.0 - d1d2) + self._d1**2 + self._d2**2)
    )

Dual Delta

Call

$$-e^{-rT}\Phi(d_2)$$

1st derivative in option price with respect to strike price.

Source code in src/blackscholes/call.py
46
47
48
49
50
def dual_delta(self) -> float:
    """1st derivative in option price
    with respect to strike price.
    """
    return exp(-self.r * self.T) * self._cdf(self._d2)

Put

$$e^{-rT}\Phi(-d_2)$$

1st derivative in option price with respect to strike price.

Source code in src/blackscholes/put.py
46
47
48
49
50
def dual_delta(self) -> float:
    """1st derivative in option price
    with respect to strike price.
    """
    return exp(-self.r * self.T) * self._cdf(-self._d2)

Dual Gamma

$$e^{-rT} \frac{\phi(d_2)}{K\sigma\sqrt{T}}$$

Rate of change in delta with respect to the strike price (2nd derivative).

Source code in src/blackscholes/base.py
86
87
88
89
90
91
92
93
94
def dual_gamma(self) -> float:
    """
    Rate of change in delta with respect to the strike price (2nd derivative).
    """
    return (
        exp(-self.r * self.T)
        * self._pdf(self._d2)
        / (self.K * self.sigma * sqrt(self.T))
    )

Alpha

Theta to gamma ratio. Also called "gamma rent". More info: "Dynamic Hedging" by Nassim Taleb, p. 178-181.

Source code in src/blackscholes/base.py
212
213
214
215
216
def alpha(self) -> float:
    """Theta to gamma ratio. Also called "gamma rent".
    More info: "Dynamic Hedging" by Nassim Taleb, p. 178-181.
    """
    return abs(self.theta()) / (self.gamma() + 1e-9)

Binary Options

Binary options are also called exotic, digital or bet options.

This library implements cash-or-nothing binaries with cash amount $= 1$ (payoff $1_{{S_T > K}}$ for the call and $1_{{S_T < K}}$ for the put). Dividend yield is assumed to be $q=0$. The price is

$$ V_{\text{call}} = e^{-rT}\Phi(d_2),\qquad V_{\text{put}} = e^{-rT}\Phi(-d_2). $$

Greeks below are the analytic partial derivatives of that price (not vanilla BSM building blocks).

Delta

Symbol for Delta is $\Delta$.

Call

$$e^{-rT}\frac{\phi(d_2)}{S\sigma\sqrt{T}}$$

Cash-or-nothing call delta: e^{-rT} n(d2) / (S σ √T).

Source code in src/blackscholes/call.py
167
168
169
170
171
172
173
def delta(self) -> float:
    """Cash-or-nothing call delta: e^{-rT} n(d2) / (S σ √T)."""
    return (
        exp(-self.r * self.T)
        * self._pdf(self._d2)
        / (self.S * self.sigma * sqrt(self.T))
    )

Put

$$-e^{-rT}\frac{\phi(d_2)}{S\sigma\sqrt{T}}$$

Cash-or-nothing put delta: -e^{-rT} n(d2) / (S σ √T).

Source code in src/blackscholes/put.py
157
158
159
160
161
162
163
def delta(self) -> float:
    """Cash-or-nothing put delta: -e^{-rT} n(d2) / (S σ √T)."""
    return (
        -exp(-self.r * self.T)
        * self._pdf(self._d2)
        / (self.S * self.sigma * sqrt(self.T))
    )

Gamma

Symbol for Gamma is $\Gamma$.

Call

$$-e^{-rT}\frac{\phi(d_2)\, d_1}{S^{2}\sigma^{2} T}$$

Cash-or-nothing call gamma (put subclasses negate).

Γ_call = -e^{-rT} n(d2) d1 / (S² σ² T)

Source code in src/blackscholes/base.py
654
655
656
657
658
659
660
661
662
663
664
def gamma(self) -> float:
    """Cash-or-nothing call gamma (put subclasses negate).

    Γ_call = -e^{-rT} n(d2) d1 / (S² σ² T)
    """
    return (
        -exp(-self.r * self.T)
        * self._pdf(self._d2)
        * self._d1
        / (self.S**2 * self.sigma**2 * self.T)
    )

Put

$$\Gamma_{\text{put}} = -\Gamma_{\text{call}}$$

Cash-or-nothing put gamma = -call gamma.

Source code in src/blackscholes/put.py
165
166
167
def gamma(self) -> float:
    """Cash-or-nothing put gamma = -call gamma."""
    return -super().gamma()

Vega

Symbol for Vega is $\mathcal{V}$.

Note that put vega is the negative of call vega for cash-or-nothing binaries (unlike vanilla options, where call and put vegas coincide when $q=0$).

Call

$$-e^{-rT}\frac{\phi(d_2)\, d_1}{\sigma}$$

Cash-or-nothing call vega: -e^{-rT} n(d2) d1 / σ.

Source code in src/blackscholes/call.py
175
176
177
178
179
180
181
182
def vega(self) -> float:
    """Cash-or-nothing call vega: -e^{-rT} n(d2) d1 / σ."""
    return (
        -exp(-self.r * self.T)
        * self._pdf(self._d2)
        * self._d1
        / self.sigma
    )

Put

$$e^{-rT}\frac{\phi(d_2)\, d_1}{\sigma}$$

Cash-or-nothing put vega: e^{-rT} n(d2) d1 / σ.

Source code in src/blackscholes/put.py
169
170
171
172
173
174
175
176
def vega(self) -> float:
    """Cash-or-nothing put vega: e^{-rT} n(d2) d1 / σ."""
    return (
        exp(-self.r * self.T)
        * self._pdf(self._d2)
        * self._d1
        / self.sigma
    )

Theta

Calendar theta $\Theta = -\partial V/\partial T$. With

$$ \frac{\partial d_2}{\partial T} = -\frac{d_2}{2T} + \frac{r - \tfrac{1}{2}\sigma^{2}}{\sigma\sqrt{T}}, $$

Call

$$e^{-rT}\Big[r\,\Phi(d_2) - \phi(d_2)\frac{\partial d_2}{\partial T}\Big]$$

Cash-or-nothing call theta (∂V/∂t = -∂V/∂T).

Source code in src/blackscholes/call.py
184
185
186
187
188
189
def theta(self) -> float:
    """Cash-or-nothing call theta (∂V/∂t = -∂V/∂T)."""
    return exp(-self.r * self.T) * (
        self.r * self._cdf(self._d2)
        - self._pdf(self._d2) * self._d2_dT()
    )

Put

$$e^{-rT}\Big[r\,\Phi(-d_2) + \phi(d_2)\frac{\partial d_2}{\partial T}\Big]$$

Cash-or-nothing put theta (∂V/∂t = -∂V/∂T).

Source code in src/blackscholes/put.py
178
179
180
181
182
183
def theta(self) -> float:
    """Cash-or-nothing put theta (∂V/∂t = -∂V/∂T)."""
    return exp(-self.r * self.T) * (
        self.r * self._cdf(-self._d2)
        + self._pdf(self._d2) * self._d2_dT()
    )

Rho

Call

$$e^{-rT}\Big[-T\,\Phi(d_2) + \phi(d_2)\frac{\sqrt{T}}{\sigma}\Big]$$

Cash-or-nothing call rho: e^{-rT} [-T N(d2) + n(d2) √T / σ].

Source code in src/blackscholes/call.py
191
192
193
194
195
196
def rho(self) -> float:
    """Cash-or-nothing call rho: e^{-rT} [-T N(d2) + n(d2) √T / σ]."""
    return exp(-self.r * self.T) * (
        -self.T * self._cdf(self._d2)
        + self._pdf(self._d2) * sqrt(self.T) / self.sigma
    )

Put

$$e^{-rT}\Big[-T\,\Phi(-d_2) - \phi(d_2)\frac{\sqrt{T}}{\sigma}\Big]$$

Cash-or-nothing put rho: e^{-rT} [-T N(-d2) - n(d2) √T / σ].

Source code in src/blackscholes/put.py
185
186
187
188
189
190
def rho(self) -> float:
    """Cash-or-nothing put rho: e^{-rT} [-T N(-d2) - n(d2) √T / σ]."""
    return exp(-self.r * self.T) * (
        -self.T * self._cdf(-self._d2)
        - self._pdf(self._d2) * sqrt(self.T) / self.sigma
    )