Finance16 min read·

Bond Duration and Convexity: Formulas, Intuition and Worked Examples

A rigorous guide to duration and convexity - Macaulay duration, modified duration, dollar duration, DV01, and convexity - with derivations, worked examples and Python code.

Why Duration and Convexity Matter

A bond's price changes when the yield changes. The exact relationship is non-linear — the price is a sum of discounted cash flows, and each cash flow depends on the yield through an exponential. But for small yield changes, the relationship is well approximated by a Taylor series, and the first two terms of that series have specific names that every fixed-income practitioner uses daily.

  • Duration is the first-order sensitivity: how much the price changes per unit change in yield, ignoring curvature.
  • Convexity is the second-order sensitivity: the curvature term, which corrects duration when the yield change is not small.

Together, duration and convexity summarise almost everything you need to know about a bond's response to rate moves for risk-management purposes. Trading desks quote positions in terms of DV01 (duration expressed as £ per basis point) and hedge convexity mismatches explicitly. Asset managers use portfolio duration as the primary risk lever. Insurance and pension liability matching is essentially a duration-and-convexity exercise.

This article develops the formulas from first principles, works through a numerical example, and explains the gotchas that distinguish textbook duration from what production risk systems actually compute. The classical treatment is Fabozzi (2021); Tuckman & Serrat (2022) is the practitioner reference; Hull (2021, ch. 4) gives the derivatives-oriented presentation.


The Bond Pricing Formula

Consider a bond with annual coupon rate (c), face value (F), payment dates (t_1 < t_2 < \dots < t_n), and a flat yield (y) (continuous compounding).

Its price is:

P = sum_{i=1..n} CF_i * e^{-y * t_i}

where (CF_i = cF) for coupon dates and (CF_n = cF + F) for the final date. Under simple compounding, (e^{-y t_i}) is replaced by (1 / (1 + y)^{t_i}) or by (1 / (1 + y / m)^{m t_i}) for (m)-times-per-year compounding.

The Taylor expansion of (P) around a small yield change (\Delta y) is:

Delta P ≈ dP/dy * Delta y + (1/2) * d^2 P / dy^2 * (Delta y)^2

The two derivatives that appear here are what duration and convexity encode, dressed up in more intuitive units.


Macaulay Duration

Macaulay duration is the weighted average time to receive the cash flows, weighted by their present values:

D_Mac = sum_{i=1..n} t_i * (CF_i * e^{-y t_i}) / P

It has units of time (years). Intuitively, it measures where the "centre of mass" of the bond's cash flows sits along the time axis.

Interpretation

  • A zero-coupon bond with maturity (T) has Macaulay duration exactly (T), because all the weight sits on the single final cash flow.
  • A high-coupon bond has Macaulay duration less than its maturity, because coupons pull the weighted average earlier.
  • A bond trading at a premium ((c > y)) has slightly lower duration than an otherwise identical par bond, because the coupons are larger relative to the terminal payment.
  • A perpetuity (annual coupon forever) has finite Macaulay duration equal to ((1 + y) / y) under simple compounding.

Historical Origin

Frederick Macaulay introduced duration in 1938 in his study of US railroad bonds (Macaulay, 1938). His motivation was to answer whether "20-year bonds" of different coupons had comparable interest-rate risk — the answer being no, because the weighted-average timing of cash flows differed materially. The concept sat dormant for decades before being rediscovered in the 1970s as a hedging tool.


Modified Duration

Modified duration is the actual first-order price sensitivity to yield:

D_mod = -(1/P) * dP/dy

Under continuous compounding, (D_{\text{mod}} = D_{\text{Mac}}). Under annual compounding, (D_{\text{mod}} = D_{\text{Mac}} / (1 + y)).

The percentage price change for a small yield change (\Delta y) is:

Delta P / P ≈ -D_mod * Delta y

If modified duration is 6.5 years and yield rises by 20 basis points, the price falls by approximately (6.5 \times 0.0020 = 1.30%).

Modified duration is the version quoted in most institutional fixed-income analytics because it directly answers the question "what happens to my price if the yield moves?"


Dollar Duration and DV01

For hedging, the raw sensitivity in currency units is more useful than a percentage.

  • Dollar duration = (-dP / dy) = (P \cdot D_{\text{mod}}). This is the currency-value change per unit yield change (per 1.00 = 100%).
  • DV01 (dollar value of a basis point) = (P \cdot D_{\text{mod}} \cdot 0.0001). This is the currency-value change for a 1 basis point yield change.

DV01 is the number a trader actually monitors on a trading blotter. A £10 million position with modified duration 8 has DV01 of (10{,}000{,}000 \times 8 \times 0.0001 = \pounds 8{,}000) — a 1 bp move up in yield loses roughly £8,000.


Convexity

Duration is only the linear term. The quadratic term is convexity:

C = (1/P) * d^2 P / dy^2 = (1/P) * sum_{i=1..n} t_i^2 * CF_i * e^{-y t_i}

Convexity has units of years squared. It is always positive for a straight bond (all cash flows discounted at the same yield).

The Taylor expansion including convexity is:

Delta P / P ≈ -D_mod * Delta y + (1/2) * C * (Delta y)^2

