σμimplied vol · KKmax(S−K,0)udβρᵢⱼfat tailsPnL · drawdownyield · TdSₜ = μSₜ dt + σSₜ dWₜC = S·N(d₁) − K·e⁻ʳᵀ·N(d₂)σₚ² = wᵀΣwd₁ = [ln(S/K) + (r + σ²⁄2)T] ⁄ σ√T∂V/∂t + ½σ²S²·∂²V/∂S² + rS·∂V/∂S − rV = 0Sharpe = (Rₚ − R_f) ⁄ σₚVaR₉₉ = μ − 2.33σρ = Cov(X,Y) ⁄ σₓσᵧE[Rₚ] = Σ wᵢ·E[Rᵢ]φ(x) = e^(−x²/2) ⁄ √2πE[Rᵢ] = R_f + βᵢ(E[Rₘ] − R_f)dXₜ = θ(μ − Xₜ)dt + σ dWₜσ²ₜ = ω + α·ε²ₜ₋₁ + β·σ²ₜ₋₁C − P = S − K·e⁻ʳᵀΔ = ∂V/∂S Γ = ∂²V/∂S²p = (e^(rΔt) − d) ⁄ (u − d)rₜ = ln(Pₜ ⁄ Pₜ₋₁)E[Xₜ₊₁ | ℱₜ] = Xₜf* = (bp − q) ⁄ bz = (x − μ) ⁄ σP(N=k) = λᵏe^(−λ) ⁄ k!Θ = −∂V/∂Tν = S·φ(d₁)·√Tmin wᵀΣw s.t. wᵀμ = μ*∫Σ∂∞λ
uantCraft AcademyRoadmapsSkills
Ctrl K
AO
+1.2k Learners
LoginJoin ↗
RoadmapsSkills
AO
+1.2k Learners
Login
  • English
  • Français
  • Español
  • العربية
  • Português
  • Deutsch
  • 日本語
  • 中文
σμimplied vol · KKmax(S−K,0)udβρᵢⱼfat tailsPnL · drawdownyield · TdSₜ = μSₜ dt + σSₜ dWₜC = S·N(d₁) − K·e⁻ʳᵀ·N(d₂)σₚ² = wᵀΣwd₁ = [ln(S/K) + (r + σ²⁄2)T] ⁄ σ√T∂V/∂t + ½σ²S²·∂²V/∂S² + rS·∂V/∂S − rV = 0Sharpe = (Rₚ − R_f) ⁄ σₚVaR₉₉ = μ − 2.33σρ = Cov(X,Y) ⁄ σₓσᵧE[Rₚ] = Σ wᵢ·E[Rᵢ]φ(x) = e^(−x²/2) ⁄ √2πE[Rᵢ] = R_f + βᵢ(E[Rₘ] − R_f)dXₜ = θ(μ − Xₜ)dt + σ dWₜσ²ₜ = ω + α·ε²ₜ₋₁ + β·σ²ₜ₋₁C − P = S − K·e⁻ʳᵀΔ = ∂V/∂S Γ = ∂²V/∂S²p = (e^(rΔt) − d) ⁄ (u − d)rₜ = ln(Pₜ ⁄ Pₜ₋₁)E[Xₜ₊₁ | ℱₜ] = Xₜf* = (bp − q) ⁄ bz = (x − μ) ⁄ σP(N=k) = λᵏe^(−λ) ⁄ k!Θ = −∂V/∂Tν = S·φ(d₁)·√Tmin wᵀΣw s.t. wᵀμ = μ*∫Σ∂∞λ
uantCraft AcademyRoadmapsSkills
Ctrl K
AO
+1.2k Learners
LoginJoin ↗
RoadmapsSkills
AO
+1.2k Learners
Login
  • English
  • Français
  • Español
  • العربية
  • Português
  • Deutsch
  • 日本語
  • 中文
Derivatives Pricing skill›Module 4 · Rate options and credit›Topic 4.1·~55 minAdvanced

