Rates & Bonds · Bond math
Bonds: price vs yield
Why bond prices fall when yields rise, with a 2-line calculation.
Step 1 of 4 · Overview15 min read ·
A bond pays fixed coupons then returns face value. Its yield is the single discount rate that makes the present value of those cash flows equal its price.
def price(face, coupon_rate, ytm, years):
c = face * coupon_rate
return sum(c / (1+ytm)**t for t in range(1, years+1)) + face / (1+ytm)**years
price(100, 0.05, 0.05, 10) # 100.0 (coupon = yield → par)
price(100, 0.05, 0.06, 10) # ~92.6 (yield up → price down)Yields rise
new bonds pay more
Old 5% bond less attractive
price must fall
Its yield rises to match
market clears
Key idea
Price and yield move in opposite directions, always. Longer maturities move more for the same yield change.Next: Practice