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
  1. What is bond duration?
  2. The Macaulay duration formula
  3. The modified duration formula
  4. DV01: the dollar value of a basis point
  5. What is bond convexity?
  6. Negative convexity and effective duration
  7. Key rate duration: when the curve does not move in parallel
  8. Duration and convexity calculator
  9. Calculate duration, convexity and DV01 in Python
  10. Interest rate risk: what duration leaves out
  11. 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

  • Year 14.73
  • Year 24.50
  • Year 34.29
  • Year 44.09
  • Year 53.89
  • Year 63.71
  • Year 73.53
  • Year 83.37
  • Year 93.21
  • Year 1064.68
Two coupons of 2.45 a year and the 100 of principal at year 10, discounted at the 4.90% yield, add up to the price of 100. Weighting each payment’s time by its present value gives the Macaulay duration of 8.02 years. Illustrative maths on the 4 November 2026 10-year yield.

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
US 2-year at 4.58% with a 4.58% coupon: four payments, present values summing to 100.0000, time-weighted present values summing to 193.3835, so Macaulay D = 193.3835 ÷ 100 = 1.93 years.
YearsCFPVt × PV
0.52.292.23871.1194
1.02.292.18862.1886
1.52.292.13963.2094
2.0102.2993.4330186.8661
Total100.0000193.3835
A 2-year bond with a 4.58% coupon at the 4 November 2026 2-year Treasury yield of 4.58%, per 100 of face. Each payment is discounted at 2.29% per half year: CF is the cash flow, PV its present value, t × PV that value weighted by years.

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
The same 2-year: 1.9338 ÷ 1.0229 = 1.89. A 10 basis point rise in yield (0.001) costs about 1.89 × 0.001 = 0.19% 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:

TenorYieldDurationDV01
2Y4.58%1.89$189
3Y4.64%2.77$277
5Y4.69%4.41$441
7Y4.77%5.89$589
10Y4.90%7.83$783
20Y5.30%12.24$1,224
30Y5.28%14.97$1,497
Modified duration and DV01 per $1 million of face for par bonds with coupons twice a year, at each tenor’s yield from GET /bond/snapshot dated 4 November 2026. Macaulay durations run from 1.93 years at 2 years to 15.37 at 30. Illustrative: a real Treasury carries the coupon set when it was issued, so its duration differs slightly.

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 twice a year. A zero-coupon bond’s duration equals its maturity; coupons pull the weight forward, the more so the larger they are. However long its maturity, a par bond’s duration stays below (1 + y/2) ÷ y, 20.91 years at 4.90%. Illustrative maths.

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
US 10-year par bond, $1,000,000 of face at a price of 100: 7.83 × $1,000,000 × 0.0001 = $783 for each basis point.

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-yearYieldCouponsDV01
US4.90%2$783
Germany3.35%1€838
France4.88%1€777
UK5.23%2£771
Coupons a year and DV01 per 1 million of face in local currency, for par 10-year bonds at each government yield from GET /bond/snapshot: US, Germany and France dated 4 November 2026, UK 3 November. Annual coupons lengthen Macaulay duration a little but, at the same yield, trim modified duration and DV01: France at 4.88% carries €777 against $783 for the US at 4.90%. Germany’s lower yield lengthens duration the most.
  • +$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
The par bonds of the tables above, repriced exactly from their 3 November 2026 yield (prev_rate in GET /bond/snapshot) to their 4 November yield (rate). Duration alone, measured at the 3 November yields, gives $567, $3,913 and $5,972: on moves of a few basis points, convexity is worth $27 at most.

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, %

Yield moves in basis points from 5.28%, coupon 5.28% paid twice a year; modified duration 14.97, convexity 335.3. The straight line is duration alone; the exact curve sits above it on both sides. Illustrative maths on the 4 November 2026 30-year yield.

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
30-year at 5.28%, yields up one point: −14.973 × 0.01 + ½ × 335.32 × 0.01² = −14.973% + 1.677% = −13.30%, against an exact −13.43%.
MoveExactDurationD + 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
The 30-year par bond at 5.28%: yield move in basis points, price change in percent; D + C is duration plus the convexity term. Duration alone is off by 0.1 point of price on a 25 bp move, 1.5 to 1.8 on 100 bp and 5.7 to 8.1 on 200 bp; adding convexity cuts the 100 bp error to 0.14 to 0.16.

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.

PositionDurationConvexityP&L
Bullet7.8374.1+$3,922
Barbell7.83154.8+$3,034
Par bonds at 4 November 2026 yields, $1 million in each position: the bullet is the 10-year, the barbell 54.6% in the 2-year and 45.4% in the 30-year by value, chosen to match the 10-year’s modified duration. P&L is the exact change in value from 3 November to 4 November yields: 2-year -3 bps, 10-year -5, 30-year -4.

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
The option-free 30-year with Δy = 0.01: P₋ = 116.8060, P₊ = 86.5677, so effective D = (116.8060 − 86.5677) ÷ (2 × 100 × 0.01) = 15.12 and effective C = (116.8060 + 86.5677 − 200) ÷ (100 × 0.01²) = 337, close to the formula values of 14.97 and 335.3.

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

  • 1 month-2
  • 3 months0
  • 6 months-1
  • 1 year-1
  • 2 years-3
  • 3 years-4
  • 5 years-5
  • 7 years-6
  • 10 years-5
  • 20 years-5
  • 30 years-4
change_bps of each US tenor from GET /bond/snapshot, 4 November against 3 November 2026.TickerLayer bonds API, US Treasury curve.

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

Duration and convexity calculator

%
yrs
%
bps
Price per 100
100.000
Macaulay duration
8.02 years
Modified duration
7.83
Convexity
74.1
DV01 on the face amount
783.15 per bp
Price change, exact
-7.47%
From duration alone
-7.83%
Duration plus convexity
-7.46%

A fixed-coupon bond without options, priced on a coupon date (no accrued interest). Yield is the yield to maturity, compounded at the coupon frequency. DV01 is the value change on the face amount for one basis point.

Set the coupon, maturity, yield and a yield move. It starts on the 10-year above (4.90% coupon, 10 years, 4.90%); a 100 bp move shows -7.47% exact, -7.83% from duration and -7.46% with convexity.

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.pyPython
"""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']}")
python duration_convexity.py
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-03

Swap 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.

Ready to integrate?

Create an account, explore the docs, and connect via REST or WebSocket in minutes.