Because the convexity term is quadratic in (\Delta y) and always positive, it is a friend of the bondholder: for large moves, prices fall by less than duration alone would predict, and rise by more.

The Duration-Convexity Trade-off

Two bonds with the same duration but different convexity behave identically for small yield moves and differently for large ones. The higher-convexity bond wins in either direction. In efficient markets, this convexity edge is priced — higher-convexity bonds trade at slightly lower yields — but the pricing is imperfect enough for convexity trades (long high-convexity bonds, short low-convexity bonds, duration-matched) to be a recognisable strategy.

Bonds with embedded options (callable bonds, mortgage-backed securities) exhibit negative convexity at certain yield levels: when yields fall, the issuer's call option gains value and the bondholder's price appreciation is capped. This is why mortgage portfolios need active convexity management.


A Worked Example

Consider a 5-year bond with £100 face value, 4% annual coupon, and current yield 5% (annual compounding).

The cash flows are £4 at years 1-4 and £104 at year 5.

Present Value of Each Cash Flow

Year (t_i)Cash flow (CF_i)Discount factor (1 / (1.05)^{t_i})PV(t_i \cdot \text{PV})(t_i^2 \cdot \text{PV})
140.952383.80953.80953.8095
240.907033.62817.256214.5124
340.863843.455410.366131.0982
440.822703.290813.163252.6528
51040.7835381.4871407.43532037.1764
Total95.6708442.03032139.2493

Price (P = 95.6708).

Macaulay Duration

D_Mac = 442.0303 / 95.6708 = 4.6203 years

Modified Duration (Annual Compounding)

D_mod = 4.6203 / (1 + 0.05) = 4.4003 years

Convexity

C = 2139.2493 / 95.6708 = 22.361 years^2

First-Order Estimate of Price Change

A yield increase of 100 basis points ((\Delta y = 0.01)):

  • Duration estimate: (\Delta P / P \approx -4.4003 \times 0.01 = -4.4003%).
  • With convexity: (\Delta P / P \approx -4.4003 \times 0.01 + 0.5 \times 22.361 \times 0.0001 = -4.4003% + 0.1118% = -4.2885%).
  • Exact reprice at 6%: new price = 91.5749, change = (-4.2793%).

The duration-only estimate overstates the loss; the convexity correction gets it almost exactly right.


Python Implementation

import numpy as np import pandas as pd def bond_price( coupon: float, face: float, maturity: float, yield_rate: float, freq: int = 1, ) -> float: """Price a bullet coupon bond at a flat yield under discrete compounding.""" n = int(maturity * freq) times = np.arange(1, n + 1) / freq cash_flows = np.full(n, coupon * face / freq) cash_flows[-1] += face discount = (1 + yield_rate / freq) ** (-times * freq) return np.sum(cash_flows * discount) def bond_duration_convexity( coupon: float, face: float, maturity: float, yield_rate: float, freq: int = 1, ) -> dict: """Compute Macaulay duration, modified duration, DV01 and convexity.""" n = int(maturity * freq) times = np.arange(1, n + 1) / freq cash_flows = np.full(n, coupon * face / freq) cash_flows[-1] += face discount = (1 + yield_rate / freq) ** (-times * freq) pv = cash_flows * discount price = pv.sum() macaulay = (times * pv).sum() / price modified = macaulay / (1 + yield_rate / freq) dv01 = price * modified * 0.0001 convexity = ( (times * (times + 1 / freq) * cash_flows / (1 + yield_rate / freq) ** (times * freq + 2)).sum() / price ) return { "price": price, "macaulay_duration": macaulay, "modified_duration": modified, "dv01": dv01, "convexity": convexity, } analytics = bond_duration_convexity(coupon=0.04, face=100, maturity=5, yield_rate=0.05, freq=1) for k, v in analytics.items(): print(f"{k:>22}: {v:.4f}") # Verify against a full reprice at yield + 100 bps p_up = bond_price(0.04, 100, 5, 0.06, freq=1) p_now = analytics["price"] exact_change = (p_up - p_now) / p_now duration_estimate = -analytics["modified_duration"] * 0.01 duration_convexity_estimate = duration_estimate + 0.5 * analytics["convexity"] * 0.01**2 print() print(f"Exact price change (+100 bps): {exact_change:.4%}") print(f"Duration-only estimate: {duration_estimate:.4%}") print(f"Duration + convexity estimate: {duration_convexity_estimate:.4%}")

The convexity-corrected estimate should be within a basis point or two of the full reprice, while the duration-only estimate can be off by tens of basis points for a 100 bp yield move.


Portfolio Duration and Convexity

For a portfolio of bonds indexed by (k) with market values (V_k) and modified durations (D_k), the portfolio modified duration is a market-value-weighted average:

D_portfolio = sum_k (V_k / V_total) * D_k

Portfolio convexity works the same way, weighting individual convexities by market value.

DV01 aggregation is even simpler because it is already in currency units:

DV01_portfolio = sum_k DV01_k

This decomposability is one reason DV01 is the workhorse metric on fixed-income risk blotters.


Key Duration and Bucket Duration