Interest-rate options and the Black-76 formula

Skill positionModule 4 of 6 · Topic 1 of 3
4.1 Interest-rate options and the Black-76 formula
—Lab score— / 100Total XP—Streak—
Lecture0% read

9 min readCode examples: 6

  1. 01Black-76: a Black-Scholes for rates
  2. 02Caplets, caps and floors
  3. 03Put-call parity and the at-the-money strike
  4. 04Vega and implied volatility
  5. 05A 5-year cap on three real days
  6. 06What you will build

On 9 October 2026 a 5-year cap struck at the at-the-money rate of 5.18%, on a notional of one million, costs 31,496 at a flat volatility of 30%. The same cap on 3 January 2022 cost 12,769, with the strike at 1.62%. Same volatility, same formula, two and a half times the price: the difference is the level of rates. This topic builds the pricing of caps and floors, the options that protect a floating-rate borrower or lender.

01

Black-76: a Black-Scholes for rates

Where we are. The last topic priced an option on a stock with a simulation. Interest-rate options are everywhere in banks and are priced by a formula. A cap protects someone who pays a floating rate: if the rate rises above a strike, the cap pays the difference. A floor protects someone who receives a floating rate: it pays when the rate falls below the strike.

DefinitionBlack-76

The Black-Scholes formula applied to a *forward* price or rate instead of a spot price. The underlying is the forward value for the date of the option, the discount factor of the payment date brings the answer to today, and there is no need for an interest rate inside the formula because the forward already contains it.

call = P × ( F × N(d1) − K × N(d2) ), put = P × ( K × N(−d2) − F × N(−d1) )(1)F forward rate, K strike, P discount factor of the payment date, N the standard normal distribution function
d1 = ( ln(F / K) + σ² × T / 2 ) / ( σ × √T ), d2 = d1 − σ × √T(2)σ the volatility of the forward rate (a fraction per year), T the time to the expiry of the option in years

Worked example 1. *Problem:* a forward rate of 5%, a strike of 5%, a volatility of 30%, one year to expiry and a discount factor of 1. What is the call worth, and what is the put? Then change the strike to 4%, the expiry to 2 years and the discount factor to 0.9: what do call minus put give? *Plan:* apply the formulas and check the difference. *Steps:* below.

main.pyPython
print(round(black76_call(0.05, 0.05, 0.3, 1.0, 1.0), 6), round(black76_put(0.05, 0.05, 0.3, 1.0, 1.0), 6))1call = black76_call(0.05, 0.04, 0.3, 2.0, 0.9)put = black76_put(0.05, 0.04, 0.3, 2.0, 0.9)print(round(call, 6), round(put, 6), round(call - put, 6), round(0.9 * (0.05 - 0.04), 6))2
0.005962 0.005962
0.012205 0.003205 0.009 0.009
  1. 1At the money, call and put.
  2. 2Call minus put against the discounted forward minus strike.

*Check:* at the money both are worth 0.005962, about 0.6% of the notional. With the 4% strike, the 2-year expiry and the discount factor 0.9, the call is 0.012205 and the put 0.003205, and the difference is 0.009, exactly 0.9 × (0.05 − 0.04). *What to notice:* call minus put is the discounted forward minus strike. It does not depend on the volatility, which is why puts and calls cannot be priced independently.

02

Caplets, caps and floors

A cap is not one option but a row of them. Consider a loan that resets its rate every year. Each year the rate for the next year is set at the start of the year and paid at the end. The cap pays, at the end of each year, the notional times the amount by which that rate exceeds the strike.

DefinitionCaplet

One period of a cap: it pays notional × accrual × max(rate − strike, 0) at the end of the period, where the rate is fixed at its start. It is a call on a forward rate that expires at the fixing date but pays later, so it is priced with Black-76 using the discount factor of the payment date.

