Bond convexity and duration: Macaulay, modified, DV01 and the formulas
Duration says a 30-year Treasury at 5.28% moves 14.97% for a one-point change in yield. It loses 13.43% when yields rise a point and gains 16.81% when they fall: that asymmetry is convexity.
On this page
- What is bond duration?
- The Macaulay duration formula
- The modified duration formula
- DV01: the dollar value of a basis point
- What is bond convexity?
- Negative convexity and effective duration
- Key rate duration: when the curve does not move in parallel
- Duration and convexity calculator
- Calculate duration, convexity and DV01 in Python
- Interest rate risk: what duration leaves out
- Questions
Key takeaways
- Modified duration is the percent a bond’s price moves for a one-point change in yield: 7.83 for a 10-year US Treasury at the 4 November 2026 yield of 4.90%.
- Macaulay duration is the present-value-weighted average time to a bond’s cash flows, 8.02 years for that bond; divide by (1 + y/2) to get modified duration.
- DV01 is the price change for one basis point: $783 per $1 million of the 10-year, $1,497 on a 30-year at 5.28%.
- Convexity is the curvature duration misses: for a one-point rise, the 30-year’s duration predicts -14.97%, the exact loss is -13.43%, and duration plus convexity gives -13.30%.
- Callable bonds and mortgage-backed securities can have negative convexity: as yields fall, early repayment caps their gains.
Bond duration measures how far a bond’s price moves when yields change; bond convexity measures how that sensitivity changes as yields move. On 4 November 2026 the US 10-year Treasury yield closed at 4.90%, down 5 basis points on the day. A 10-year bond with a 4.90% coupon had a modified duration of 7.83, so its price rose about 0.39%: $3,922 on a $1 million position.
What is bond duration?
Duration has two readings that share one number. As time, Macaulay duration is the average wait until a bond pays you back, each payment weighted by its present value. A 10-year par bond at 4.90% pays 20 half-yearly coupons and its principal, and the weighted average lands at 8.02 years, before maturity because the coupons arrive early. As risk, modified duration turns that time into a price sensitivity: about 7.83% of price for a one-percentage-point move in yield.
Present value of a 10-year par bond’s payments, by year
The Macaulay duration formula
PVi = CFi ÷ (1 + y/k)^(k × ti)P = Σ PViMacaulay D = Σ (ti × PVi) ÷ P
- CFi
- Cash flow i: a coupon, plus the principal at maturity
- ti
- When it is paid, in years from today
- y
- Yield to maturity as a decimal: 0.0458 for 4.58%
- k
- Payments a year: 2 for US Treasuries and UK gilts, 1 for German and French government bonds
- P
- Price per 100 of face, the sum of the present values
| Years | CF | PV | t × PV |
|---|---|---|---|
| 0.5 | 2.29 | 2.2387 | 1.1194 |
| 1.0 | 2.29 | 2.1886 | 2.1886 |
| 1.5 | 2.29 | 2.1396 | 3.2094 |
| 2.0 | 102.29 | 93.4330 | 186.8661 |
| Total | 100.0000 | 193.3835 |
The modified duration formula
Modified D = Macaulay D ÷ (1 + y/k)%ΔP ≈ −Modified D × Δy
- Δy
- Change in yield as a decimal: 0.01 for one percentage point, 0.0001 for one basis point
- %ΔP
- Approximate change in price, as a fraction of price
Modified duration is the figure risk systems usually mean by "duration". It grows with maturity and shrinks as the coupon or the yield rises. On the US curve of 4 November 2026:
| Tenor | Yield | Duration | DV01 |
|---|---|---|---|
| 2Y | 4.58% | 1.89 | $189 |
| 3Y | 4.64% | 2.77 | $277 |
| 5Y | 4.69% | 4.41 | $441 |
| 7Y | 4.77% | 5.89 | $589 |
| 10Y | 4.90% | 7.83 | $783 |
| 20Y | 5.30% | 12.24 | $1,224 |
| 30Y | 5.28% | 14.97 | $1,497 |
Why zero-coupon bonds have the longest duration
Macaulay duration by maturity at a 4.90% yield
- Zero coupon
- 2.5% coupon
- 4.9% coupon, par
- 8% coupon
Macaulay duration, years
Coupons cut duration because part of the value comes back early. A 30-year zero-coupon bond at 5.28% has a modified duration of 29.23, nearly twice the 14.97 of the 30-year par bond, which is why long zero-coupon bonds swing the most when yields change.
DV01: the dollar value of a basis point
DV01 = Modified D × Price × 0.0001
- Price
- Market value of the position, in currency
DV01, also called PV01 or the dollar value of a basis point, is how traders size hedges and compare positions across maturities. $1 million of 2-year notes carries $189 of DV01, so it takes about $7.9 million of them to match the rate risk of $1 million of 30-year bonds. The basis point itself is covered in basis points. Across countries the 10-year looks alike:
| 10-year | Yield | Coupons | DV01 |
|---|---|---|---|
| US | 4.90% | 2 | $783 |
| Germany | 3.35% | 1 | €838 |
| France | 4.88% | 1 | €777 |
| UK | 5.23% | 2 | £771 |
- +$567$1M of 2-year notes on 4 November, yield down 3 bps
- +$3,922$1M of 10-year notes, yield down 5 bps
- +$5,998$1M of 30-year bonds, yield down 4 bps
What is bond convexity?
Duration draws a straight line through a curved relationship. The price-yield curve of a plain bond bends upward: as yields fall its duration lengthens and gains accelerate, and as yields rise duration shortens and losses slow. Convexity measures that bend. For a 30-year par bond at the 4 November yield of 5.28%:
Price change of a 30-year bond for yield moves of up to 2 points
- Exact price
- Duration and convexity
- Duration only
price change, %
The convexity formula
Convexity = Σ [CFi × n(n + 1) ÷ (1 + y/k)^(n + 2)] ÷ (P × k²)%ΔP ≈ −Modified D × Δy + ½ × Convexity × Δy²
- n
- Payment number, k × tᵢ: 1 to 60 for a 30-year bond paying twice a year
- Convexity
- In years squared; the k² converts it from coupon periods to years
| Move | Exact | Duration | D + C |
|---|---|---|---|
| -200 | +38.00 | +29.95 | +36.65 |
| -100 | +16.81 | +14.97 | +16.65 |
| -25 | +3.85 | +3.74 | +3.85 |
| +25 | -3.64 | -3.74 | -3.64 |
| +100 | -13.43 | -14.97 | -13.30 |
| +200 | -24.26 | -29.95 | -23.24 |
For a plain bond convexity is positive: duration underestimates the gain when yields fall and overestimates the loss when they rise, by about ½ × convexity × Δy² either way. Longer maturities and lower coupons have more of it, and it grows roughly with the square of duration: 4.6 for the 2-year, 74.1 for the 10-year, 335.3 for the 30-year.
Is higher convexity better?
At the same duration, more convexity means a better result from any large parallel move, up or down. A barbell shows it: 54.6% of the money in the 2-year and 45.4% in the 30-year has the 10-year’s duration of 7.83 with twice its convexity.
| Position | Duration | Convexity | P&L |
|---|---|---|---|
| Bullet | 7.83 | 74.1 | +$3,922 |
| Barbell | 7.83 | 154.8 | +$3,034 |
Convexity usually has a price: positions with more of it tend to yield less, and it only pays when yields move a long way. The last column shows the other catch. Same duration, but the barbell made $888 less on 4 November, because the two ends of the curve fell less than the middle. Duration treats every yield as moving together, and that day they did not.
Negative convexity and effective duration
Some bonds bend the other way. A callable bond can be repaid early by its issuer, which becomes likely when yields fall, so its price stalls near the call price. A mortgage-backed security behaves the same way, because homeowners refinance when rates drop. When early repayment is likely, both have negative convexity: duration shortens as yields fall and lengthens as they rise, the opposite of a plain bond.
Positive convexity
- Option-free government and corporate bonds
- Gains grow faster than losses as yields move
- Duration lengthens as yields fall
Negative convexity
- Callable bonds and mortgage-backed securities
- Gains are capped near the call or prepayment level
- Duration shortens as yields fall
Their cash flows change with yields, so the Macaulay formula no longer applies. Effective duration and effective convexity reprice the bond with a model after a yield shift each way:
Effective D = (P− − P+) ÷ (2 × P0 × Δy)Effective C = (P− + P+ − 2 × P0) ÷ (P0 × Δy²)
- P0
- Price today
- P−, P+
- Price after yields fall, and rise, by Δy
Most bond funds publish an effective duration for the same reason. It is the figure to compare with the numbers on this page, not the fund’s average maturity.
Key rate duration: when the curve does not move in parallel
Fall in US Treasury yields on 4 November 2026, by tenor
Key rate durations split a bond’s duration across points on the curve, so each tenor’s own move can be applied to it. For a par bond at a curve point, most of it sits at its own maturity; the barbell above has its exposure at 2 and 30 years, where the curve fell 3 and 4 basis points against 5 at 10 years. Summed, key rate durations come back to about the ordinary duration, which is why one number is enough for a parallel shift and not for a day like this one. The yield curve inversion guide covers how the curve’s shape moves.
Duration and convexity calculator
Calculate duration, convexity and DV01 in Python
duration_convexity.py reads the latest yields from the bonds API, one request per tenor, prices a par bond at each, and prints its two durations, convexity, DV01 and the day’s profit or loss on $1 million. It needs Python 3.9 or newer, the standard library and a TICKERLAYER_API_KEY environment variable.
"""Duration, convexity and DV01 of par bonds at today's yields. Python 3.9+, standard library only."""
import json
import os
import sys
import urllib.request
API = "https://api.tickerlayer.com"
KEY = os.environ.get("TICKERLAYER_API_KEY") or sys.exit("Set TICKERLAYER_API_KEY first.")
TENORS = {"US:2Y": 2, "US:5Y": 5, "US:10Y": 10, "US:30Y": 30}
FREQ = 2 # Treasury coupons are paid twice a year
FACE = 1_000_000
def snapshot(symbol):
req = urllib.request.Request(f"{API}/bond/snapshot/{symbol}", headers={"x-api-key": KEY})
with urllib.request.urlopen(req, timeout=30) as resp:
return json.load(resp)
def cash_flows(coupon, years):
"""(time in years, cash flow per 100 of face) for a bullet bond priced on a coupon date."""
n = round(years * FREQ)
return [(k / FREQ, coupon / FREQ + (100 if k == n else 0)) for k in range(1, n + 1)]
def price(coupon, years, ytm):
y = ytm / 100 / FREQ
return sum(cf / (1 + y) ** (t * FREQ) for t, cf in cash_flows(coupon, years))
def measures(coupon, years, ytm):
"""Price, Macaulay and modified duration in years, convexity in years squared."""
y = ytm / 100 / FREQ
pv = weighted = curve = 0.0
for t, cf in cash_flows(coupon, years):
k = t * FREQ
pv += cf / (1 + y) ** k
weighted += t * cf / (1 + y) ** k
curve += cf * k * (k + 1) / (1 + y) ** (k + 2)
macaulay = weighted / pv
return pv, macaulay, macaulay / (1 + y), curve / pv / FREQ**2
print(f"{'tenor':<7}{'yield':>7}{'Macaulay':>10}{'modified':>10}{'convexity':>11}{'DV01 per 1M':>13}{'day':>8}{'P&L per 1M':>12}")
for symbol, years in TENORS.items():
s = snapshot(symbol)
ytm, move = s["rate"], s["change_bps"]
p, mac, mod, conv = measures(ytm, years, ytm) # a par bond: coupon equal to the yield
dv01 = mod * p / 100 * FACE / 10_000
pnl = (p / price(ytm, years, s["prev_rate"]) - 1) * FACE # the same bond, repriced from yesterday's yield to today's
print(f"{symbol:<7}{ytm:>6.2f}%{mac:>10.2f}{mod:>10.2f}{conv:>11.1f}{dv01:>13,.0f}{round(move, 1):>+6}bp{pnl:>+12,.0f}")
print(f"yields dated {s['date']}; change against {s['prev_date']}")tenor yield Macaulay modified convexity DV01 per 1M day P&L per 1M
US:2Y 4.58% 1.93 1.89 4.6 189 -3bp +567
US:5Y 4.69% 4.51 4.41 22.9 441 -5bp +2,208
US:10Y 4.90% 8.02 7.83 74.1 783 -5bp +3,922
US:30Y 5.28% 15.37 14.97 335.3 1,497 -4bp +5,998
yields dated 2026-11-04; change against 2026-11-03Swap the symbols in TENORS for UK:10Y or DE:30Y to price other curves, and set FREQ = 1 for German and French government bonds, which pay one coupon a year. The yields are daily observations, each dated in the response.
Interest rate risk: what duration leaves out
- Parallel moves. Duration assumes every yield moves the same amount; on 4 November the 7-year fell 6 basis points and the 3-month did not move. Use key rate durations for positions spread along the curve.
- Large moves. Past about 50 basis points, add convexity: on the 30-year, duration alone missed a one-point move by 1.5 to 1.8 points of price.
- Time. Duration shortens as a bond ages and changes whenever yields move; recompute it rather than store it.
- Embedded options. Callable bonds and mortgage securities need effective duration from a model; their Macaulay duration says little.
- Credit spreads. A corporate bond’s yield is a government yield plus a spread; spread duration measures the exposure to the spread alone.
- Accrued interest. Between coupon dates the price paid includes accrued interest, and the cash flows shift; the formulas here price on a coupon date.
Questions
What is the convexity of a bond?
The curvature of its price-yield relationship: how its duration changes as yields move. A 30-year par Treasury at 5.28% on 4 November 2026 had a convexity of 335.3: its convexity term adds 1.68 points of price to the duration estimate for a one-point move either way.
What is the difference between Macaulay and modified duration?
Macaulay duration is the present-value-weighted average time to a bond’s cash flows, in years. Modified duration divides it by (1 + y/k) and reads as the percent price change for a one-point move in yield: 8.02 and 7.83 for a 10-year par bond at 4.90%.
How do you calculate bond convexity?
Take each payment’s present value, multiply it by n(n + 1) where n is the payment number, add them up, then divide by (1 + y/k)², by the price and by k² to express it in years squared. A 30-year par Treasury at 5.28% with two coupons a year comes to 335.3; repricing it one point either way gives an effective convexity of 337.
What is DV01?
The change in a position’s value for a one-basis-point move in yield: modified duration × price × 0.0001. For $1 million of a 10-year par Treasury at 4.90% it was $783 on 4 November 2026.
Is higher convexity better?
At the same duration and yield, yes: the bond gains more when yields fall and loses less when they rise. In practice convexity usually costs some yield, so it pays only when yields move far enough.
What is negative convexity?
A price-yield curve that bends the other way, typical of callable bonds and mortgage-backed securities: as yields fall, early repayment caps the price, so gains shrink while losses do not.
Is duration the same as maturity?
Macaulay duration equals maturity only for a zero-coupon bond. Coupons pay part of the value back early, so a 30-year par bond at 5.28% has a Macaulay duration of 15.37 years.