Quant Sandbox
DerivativesPortfolio & RiskFixed IncomeCorporate FinanceStochastic ModelsGuide
Guide
Derivatives pricing
01Forwards, calls and puts02Combining positions03Arbitrage and the forward price04Put–call parity05The one-step binomial model06Risk-neutral probabilities07Multi-step trees and backward induction08American options and early exercise09Delta and hedging10Geometric Brownian motion11The Black–Scholes formula12The Greeks: gamma, vega, theta and rho13Implied volatility and the volatility smile14Stochastic volatility and the Heston model15Static replication: Breeden–Litzenberger and Carr–Madan16Exotic options: barriers, Asians and digitals
Portfolio & risk
01Returns and volatility02Diversification and correlation03The efficient frontier and the capital market line04Risk aversion and the optimal complete portfolio05CAPM, beta and the security market line06Performance measures: Sharpe, Treynor, Jensen and information ratio07Factor models and systematic risk08Value at Risk and expected shortfall
Fixed income
01Bond prices and yields02Duration and convexity03Immunization and duration matching04Spot rates, forward rates and the yield curve05Bond futures and the cheapest-to-deliver06Interest rate swaps07Callable bonds and negative convexity08Credit risk: default probabilities and credit spreads
Corporate finance
01Interest, compounding and discounting02Annuities, perpetuities and loan amortization03Net present value and internal rate of return04The weighted average cost of capital05Capital structure and the Modigliani–Miller theorems06Discounted cash flow valuation07Relative valuation with multiples08Real options: the value of flexibility
Stochastic models
01Random walks and Brownian motion02Probability spaces, σ-algebras and random variables03Filtrations, adapted processes and stopping times04Conditional expectation and martingales05Properties of Brownian motion06The reflection principle and first passage times07The Brownian bridge08The Itô integral09Itô's lemma10Kolmogorov equations and the Feynman–Kac formula11Change of measure and Girsanov's theorem12Monte Carlo option pricing13Simulating SDEs: the Euler–Maruyama scheme14Mean reversion: Ornstein–Uhlenbeck and Vasicek15Jumps and the Merton jump-diffusion model
Knowledge graph

© 2026 Quant Sandbox · A study aid for quantitative finance

Privacy & dataNo cookies

This site does not use cookies and asks for no personal data. It keeps a few small settings in your browser's local storage — your chosen theme and language, the sidebar layout, and your progress and answers in the Guides — so it remembers them on your next visit. This data never leaves your device; clearing your browser storage removes it. Inputs you change can also be captured in the page URL, so you can share or bookmark a specific setup. The site uses Vercel Web Analytics, a privacy-friendly, cookieless service that records only anonymous, aggregated usage (such as page views) without identifying you or tracking you across other sites.

Guide/Fixed income

Duration and convexity

Lesson 2 of 8 · 1 min read

In "Bond prices and yields" the price of a bond was a decreasing, convex function of its yield. This lesson puts numbers on that curve: duration measures its slope, convexity its curvature. Together they tell you how much a bond's price changes when yields move, without repricing it. The notation is the same: face value F=100F = 100F=100, annual coupons at rate ccc, maturity TTT, yield to maturity yyy with annual compounding, price PPP.

Interest-rate risk

A bond's cash flows are fixed, but its price is not: when market yields rise, the same cash flows are discounted more heavily and the price falls. This exposure is interest-rate risk. Two bonds can react very differently to the same change in yield; a 30-year bond loses far more than a 1-year bill. We want one number that captures this sensitivity.

Macaulay duration

Write CFtCF_tCFt​ for the cash flow at year ttt (so CFt=cFCF_t = cFCFt​=cF for t<Tt < Tt<T and CFT=cF+FCF_T = cF + FCFT​=cF+F). Each cash flow contributes a present value PVt=CFt/(1+y)tPV_t = CF_t/(1+y)^tPVt​=CFt​/(1+y)t to the price, and these contributions add up to PPP. The Macaulay duration is the average payment time, weighted by these present values:

D=∑t=1Tt PVtP,PVt=CFt(1+y)t.D = \sum_{t=1}^{T} t\,\frac{PV_t}{P}, \qquad PV_t = \frac{CF_t}{(1+y)^t}.D=t=1∑T​tPPVt​​,PVt​=(1+y)tCFt​​.