A cap is the sum of its caplets, and a floor is the sum of its floorlets (puts). The rate of the first year is already known today, so the market's cap starts at the second year: an n-year cap has the caplets of the years 2 to n. Caplet i uses the forward rate f_i = P_(i−1) / P_i − 1, expires at time i − 1 and pays at time i.

Worked example 2. *Problem:* on the curve of par rates 2%, 3%, 4%, 4.5% and 5% (annual), what is the caplet of year 3 with a strike of 4%, a notional of one million and a volatility of 30%? *Plan:* find the discount factors and the forward rate of year 3, then apply Black-76 with expiry 2 years and the discount factor of year 3. *Steps:* below.

main.pyPython
par = np.array([0.02, 0.03, 0.04, 0.045, 0.05])discount = bootstrap_discount(par)forwards = forward_rates(discount)1print(round(float(forwards[2]), 6), round(float(discount[2]), 6))2print(round(caplet(forwards[2], 0.04, 0.3, 2, discount[2], 1e6), 2))
0.061662 0.887588
20705.16
  1. 1The forward rate of year 3 and the discount factor of its payment date.
  2. 2Expiry 2 years, payment at 3 years.

*Check:* the forward rate of year 3 is 6.1662% and its discount factor 0.887588. In the formula, d1 = 1.2322 and d2 = 0.8080, so N(d1) = 0.8911 and N(d2) = 0.7904, and the price per unit is 0.887588 × (0.061662 × 0.8911 − 0.04 × 0.7904) = 0.020705. On a million this is 20,705.16. *What to notice:* the option is in the money by 2.17 percentage points, and the discounted intrinsic value is 19,227. The rest, 1,478, is the value of the chance that rates move further.

Worked example 3. *Problem:* price the whole 5-year cap and the matching floor on this curve, strike 4%. *Plan:* sum the four caplets (years 2 to 5) and the four floorlets. *Steps:* below.

main.pyPython
print([round(caplet(forwards[i - 1], 0.04, 0.3, i - 1, discount[i - 1], 1e6), 2) for i in range(2, 6)])1print(round(cap_price(discount, 0.04, 0.3, 5), 2), round(floor_price(discount, 0.04, 0.3, 5), 2))2
[4709.89, 20705.16, 20611.51, 28022.26]
74048.82 10191.27
  1. 1The four caplets.
  2. 2The cap and the floor.

*Check:* the caplets are 4,709.89, 20,705.16, 20,611.51 and 28,022.26, and they add up to the cap 74,048.82. The floor is only 10,191.27: all forward rates but the first (2%, which is out of the cap) are above 4%, so the caps are in the money and the floors are not. *What to notice:* the later caplets are worth more, for two reasons: their forwards are higher and they have more time left for the rate to move.

03

Put-call parity and the at-the-money strike

The relation of example 1 holds for every caplet, so it holds for the whole cap. Cap minus floor is the value of receiving the floating rate and paying the strike in the years 2 to n. We call it the forward leg.

cap − floor = notional × Σ_(i=2..n) ( f_i − K ) × P_i(3)the right side does not depend on the volatility; it is zero when K is the at-the-money strike, K = Σ f_i P_i / Σ P_i

Worked example 4. *Problem:* check the parity on the cap and floor of example 3, then find the at-the-money strike for which the cap and the floor cost the same. *Plan:* compute the forward leg, then the weighted average of the forwards. *Steps:* below.

main.pyPython
print(round(forward_leg(discount, 0.04, 5), 2), round(cap_price(discount, 0.04, 0.3, 5) - floor_price(discount, 0.04, 0.3, 5), 2))1strike = atm_strike(discount, 5)print(round(strike, 6), round(cap_price(discount, strike, 0.3, 5), 2), round(floor_price(discount, strike, 0.3, 5), 2))2
63857.55 63857.55
0.058539 41587.81 41587.81
  1. 1The forward leg and cap minus floor.
  2. 2At the ATM strike the cap and the floor are equal.