The formulas above assume a flat yield curve and a parallel shift. Reality is neither. Real curves have shape, and shape changes are not parallel — the front end can move while the back end stays still, or vice versa.

  • Key rate durations measure the sensitivity of the bond (or portfolio) to a bump in a specific segment of the curve, holding other segments fixed. A 30-year bond has non-zero key-rate durations at the 20Y and 30Y buckets but roughly zero at the 2Y bucket.
  • Bucket duration / partial duration is the same idea applied to a full set of curve segments used in the risk system.

For portfolio hedging, a single duration number is insufficient — a hedge that matches total DV01 but not key-rate DV01s can still lose money on curve steepening or flattening moves. Real fixed-income risk systems report DV01 by curve bucket and by currency.


Special Cases and Extensions

Callable and Putable Bonds

Bonds with embedded options require effective duration and effective convexity, computed by numerical reprice under yield-curve shifts using an option-pricing model. Analytical formulas break down because the bond price is not a smooth function of yield — it has kinks at option-exercise boundaries. Mortgage-backed securities are the classic example; their effective convexity can be strongly negative in certain rate regimes.

Floating-Rate Notes

An FRN paying a spread over a reference rate has almost zero duration to the reference rate between reset dates, and duration proportional to the spread-tenor of the note. Total duration is small but non-zero — a fact that matters when hedging.

Credit Bonds

For a credit-risky bond, the yield decomposes into the risk-free rate plus a credit spread. Interest-rate duration measures sensitivity to the risk-free rate; spread duration measures sensitivity to the credit spread. The two are numerically similar for a given bond but hedge different risks. Credit portfolios typically hedge rate duration with treasury futures and manage spread duration through position construction.

Discount Factors from a Bootstrapped Curve

The examples above assume a flat yield. In production, cash flows are discounted against a bootstrapped zero-coupon curve, and duration/convexity are computed by numerically bumping the curve. This is more work but is the only way to get correct sensitivities to non-parallel curve moves.


References

  • Fabozzi, F. J. (2021). Bond Markets, Analysis, and Strategies (10th ed.). MIT Press.
  • Hull, J. C. (2021). Options, Futures, and Other Derivatives (11th ed.). Pearson.
  • Macaulay, F. R. (1938). Some Theoretical Problems Suggested by the Movements of Interest Rates, Bond Yields and Stock Prices in the United States since 1856. National Bureau of Economic Research.
  • Tuckman, B., & Serrat, A. (2022). Fixed Income Securities: Tools for Today's Markets (4th ed.). Wiley.

Frequently Asked Questions

What is the difference between Macaulay and modified duration?

Macaulay duration is a weighted-average time, measured in years. Modified duration is a price sensitivity, measured in years but interpreted as percentage price change per unit yield change. Under continuous compounding they are equal. Under discrete compounding they differ by a factor of ((1 + y / m)), where (m) is the compounding frequency. For hedging and P&L attribution, modified duration is the version you want.

Why is a zero-coupon bond's duration equal to its maturity?

Because there is a single cash flow, and its Macaulay-duration weight is 100%. All the value sits at the maturity date, so the weighted-average time is exactly the maturity. This makes zero-coupon bonds the purest duration exposure available — one input, one date, one number.

Can duration be negative?

For a straight fixed-coupon bond, no. All cash flows are positive and all discount weights are positive, so the weighted-average time is positive. For portfolios with short positions, or for structured products with embedded derivatives, duration can be negative — for example, an interest-only mortgage strip generally has negative duration because its cash flows fall as rates fall.

What is convexity, in one sentence?

The rate at which duration changes as yield changes — mathematically, the second derivative of the price with respect to yield, normalised by price. Practically, the curvature correction to duration that becomes important for large yield moves.

How do you hedge convexity?

By trading instruments with different convexity for the same duration. Long positions in bonds with high convexity (long-dated, high-quality) against short positions in low-convexity instruments (barbell against bullet, mortgages against duration-matched treasuries). Convexity hedging is generally more expensive to maintain than duration hedging because convexity carry is often negative — you pay for the tail insurance that convexity provides.

Do these formulas apply to bond futures?

Approximately. Futures have delivery options and a conversion-factor mechanism that make their effective duration a function of which bond is cheapest to deliver. Standard practice is to compute duration from the CTD bond and adjust by the conversion factor. For portfolio-level hedging with futures, this approximation is usually good enough; for precise front-office risk it needs to be refined.

What is DV01 versus BPV versus PV01?

They are the same object under different names. DV01 is the American term (Dollar Value of an 01), BPV is British (Basis Point Value), and PV01 is used by some risk systems as an abbreviation for the price change per 1 bp. All of them mean: how much money you make or lose on a 1 bp yield change. Occasional convention differences arise about the direction (up or down) and about the size of the shift (some systems use 5 bp or 10 bp scaled to 1 bp for numerical stability), but the concept is universal.

Want to go deeper on Bond Duration and Convexity: Formulas, Intuition and Worked Examples?

This article covers the essentials — next, open your free Quantt prep workspace: a real course lesson, interview practice, and a preview of your personalised plan.

Free lesson + interview practice · No credit card required