16 — Swaps, Swap DV01, and Swap Spreads¶
Free learning pack¶
- PIMCO Education Center — Understanding Duration
resources/fixed_income.mdreference/fixed_income/swap_dv01.md,swap_spread.md
Do not search for more material until these are insufficient.
PREDICT¶
A PM wants to add 5 years of duration to a portfolio without buying more cash Treasuries. They enter a 5-year receive-fixed swap. Does this increase or decrease the portfolio's DV01? What if they pay fixed instead?
Approximation¶
Treat the swap's fixed leg as a par bond: coupon = swap rate, priced at
par, ytm = swap rate. Then swap DV01 is just bond DV01 on that proxy bond.
See reference/fixed_income/swap_dv01.md for what this approximation
ignores (floating-leg resets, discounting basis).
import pandas as pd
curve = pd.read_csv("../../data/mock_curve.csv")
five_year = curve.loc[curve.tenor_years == 5].iloc[0]
notional = 50_000_000
print(five_year)
# MANUAL FIRST:
# treat the 5Y swap_rate as coupon = ytm on a par "bond" with this notional,
# 5-year maturity, semiannual frequency. Compute its DV01 by hand using
# the modified-duration and DV01 formulas (don't call src yet).
swap_dv01_5y = None
print(swap_dv01_5y)
PREDICT (swap spread)¶
If bank funding stress widens swap spreads across the curve, does a PM who is long Treasuries and short swaps (pay-fixed) gain or lose?
Formula¶
swap_spread = swap_rate - treasury_yield
# MANUAL FIRST:
# compute the swap spread at every tenor in `curve` (swap_rate minus
# treasury_par_yield), and identify which tenor has the widest spread.
spreads = None
print(spreads)
Experiment¶
Shock every swap_rate in the curve up 20bp while leaving
treasury_par_yield unchanged (a pure swap-spread-widening scenario).
Recompute swap DV01 P&L for the 5Y position above.
Reference¶
reference/fixed_income/swap_dv01.md
reference/fixed_income/swap_spread.md
Promote¶
Use src/pm/fixed_income/swaps.py (swap_dv01, swap_spread) only after
your own implementation.
Test¶
pytest tests/test_fixed_income.py
ORAL CHECK¶
Explain to a PM why swap DV01 computed this way is a proxy, and name one concrete scenario where it would be noticeably wrong.
Try /tutor fixed-income swap dv01 for an adaptive walkthrough.