*Check:* the forward leg is 63,857.55, and cap minus floor is 74,048.82 − 10,191.27 = 63,857.55. The at-the-money strike is 5.8539%, higher than 4% because it is a weighted average of the forward rates 4.04%, 6.17%, 6.18% and 7.34%. At that strike the cap and the floor both cost 41,587.81. *What to notice:* parity ties the floor to the cap with no volatility at all. So once you can price caps, you have floors for free.

04

Vega and implied volatility

Volatility is the one input that cannot be read off a curve, so it is what traders argue about. Two tools matter. Vega says how much the price moves if the volatility moves by one point. Implied volatility goes the other way: given a market price, find the volatility that the formula needs to give it. Desks quote caps in implied volatility, not in money.

The price of a call rises with the volatility, so implied volatility can be found by bisection: start with an interval that must contain it, test the middle, keep the half where the price crosses the target, and repeat. A hundred halvings of an interval of width 10 gives an answer to far more digits than any market quote has.

Worked example 5. *Problem:* what is the vega of the 4% cap of example 3? Then take the price of caplet 3 and recover its volatility. *Plan:* reprice the cap at 31% and subtract; then apply bisection to the caplet price per unit notional. *Steps:* below.

main.pyPython
print(round(cap_vega(discount, 0.04, 0.3, 5), 2), round(cap_price(discount, 0.04, 0.31, 5) - cap_price(discount, 0.04, 0.3, 5), 2))1price = caplet(forwards[2], 0.04, 0.3, 2, discount[2], 1.0)print(round(price, 6), round(implied_vol(price, forwards[2], 0.04, 2, discount[2]), 6))2
689.52 689.52
0.020705 0.3
  1. 1One point of volatility, two ways.
  2. 2From a price back to a volatility.

*Check:* the vega is 689.52: raising the volatility from 30% to 31% adds 689.52 to the cap, from 74,048.82 to 74,738.34. The caplet price per unit is 0.020705 and bisection returns a volatility of 0.3. *What to notice:* the vega is small because the cap is in the money: most of its value is intrinsic. At the money the vega is larger, 1,027 for the real cap of 2026.

05

A 5-year cap on three real days

Worked example 6. *Problem:* price the 5-year at-the-money cap and floor on the US Treasury curve for three days, at a flat volatility of 30%. *Plan:* study builds the discount curve of each day, finds the at-the-money strike, and returns the cap, the floor, the cap with a strike one point higher, the vega, the parity gap and the volatility recovered from caplet 3. *Steps:* below.

main.pyPython
treasury = load_treasury()out = study(treasury)1for date, row in out.items():    print(date, round(row["strike"], 5), round(row["cap"]), round(row["floor"]), round(row["cap_up"]), round(row["vega"]), round(row["parity_gap"], 6), round(row["implied"], 4))
2022-01-03 0.01622 12769 12769 4591 340 0.0 0.3
2023-07-03 0.03848 24266 24266 12978 750 0.0 0.3
2026-10-09 0.05176 31496 31496 20380 1027 -0.0 0.3
  1. 1One result per date.

*Check:* the at-the-money strike rises from 1.62% in January 2022 to 3.85% in July 2023 and 5.18% in October 2026. The cap rises from 12,769 to 24,266 and 31,496, and it equals the floor each time, so the parity gap is 0. Raising the strike by one point cuts the cap to 4,591, 12,978 and 20,380. The vega goes from 340 to 750 and 1,027, and the volatility recovered from caplet 3 is 0.3000 every time. *What to notice:* with the same volatility, the cap costs more when rates are higher, because the same percentage move is a larger move in rate.

Lognormal rates cannot go negative

