Sub topic 1
Spot Rates and Discount Factors
Prerequisites
This chapter assumes you can calculate present value, price a bond from its cash flows, and read yield to maturity (YTM). You should know what coupon, par value, and maturity mean. Basic Python is enough for the code.
Spot rates and discount factors
A spot rate is the annual yield on a zero-coupon bond that pays one cash flow at a single future date. A discount factor is the present value of 1 received at that date. If the t-year spot rate is zt, then DFt = 1 / (1 + z_t)^t.
Yield to maturity versus the par curve
YTM is one rate that, applied to every cash flow of a bond, gives its price. It blends coupons and principal, so it mixes returns from different dates. The par curve lists the coupon rate at which each maturity trades at par. Par rates are simpler to observe, but they are not the spot rates. The coupon on a longer par bond also pays out earlier, so the par rate reflects those earlier cash flows.
Bootstrapping spot rates from par rates
Bootstrapping recovers spot rates from par rates one maturity at a time. A par bond is worth 1, so c × (sum of earlier discount factors) + (1 + c) × DFn = 1. Solve for DFn, then convert it to a spot rate.
par_rates = [0.02, 0.03, 0.04] # annual-pay par bonds, maturities 1 to 3 years
dfs = []
for n, c in enumerate(par_rates, start=1):
dfs.append((1 - c * sum(dfs)) / (1 + c))
spots = [df ** (-1 / n) - 1 for n, df in enumerate(dfs, start=1)]
print(spots)Implied forward rates and forward pricing
A forward rate is the rate implied today for a future period. No-arbitrage requires that (1 + zb)^b = (1 + za)^a × (1 + fa,b)^(b − a). Use the forward rate to price a forward contract on a zero-coupon bond: the forward price is P(b) / P(a), where P(t) = DFt.
spots = [0.02, 0.03, 0.04] # 1-, 2-, 3-year spot rates
def forward(spots, a, b):
return ((1 + spots[b - 1]) ** b / (1 + spots[a - 1]) ** a) ** (1 / (b - a)) - 1
print(forward(spots, 1, 2)) # about 0.0401Why the curve has its shape
Four theories explain the slope of the spot curve:
- Pure expectations: forward rates equal the market's expected future short rates.
- Liquidity preference: investors demand a premium for longer maturities, so forwards sit above expected rates.
- Segmented markets: supply and demand in each maturity range set rates independently.
- Preferred habitat: investors move across maturities only for an extra premium.
How the curve moves
Yield curve changes usually fall into three types:
| Movement | What changes | Typical effect |
|---|---|---|
| Level | All rates shift together | Parallel shift in the curve |
| Slope | Short and long rates move apart | Steepening or flattening |
| Curvature | Middle rates move relative to both ends | Hump or dip |
Level and slope explain most of the variation in observed curves.
Exercise
Exercise
Using the first code example, what is the 1-year spot rate when the 1-year par rate is 2%?
Show answer
The first discount factor is 1 / 1.02 = 0.9804. The spot rate is 0.9804^(-1) − 1 = 2%, so the 1-year spot rate equals the par rate.