fixed-income.wiki
Fixed income - conventions, formulas, and the arithmetic

Duration hedge and curve calculator

Two bonds sized against each other on DV01, with an optional yield beta. Returns the hedge ratio and par amount, the portfolio DV01, duration and convexity, the exact profit and loss on both legs across a range of parallel yield shifts, the key-rate decomposition a single ratio conceals, and the residual left when the curve twists rather than shifts. Every input is encoded in the URL and everything computes in the browser.

Inputs

The two legs

Enable JavaScript for the computed figures. The formulas, the day-count algorithms and the worked reference figures below are static.

The hedge

Enable JavaScript for the computed figures.

Profit and loss across a parallel shift

The steep line is the unhedged target position. The near-flat line at the same scale is the hedged pair. Both are exact repricings, not approximations.

The same hedged residual on its own scale, with the second-order convexity estimate for comparison. It is positive on both sides of the origin and roughly quadratic in the move, which is the signature of a long convexity position.

Shift table

Enable JavaScript for the shift table.

Key-rate decomposition and the curve twist

Enable JavaScript for the key-rate decomposition.

Portfolio aggregation

Enable JavaScript for the aggregation.

Share this calculation

The arithmetic

DV01 of a leg

D_mod = D_mac / (1 + y/f), Money duration = D_mod * P_full, DV01 = PVBP = money duration * 0.0001, per 100 of par.

On a par amount N: DV01_position = DV01 * N / 100. Each leg's yield is solved from its own full price numerically, by bisection followed by Newton iterations on the analytic derivative; no approximation formula is used.

The DV01-neutral hedge ratio

Hedge par = N_target * DV01_target / DV01_hedge

Equivalently N_hedge / N_target = (D_mod,target * P_full,target) / (D_mod,hedge * P_full,hedge). Both DV01s must be stated per the same unit of par.

Yield beta

Hedge par = N_target * (DV01_target / DV01_hedge) / beta

where beta is the regression slope of the hedge leg's yield change on the target leg's yield change. A beta below 1 means the hedge leg moves less than the target, so more of it is needed. Beta is an estimated parameter and the position is linear in its reciprocal: on the reference pair a 0.10 change in beta moves the hedge par amount by roughly 3.05 million, or 11.1 percent.

What the hedge leaves behind

Net P&L for a parallel shift dy = 0.5 * (Cx_long * MV_long - Cx_short * MV_short) * dy^2, to second order.

DV01 neutrality is a first-order property, so it holds only at the point it was set. The residual on the reference pair is positive in both directions because the longer bond's convexity of 53.827761 exceeds the hedge's 7.940756. This page reports the exact repricing alongside the second-order estimate so the size of the third-order term is visible.

Key-rate durations

KRD_i = -(1/P) * dP/dz_i

Computed on a flat zero curve at the leg's own yield, which by construction reproduces its full price exactly. Key rate i is shocked by one basis point with a triangular weight that is 1 at maturity t_i and falls linearly to 0 at t_(i-1) and t_(i+1), held flat below the lowest key rate and above the highest. Because the weights sum to 1 at every maturity, the key-rate durations sum to the parallel-shift duration, and that identity is reported as a check.

The curve twist

A parallel-neutral pair is not curve-neutral. The twist scenario here rotates the key-rate vector about the middle key rate: the shortest key rate moves by -s basis points, the longest by +s, and the intermediate key rates by the linear interpolation between them, using the magnitudes given in shifts. The profit and loss is the net partial DV01 at each key rate multiplied by that key rate's move. A DV01-neutral pair whose duration sits at different points on the curve has a net partial DV01 of opposite sign at the two ends, so the twist is the exposure the single ratio conceals.

Curves are not bootstrapped here

The corpus declares no curve-construction parameters for this page, so it does not bootstrap a zero curve from par instruments. Both legs are discounted at their own solved yield, and the key-rate work is done on the flat zero curve that reproduces each leg's price. The zero, par and forward relationship, the bootstrap itself, and the four spread measures are set out in curves and spreads.

Day-count conventions used for accrual

Both legs accrue on the basis selected above. The numerator and denominator rules are the ones published in day count and accrual and implemented verbatim here.

BasisNumerator DDenominator BAlgorithm as implemented
ACT/ACT (ICMA)Actual days elapsed in the coupon period, ANone fixed; the period itself, EAccrued = (C/f) * A/E. As a year fraction, A/(E*f). Defined per coupon period, so no leap-year handling arises.
ACT/ACT (ISDA)Actual days split at each 31 December365 or 366 per calendar yearD/B = (days in non-leap years)/365 + (days in leap years)/366.
30/360 Bond Basis30-day months, three month-end adjustments360D = 360*(Y2-Y1) + 30*(M2-M1) + (D2-D1), applying in order: both dates the last day of February, D2 = 30; D1 the last day of February, D1 = 30; D1 = 31 becomes 30; D2 = 31 becomes 30 if D1 is now 30.
30E/360 Eurobond30-day months, one symmetric adjustment360D1 = min(D1, 30) and D2 = min(D2, 30), unconditionally. February is not special.
30E/360 (ISDA)30-day months, month-end test generalised360Any last day of its month becomes 30, at either end, except a termination date falling in February.
ACT/360Actual days360A 365-day year accrues 365/360 = 1.013889 of the stated rate. The denominator does not change in a leap year.
ACT/365FActual days365, fixedFixed in leap years too, which is what the Fixed suffix denotes.
NL/365Actual days less every 29 February in (start, end]36529 February is an interest-free day, so a period of n calendar days always accrues the same amount.