Black-76 assumes that the forward rate is positive and moves by percentages. When rates were near zero or negative, as in Europe and Japan, the formula broke down, and desks switched to a model with absolute moves (the normal or Bachelier model) or shifted the rates up. The flat 30% used here is also an assumption: a real desk reads a volatility for each strike and expiry from the market.

  • FunctionQuestion it answers
  • black76_call(forward, strike, vol, expiry, discount)What is a call on a forward rate worth?N(d1) and N(d2), then discount
  • black76_put(forward, strike, vol, expiry, discount)What is the put worth?call minus put is P(F - K)
  • caplet(forward, strike, vol, fixing, discount_pay, notional, accrual)What is one period of a cap worth?expiry at the fixing, discount at the payment
  • cap_price(discount, strike, vol, n, notional)What does an n-year cap cost?sum of the caplets of years 2 to n
  • floor_price(discount, strike, vol, n, notional)What does an n-year floor cost?sum of the floorlets
  • forward_leg(discount, strike, n, notional)What is cap minus floor?sum of (f - K) times P
  • atm_strike(discount, n)Where do cap and floor cost the same?weighted average of the forwards
  • cap_vega(discount, strike, vol, n, notional)What does one volatility point do?reprice at vol + 0.01
  • implied_vol(price, forward, strike, expiry, discount)Which volatility gives this price?bisection on the call price
What the real data saysUS Treasury par yields, a 5-year at-the-money cap on a notional of 1,000,000, flat Black volatility of 30%
At-the-money strike, 3 Jan 20221.62 %cap 12,769, vega 340
At-the-money strike, 3 Jul 20233.85 %cap 24,266, vega 750
At-the-money strike, 9 Oct 20265.18 %cap 31,496, vega 1,027
Cap minus floor0at the money, on every day

Key takeaways

  • Black-76 is Black-Scholes on a forward. Price a caplet as a call on the forward rate, expiring at the fixing date, discounted from the payment date.
  • A cap is a row of caplets. The years 2 to n, each with its own forward f_i = P_(i-1)/P_i - 1; the first rate is already known.
  • Parity prices floors for free. cap − floor = notional × Σ (f_i − K) P_i, with no volatility; at the weighted-average forward the cap and the floor cost the same.
  • Quote volatility, not money. Vega is the price change for one volatility point; implied volatility is found by bisection because price rises with volatility.
Quick check
Your turn. A 3-year cap with strike K costs 6,200 and the matching 3-year floor costs 2,100. What is the value of receiving the floating rate and paying K in the years 2 and 3 (the forward leg)?
Pick an answer.
06

What you will build

The lab follows the lecture. Tasks 1 and 2 write the Black-76 call and put. Task 3 turns them into a caplet, and tasks 4 and 5 sum the caplets and floorlets into a cap and a floor. Task 6 is the forward leg that parity ties them to, and task 7 finds the strike at which cap and floor cost the same. Task 8 measures vega, task 9 recovers a volatility from a price, and task 10 prices a 5-year cap on three real days.

Next topic: caps pay when interest rates move. The next one, Credit: CDS and hazard rates, prices insurance against a company failing to pay, with a curve of default probabilities built the same way as a curve of discount factors.

Lab · what's graded

10 tasks · 100 pts
  • The Black-76 call10 pts
  • The Black-76 put5 pts
  • A caplet10 pts
  • A cap15 pts
  • A floor5 pts
  • The forward leg10 pts
  • The at-the-money strike10 pts
  • The vega of a cap5 pts
  • Implied volatility10 pts
  • A 5-year cap on three days20 pts
Explorer · lab-dv-04
▾ lab-dv-04
▾ data
…
bash · in-browser
learner@quantcraft:~/lab-dv-04$
Python not loaded yetPythonLn 1, Col 1Spaces: 4UTF-8

Reset this topic?

Everything in lab-dv-04 goes back to the starter files and the terminal is cleared. Your current solution will be lost — this can't be undone.

Will be reset
  • main.py → starter code
  • Terminal history and test output
  • Unsubmitted changes
Will be kept
  • Best lab score
  • Your XP and streak
  • Lecture progress and notes