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 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 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 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 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 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\phi(d_1)\sqrt(T)$$

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

Source code in 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 * 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 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 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 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 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 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 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 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

$$\frac{\mathcal{V}}{S}\bigg[ 1-\frac{d_1}{\sigma\sqrt{T}} \bigg]$$

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

Sensitivity of delta with respect to change in volatility.

Source code in blackscholes/base.py
129
130
131
def vanna(self) -> float:
    """Sensitivity of delta with respect to change in volatility."""
    return -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 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 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 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 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 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 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 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 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 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 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 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 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 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.

Delta

Symbol for Delta is $\Delta$.

Call

$$\frac{e^{-rT}}{\sqrt{T}}\phi(d_1)$$

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

Source code in blackscholes/call.py
167
168
169
170
171
172
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.
    """
    return exp(-self.r * self.T) * self._pdf(self._d1) / sqrt(self.T)

Put

$$-\frac{e^{-rT}}{\sqrt{T}}\phi(d_1)$$

Rate of change in option price with respect to the underlying price (1st derivative).

Source code in blackscholes/put.py
157
158
159
160
161
def delta(self) -> float:
    """Rate of change in option price
    with respect to the underlying price (1st derivative).
    """
    return -exp(-self.r * self.T) * self._pdf(self._d1) / sqrt(self.T)

Gamma

Symbol for Gamma is $\Gamma$.

$$\frac{\phi(d_1) (\frac{d_1}{T \sigma S} - \frac{1}{S^2})}{S \sigma \sqrt{T}}$$

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

Source code in blackscholes/base.py
639
640
641
642
643
def gamma(self) -> float:
    """Rate of change in delta
    with respect to the underlying price (2nd derivative).
    """
    return (self._pdf(self._d1) * (self._d1 / (self.T * self.sigma * self.S) - 1 / self.S**2)) / (self.S * self.sigma * sqrt(self.T))

Vega

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

Note that the Vega for the put is the negative of the Vega for the call. This is a peculiarity of binary options. For vanilla option the Vega for the put is the same as the Vega for the call, but not for the case of binary options.

Call

$$S \sqrt{T} \phi(d_1) \frac{d_1}{\sigma}$$

Rate of change in option price with respect to the volatility (1st derivative).

Source code in blackscholes/call.py
174
175
176
177
178
def vega(self) -> float:
    """Rate of change in option price
    with respect to the volatility (1st derivative).
    """
    return self.S * sqrt(self.T) * self._pdf(self._d1) * self._d1 / self.sigma

Put

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

Rate of change in option price with respect to the volatility (1st derivative).

Source code in blackscholes/put.py
163
164
165
166
167
def vega(self) -> float:
    """Rate of change in option price
    with respect to the volatility (1st derivative).
    """
    return -self.S * sqrt(self.T) * self._pdf(self._d1) * self._d1 / self.sigma

Theta

Call

$$r K e^{-rT} \Phi(d_2) - \frac{S \phi(d_1) \sigma}{2 \sqrt{T}}$$

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

Source code in blackscholes/call.py
180
181
182
183
184
def theta(self) -> float:
    """Rate of change in option price
    with respect to time (i.e. time decay).
    """
    return self.r * self.K * exp(-self.r * self.T) * self._cdf(self._d2) - (self.S * self._pdf(self._d1) * self.sigma) / (2 * sqrt(self.T))

Put

$$- r K e^{-rT} \Phi(-d_2) - \frac{S \phi(d_1) \sigma}{2 \sqrt{T}}$$

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

Source code in blackscholes/put.py
169
170
171
172
173
def theta(self) -> float:
    """Rate of change in option price
    with respect to time (i.e. time decay).
    """
    return -self.r * self.K * exp(-self.r * self.T) * self._cdf(-self._d2) - (self.S * self._pdf(self._d1) * self.sigma) / (2 * sqrt(self.T))

Rho

Call

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

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

Source code in blackscholes/call.py
186
187
188
189
190
def rho(self) -> float:
    """Rate of change in option price
    with respect to the risk-free rate.
    """
    return self.T * self.K * exp(-self.r * self.T) * self._cdf(self._d2)

Put

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

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

Source code in blackscholes/put.py
175
176
177
178
179
def rho(self) -> float:
    """Rate of change in option price
    with respect to the risk-free rate.
    """
    return -(self.T * self.K * exp(-self.r * self.T) * self._cdf(-self._d2))