TQBTHEQUANTBATEMAN
TQB/ learn/ rates/ curve riskEN · DARK
Rates & curves · front-office

Curve risk, carry and roll-down

Moving from one parallel DV01 to bucketed scenarios, hedge instruments and time passage

BY THE END, YOU CAN

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.

01
INTUITION

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.

01

DV01 must state whether rates are bumped up or down and whether it is PV change or signed derivative.

02

Key-rate risk depends on bump shape and curve rebuild policy.

03

Carry and roll-down are scenario P&L under a frozen-market assumption, not guaranteed return.

02
WHY MARKETS CARE

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.

INSTRUMENTS

swaps and futures

government bonds

basis swaps

options on rates

QUOTE CONVENTION

Report currency, valuation date, curve role, quote set, bump direction/size, rebuild mode and units. One basis point is 0.0001 in decimal rates.

03
MATHEMATICS

Transform quotes without losing units or arbitrage constraints.

Formula · Short derivation

Signed quote DV01

DV01i=V(qi+h)−V(qi)DV01_i=V(q_i+h)-V(q_i)

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 Analytics
Short derivation
Short 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.

  1. 01

    Freeze the market state

    Store quote snapshot, curve policy, trade state and base PV.

  2. 02

    Bump one liquid quote

    Move q_i by h, rebuild every dependent curve and reprice the portfolio.

  3. 03

    Record the signed PV change

    Retain V(q_i+h)−V(q), the bump size and the affected curve role.

  4. 04

    Assemble scenario vectors

    Combine quote DV01s with level, slope or butterfly shock vectors while keeping units consistent.

    ΔVlin=JqΔq\Delta V_{lin}=J_q\Delta q
  5. 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 quotes
  • DV01_i: i-th quote sensitivity
  • h=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.
Formula · Short derivation

First-order scenario P&L

ΔV≈∑i∂V∂qiΔqi\Delta V\approx\sum_i\frac{\partial V}{\partial q_i}\Delta q_i

Quote-space gradients map a prescribed level, slope or butterfly move into approximate P&L.

Open in Analytics
Formula · Short derivation

Carry/roll decomposition

ΔVfrozen=ΘcarryΔt+ΔVroll+ΔVcash\Delta V_{frozen}=\Theta_{carry}\Delta t+\Delta V_{roll}+\Delta V_{cash}

Under a frozen curve, accrual, curve roll and realised cash flows are separated for attribution.

Open in Analytics
05
MODEL / PRICING

Invert, fit, and reprice the market instruments.

METHOD

Bump liquid calibration quotes, rebuild all dependent curves and return signed quote-space risk plus internal node diagnostics and full-revaluation scenarios.

CALIBRATION

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.
ARCHITECTURE
  • 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.
PYTHON 3 · NUMPY / SCIPY

Parallel and key-rate DV01

Compute signed +1bp PV changes and reconcile the bucket sum with a parallel bump.

REUSABLE EXAMPLE
01from __future__ import annotations
02
03import math
04
05times = [1., 2., 5., 10., 20.]
06cashflows = [2., 2., 2., 2., 102.]
07rates = [0.03, 0.032, 0.035, 0.038, 0.04]
08h = 1e-4
09
10def pv(curve: list[float]) -> float:
11 return sum(c*math.exp(-r*t) for c, r, t in zip(cashflows, curve, times))
12
13base = pv(rates)
14buckets = []
15for i in range(len(rates)):
16 bumped = rates.copy(); bumped[i] += h
17 buckets.append(pv(bumped) - base)
18parallel = pv([r+h for r in rates]) - base
19assert abs(sum(buckets) - parallel) < 0.01
20assert all(x < 0 for x in buckets)
21print(f"parallel +1bp={parallel:.6f}")
EXPECTED OUTPUTNegative +1bp PV change and bucket sum close to parallel full revaluation.
SANITY CHECKS

✓ Bump is exactly 0.0001.

✓ Sign convention is +1bp PV change.

✓ Bucket sum reconciles within a stated curvature tolerance.

07
INTERACTIVE LAB

Move the quote and inspect every linked representation.

QUOTE-SPACE DV01 AND CURVE FACTORS

Key-rate and scenario laboratory

Apply parallel, steepener, flattener and butterfly shocks; inspect bucketed DV01, carry and roll-down.

SYNTHETIC · CONTROLLED SCENARIOS
Net DV01-752.6
Full scenario P&L-18816
Largest bucket7Y
PV / DV01 (currency units) by Key-rate tenor (years)

Parallel +25bp: Level factor.

  • DV01
  • scenario P&L / 10
Key-rate tenor (years): 0.5Y. DV01: -1.1 CU. scenario P&L / 10: -2.9 CU.

Use Left/Right or Up/Down arrows to inspect values; Home and End jump to the bounds.

ACTIVE STATE

Parallel +25bp — Level factor. Move the control and inspect every series with pointer or touch.

08
FRONT OFFICE

Where the model meets the book.

ON THE DESK
“A DV01 without curve role, bump sign and rebuild policy cannot be hedged or reconciled.”
VISIBLE INPUTS

portfolio cash flows

market quote set

curve dependency graph

bump policy

carry horizon

CALIBRATION

Risk must use the same accepted curve build as valuation; symmetric and parallel-reconciliation tests are release gates.

RISK

level/slope/butterfly

key-rate concentration

carry/roll

basis and convexity

DAILY WORKFLOW
  1. freeze base PV
  2. bump/rebuild
  3. aggregate buckets
  4. run full scenarios
  5. 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 CONNECTION

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.

01Macro thesistransmits

defines tenor-specific shock

02Curve factorstransmits

encode level/slope/butterfly

03Quote sensitivitiestransmits

map shock into PV

04Hedge decisionoutput

targets residual factor risk

10COMMON PITFALLSOpen the failure checklist.
01

Calling PV change for +1bp ‘DV01’ without sign definition.

02

Summing risks across currencies without FX and units.

03

Computing node risk without rebuilding calibrated curves.

04

Treating carry as a forecast-free profit.

11SOURCES / FURTHER READINGOpen sources and continue the track.
research

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
OPEN ORIGINAL SOURCE ↗
research

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
OPEN ORIGINAL SOURCE ↗
implementation reference

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
OPEN ORIGINAL SOURCE ↗