Think of a seesaw: put a weight PVtPV_tPVt​ at distance ttt along a beam; DDD is the point where the beam balances. For a coupon bond the coupons pull the balance point earlier than TTT, so D<TD < TD<T. A zero-coupon bond has only one cash flow, all the weight sits at TTT, and its duration equals its maturity: D=TD = TD=T.

Modified duration

Differentiate the price with respect to the yield. Each term (1+y)−t(1+y)^{-t}(1+y)−t has derivative −t (1+y)−t−1-t\,(1+y)^{-t-1}−t(1+y)−t−1, so

dPdy=−∑t=1Tt CFt(1+y)t+1=−11+y∑t=1Tt PVt=−D1+y P.\frac{dP}{dy} = -\sum_{t=1}^{T} t\,\frac{CF_t}{(1+y)^{t+1}} = -\frac{1}{1+y}\sum_{t=1}^{T} t\,PV_t = -\frac{D}{1+y}\,P.dydP​=−t=1∑T​t(1+y)t+1CFt​​=−1+y1​t=1∑T​tPVt​=−1+yD​P.

The factor in front is the modified duration:

Dmod=D1+y,dPdy=−Dmod P.D_{mod} = \frac{D}{1+y}, \qquad \frac{dP}{dy} = -D_{mod}\,P.Dmod​=1+yD​,dydP​=−Dmod​P.

For a small change Δy\Delta yΔy in yield, a first-order Taylor expansion gives the relative price change:

ΔPP≈−Dmod Δy.\frac{\Delta P}{P} \approx -D_{mod}\,\Delta y.PΔP​≈−Dmod​Δy.

A bond with Dmod=7.7D_{mod} = 7.7Dmod​=7.7 loses about 7.7% of its value when its yield rises by one percentage point. Geometrically, this approximation replaces the price–yield curve by its tangent at the current yield, exactly as delta replaced the option value curve by its tangent in "Delta and hedging".

Modified duration Dmod=D/(1+y)D_{mod} = D/(1+y)Dmod​=D/(1+y) is the percentage price change per unit change in yield: ΔP/P≈−Dmod Δy\Delta P/P \approx -D_{mod}\,\Delta yΔP/P≈−Dmod​Δy.

Dollar duration

Portfolio managers often need the change in money rather than in percent. The dollar duration is Dmod PD_{mod}\,PDmod​P, the price change per unit of yield; divided by 10 000 it gives the change per basis point (0.01%), often called DV01. Dollar durations add across positions, which is how a bond portfolio's interest-rate exposure is aggregated and hedged.

Convexity

The tangent ignores the bend of the curve. Differentiating once more,

d2Pdy2=∑t=1Tt(t+1) CFt(1+y)t+2>0,\frac{d^2P}{dy^2} = \sum_{t=1}^{T} t(t+1)\,\frac{CF_t}{(1+y)^{t+2}} > 0,dy2d2P​=t=1∑T​t(t+1)(1+y)t+2CFt​​>0,

and the convexity is this second derivative per unit of price:

C=1P d2Pdy2.C = \frac{1}{P}\,\frac{d^2P}{dy^2}.C=P1​dy2d2P​.

A second-order Taylor expansion then gives

ΔPP≈−Dmod Δy+12 C (Δy)2.\frac{\Delta P}{P} \approx -D_{mod}\,\Delta y + \tfrac{1}{2}\,C\,(\Delta y)^2.PΔP​≈−Dmod​Δy+21​C(Δy)2.

This mirrors the gamma term 12Γ(dS)2\tfrac{1}{2}\Gamma(dS)^221​Γ(dS)2 of the delta hedge. Because C>0C > 0C>0 and (Δy)2≥0(\Delta y)^2 \ge 0(Δy)2≥0, the correction is always positive: when yields fall the bond gains more than duration predicts, and when they rise it loses less. Between two bonds with the same price and duration, the holder prefers the one with higher convexity, and in markets that extra protection is usually paid for with a slightly lower yield. Convexity grows roughly with the square of maturity, so it matters most for long bonds and large yield moves.

A worked example

Take c=5%c = 5\%c=5%, T=10T = 10T=10, y0=5%y_0 = 5\%y0​=5%. The bond trades at par, P0=100P_0 = 100P0​=100. Summing the weighted payment times gives

D≈8.108,Dmod=8.1081.05≈7.722,C≈75.0.D \approx 8.108, \qquad D_{mod} = \frac{8.108}{1.05} \approx 7.722, \qquad C \approx 75.0.D≈8.108,Dmod​=1.058.108​≈7.722,C≈75.0.