The worked reference pair

One pair runs through this corpus. The target is the reference bond: 4.500 percent semiannual, coupon dates 15 May and 15 November, maturing 2034-11-15, settling 2026-08-27 at a quoted price of 98.750. The hedge is an illustrative 2.750 percent bond maturing 2029-05-15 quoted at 95.000. Both are the defaults on this page, so loading it with no query string reproduces the figures below.

QuantityTarget, 4.500% 2034-11-15Hedge, 2.750% 2029-05-15
Quoted price98.75000095.000000
Accrued interest per 1001.2717390.777174
Full price per 100100.02173995.777174
Yield, nominal semiannual4.684070 percent4.730886 percent
Macaulay duration6.8632292.614036
Modified duration6.7061682.553631
DV01 per 100 of par0.0670760.024458
Convexity53.8277617.940756
Hedge result at beta 1.00, 10,000,000 par of the targetValue
DV01-neutral hedge ratio, 0.067076 / 0.0244582.742513
Hedge par amount27,425,126
Hedge market value at the full price26,267,010.44
DV01 of each leg per basis point6,707.63
Portfolio DV01 after the hedge0.00
Hedge par at beta 0.9030,472,362
Hedge par at beta 1.1024,931,933
Parallel shift, bpTarget leg, 10,000,000 par longHedge leg, shortNet
-2001,455,783.29-1,384,266.8171,516.48
-100698,485.30-681,318.4617,166.84
-50342,210.42-338,004.324,206.10
-25169,385.45-168,344.421,041.03
-16,710.32-6,708.671.65
+1-6,704.936,706.581.65
+25-166,020.34167,040.791,020.44
+50-328,748.27332,789.664,041.39
+100-644,609.25660,457.8815,848.64
+200-1,239,839.471,300,793.5760,954.10

Key-rate durations of the target bond at key rates of 2, 5 and 10 years: 0.254369, 2.646749 and 3.805051, summing to 6.706168, which is the modified duration. In share terms 3.793 percent sits on the 2-year, 39.467 percent on the 5-year and 56.740 percent on the 10-year, for a bond maturing in 8.22 years. The hedge leg at the same key rates gives 1.959873, 0.593758 and 0.000000, summing to 2.553631: 76.7 percent of its exposure sits on the 2-year and none at all on the 10-year. So the pair is parallel-neutral and fully exposed to a change in slope. Net of the hedge the position is short the 2-year key rate and long the 10-year, which is a steepener whether or not it was intended as one.

Aggregating instead of hedging, a portfolio of 60 percent target and 40 percent hedge by full-price market value has a modified duration of 0.60 * 6.706168 + 0.40 * 2.553631 = 5.045153 and a convexity of 0.60 * 53.827761 + 0.40 * 7.940756 = 35.472959. Duration and convexity aggregate linearly in market-value weights; DV01 aggregates with no weighting at all, and yield does not aggregate. A weighted-average yield is a convention, not the portfolio's internal rate of return.

URL parameters

Every input is a query parameter, so any hedge on this page is a link.

ParameterMeaningDefault
settleSettlement date for both legs, ISO format2026-08-27
targetTarget bond as maturity:coupon:price, the leg being hedged2034-11-15:4.500:98.750
hedgeHedge bond as maturity:coupon:price2029-05-15:2.750:95.000
parPar amount of the target bond10000000
betaYield beta of the hedge leg against the target leg1.00
shiftsComma-separated parallel yield shifts in basis points-200,-100,-50,-25,25,50,100,200
keyratesComma-separated key-rate maturities in years2,5,10
freqCoupon periods per year, both legs2
basisDay-count basis, both legsactacticma

Examples

What this page does not model

Both legs are discounted at a single yield each, so there is no curve, no spread, no repo or financing leg and no carry. Coupon dates are unadjusted calendar dates: no business-day convention or holiday calendar is applied. Both legs are assumed to accrue on the same basis and pay at the same frequency. The yield beta is taken as an input, not estimated, and no regression is run here. There is no ex-dividend treatment, no optionality, no credit and no default. The hedge is a par-amount position in a cash bond, not a futures or swap position, so there is no conversion factor, no cheapest-to-deliver, no margin and no basis to the delivered security. Key-rate durations are computed on a flat zero curve at each leg's own yield rather than on a fitted market curve, so they describe the shape of each bond's own exposure and not a market curve's shape. Rounding follows no market's settlement convention.

Published and maintained by · [email protected]. About this reference · fixed-income.wiki · the wider network.

Machine-readable: /risk.json, /curves.json, /price-yield.json. Parameter definitions: /.well-known/deeplinks.json. Corpus manifest: /llms.txt. Licensed CC BY 4.0.

Reference information only. Not investment, legal, tax, or accounting advice. Day-count, settlement, quotation and reset conventions vary by market, by instrument class and by individual issue, and the convention that applies to a specific security is a term of that security. Verify every convention against the offering document, prospectus, indenture or confirmation before relying on any calculation here. All prices, rates, curve levels, index values and model outputs in worked examples are illustrative inputs chosen for arithmetic clarity and are not market levels, typical levels, or benchmarks.