Curve risk, carry and roll-down
Moving from one parallel DV01 to bucketed scenarios, hedge instruments and time passage
01Define PV01/DV01 with sign, bump size and curve role.
02Construct key-rate and quote-space sensitivities.
03Separate carry, roll-down and market-move P&L.
04Design level, slope and butterfly scenarios without double counting.
Separate the quote from the quantity inferred from it.
A portfolio does not own ‘duration’ in the abstract. It owns sensitivity to specific curve inputs, dates and curve roles; as time passes, cash flows roll through that geometry even if market quotes do not move.
DV01 must state whether rates are bumped up or down and whether it is PV change or signed derivative.
Key-rate risk depends on bump shape and curve rebuild policy.
Carry and roll-down are scenario P&L under a frozen-market assumption, not guaranteed return.
Start from executable inputs and conventions.
Trading limits, hedge sizing, P&L explanation and macro scenario design require exposures that map back to liquid curve instruments.
swaps and futures
government bonds
basis swaps
options on rates
Report currency, valuation date, curve role, quote set, bump direction/size, rebuild mode and units. One basis point is 0.0001 in decimal rates.
Transform quotes without losing units or arbitrage constraints.
Signed quote DV01
This convention reports PV change for a +1bp quote bump; many desks use the negative or symmetric derivative, so sign must be stated.
Open in AnalyticsShort derivation
From curve-node shocks to liquid hedge ratios
Differentiate the entire calibration-and-pricing pipeline with respect to market quotes, not only internal zero nodes.
- 01
Freeze the market state
Store quote snapshot, curve policy, trade state and base PV.
- 02
Bump one liquid quote
Move q_i by h, rebuild every dependent curve and reprice the portfolio.
- 03
Record the signed PV change
Retain V(q_i+h)−V(q), the bump size and the affected curve role.
- 04
Assemble scenario vectors
Combine quote DV01s with level, slope or butterfly shock vectors while keeping units consistent.
- 05
Validate nonlinearity
Compare up/down symmetric bumps and full revaluation under larger scenarios.
Curve risk is a Jacobian from liquid market quotes to portfolio value, augmented by nonlinear scenarios and time-passage attribution.
Inputs
V(q): portfolio PV from market quotesDV01_i: i-th quote sensitivityh=10^{-4}: one-bp bump\Delta t: carry horizon
Assumptions and limits
- Finite differences mix model nonlinearity with rebuild effects.
- Key-rate results depend on interpolation and bump localisation.
- Frozen-curve carry omits future market moves, funding and execution costs.
First-order scenario P&L
Quote-space gradients map a prescribed level, slope or butterfly move into approximate P&L.
Open in AnalyticsCarry/roll decomposition
Under a frozen curve, accrual, curve roll and realised cash flows are separated for attribution.
Open in AnalyticsInvert, fit, and reprice the market instruments.
Bump liquid calibration quotes, rebuild all dependent curves and return signed quote-space risk plus internal node diagnostics and full-revaluation scenarios.
Use stable bump sizes, symmetric checks and a frozen dependency graph. Version curve construction alongside risk results.
Implementation with current QuantLib
Relink or rebuild quote handles one at a time and force dependent term structures to update before repricing. Preserve base/bumped snapshots; validate quote-space risk against analytical cash-flow sensitivities where available.
API authority: upstream QuantLib reference pinned in the source registry.06PYTHON IMPLEMENTATIONOpen the implementation and checks.
- Keep market conventions and quote lineage at the boundary.
- Solve curves and dynamics in framework-free deterministic kernels.
- Return residuals, state and sensitivities with every value.
- Test analytical limits, reconstruction identities and failure domains.
Parallel and key-rate DV01
Compute signed +1bp PV changes and reconcile the bucket sum with a parallel bump.
from __future__ import annotations import math times = [1., 2., 5., 10., 20.]cashflows = [2., 2., 2., 2., 102.]rates = [0.03, 0.032, 0.035, 0.038, 0.04]h = 1e-4 def pv(curve: list[float]) -> float: return sum(c*math.exp(-r*t) for c, r, t in zip(cashflows, curve, times)) base = pv(rates)buckets = []for i in range(len(rates)): bumped = rates.copy(); bumped[i] += h buckets.append(pv(bumped) - base)parallel = pv([r+h for r in rates]) - baseassert abs(sum(buckets) - parallel) < 0.01assert all(x < 0 for x in buckets)print(f"parallel +1bp={parallel:.6f}")Move the quote and inspect every linked representation.
Key-rate and scenario laboratory
Apply parallel, steepener, flattener and butterfly shocks; inspect bucketed DV01, carry and roll-down.
Parallel +25bp: Level factor.
- DV01
- scenario P&L / 10
Use Left/Right or Up/Down arrows to inspect values; Home and End jump to the bounds.
Where the model meets the book.
“A DV01 without curve role, bump sign and rebuild policy cannot be hedged or reconciled.”
portfolio cash flows
market quote set
curve dependency graph
bump policy
carry horizon
Risk must use the same accepted curve build as valuation; symmetric and parallel-reconciliation tests are release gates.
RISKlevel/slope/butterfly
key-rate concentration
carry/roll
basis and convexity
- freeze base PV
- bump/rebuild
- aggregate buckets
- run full scenarios
- attribute carry and market move
Production failure modes
- mixed DV01 signs
- partial dependency rebuild
- bump too small/large
- risk reported in internal nodes only
09MACRO CONNECTIONOpen the transmission channel.
Macro scenarios as curve-factor shocks
Policy, inflation, growth and supply shocks rarely move every tenor equally; level, slope and butterfly factors connect narratives to portfolio P&L.
transmitsdefines tenor-specific shock
transmitsencode level/slope/butterfly
transmitsmap shock into PV
outputtargets residual factor risk
10COMMON PITFALLSOpen the failure checklist.
Calling PV change for +1bp ‘DV01’ without sign definition.
Summing risks across currencies without FX and units.
Computing node risk without rebuilding calibrated curves.
Treating carry as a forecast-free profit.
11SOURCES / FURTHER READINGOpen sources and continue the track.
Curve construction, multi-curve, short-rate and HJM lectures
Research map for term-structure theory and numerical experiments; all platform explanations and code are original.
- Source
- Financial Engineering: Interest Rates & xVA
- Author
- L. A. Grzelak
- Ref
- main
Monte Carlo, stochastic calculus and calibration lectures
Mathematical and numerical cross-reference for model dynamics and diagnostics.
- Source
- Computational Finance Course
- Author
- L. A. Grzelak
- Ref
- main
Current bootstrapping, interpolation, curve, model, cap/floor and swaption tests
Implementation authority for production object boundaries and regression-test patterns.
- Source
- QuantLib upstream
- Author
- QuantLib contributors
- Ref
- v1.42.1