The dollar duration is about 772, so one basis point moves the price by about 0.077. Now shift the yield by one percentage point:

  • Δy=+1%\Delta y = +1\%Δy=+1%: the true price is 92.64, a change of −7.36-7.36−7.36. Duration alone predicts −7.72-7.72−7.72; adding convexity, 100 (−0.07722+12⋅75.0⋅0.0001)≈−7.35100\,(-0.07722 + \tfrac{1}{2}\cdot 75.0 \cdot 0.0001) \approx -7.35100(−0.07722+21​⋅75.0⋅0.0001)≈−7.35.
  • Δy=−1%\Delta y = -1\%Δy=−1%: the true price is 108.11, a change of +8.11+8.11+8.11. Duration alone predicts +7.72+7.72+7.72; with convexity, +8.10+8.10+8.10.

The tangent overstates the loss and understates the gain, by about 0.36 and 0.39; the convexity term 12C(Δy)2P0≈0.375\tfrac{1}{2}C(\Delta y)^2 P_0 \approx 0.37521​C(Δy)2P0​≈0.375 closes almost all of the gap. For comparison, a 10-year zero at 5% has D=10D = 10D=10 and Dmod≈9.52D_{mod} \approx 9.52Dmod​≈9.52: with no coupons to pull the weight forward, it is more sensitive than the coupon bond.

The figure plots the true price against yields within 4 percentage points of y0y_0y0​, together with the duration (tangent) approximation P0(1−DmodΔy)P_0(1 - D_{mod}\Delta y)P0​(1−Dmod​Δy) and the duration-plus-convexity approximation P0(1−DmodΔy+12CΔy2)P_0(1 - D_{mod}\Delta y + \tfrac{1}{2}C\Delta y^2)P0​(1−Dmod​Δy+21​CΔy2). The readouts give DDD, DmodD_{mod}Dmod​, CCC and, for Δy=±1%\Delta y = \pm 1\%Δy=±1%, the true price change next to both approximations. Note that the tangent always lies below the true curve. Increase TTT and watch duration and convexity grow and the tangent drift away faster; lower ccc towards 0 and the Macaulay duration approaches TTT.

Duration and convexity approximationsOpen in Duration & Convexity →
5.00%
00.1
10
130
5.00%
0.010.12
Bond priceDuration approximationDuration + convexity
Macaulay duration
8.11
Modified duration
7.72
Convexity
75.0
+1%: true · duration · +convexity
-7.36 · -7.72 · -7.35
−1%: true · duration · +convexity
+8.11 · +7.72 · +8.10

Duration as a balance point

Put each cash flow on a beam at its payment date, with a weight equal to its present value. The Macaulay duration is the point where the beam balances, because it is the present-value-weighted average time. In the figure, raise the yield and watch the fulcrum slide towards today: distant payments are discounted more, so they weigh less. Set the coupon to zero and the fulcrum sits exactly at maturity, as for any zero-coupon bond.

Duration as a balance pointOpen in Duration & Convexity →
5.00%
00.1
10
130
5.00%
00.15
12345678910D = 8.11 years
Cash flowPresent value
Bond price
100.00
Macaulay duration
8.11
Weight of the final payment
64.5%

Summary

  • Macaulay duration DDD is the present-value-weighted average time of a bond's cash flows; for a zero it equals the maturity.
  • Modified duration Dmod=D/(1+y)D_{mod} = D/(1+y)Dmod​=D/(1+y) gives the first-order price change ΔP/P≈−DmodΔy\Delta P/P \approx -D_{mod}\Delta yΔP/P≈−Dmod​Δy, the tangent to the price–yield curve.
  • Convexity C=P−1 d2P/dy2C = P^{-1}\,d^2P/dy^2C=P−1d2P/dy2 adds the second-order term 12C(Δy)2\tfrac{1}{2}C(\Delta y)^221​C(Δy)2, which is always in the holder's favour.
  • Dollar duration DmodPD_{mod}PDmod​P measures the money at risk per unit of yield and adds across a portfolio.

Duration treats all cash flows as discounted at one yield, so it measures a parallel shift. The next lesson lets each maturity have its own rate.

Try itCompare true price changes with the approximations in the Duration and Convexity lab →
← PreviousBond prices and yieldsNext →Immunization and duration matching
Connections
Duration and convexity
Open the full graph →
Labs for this lesson
Duration & ConvexityBond Lab