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.
| Enable JavaScript for the computed figures. The formulas, the day-count algorithms and the worked reference figures below are static. |
| Enable JavaScript for the computed figures. |
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.
| Enable JavaScript for the shift table. |
| Enable JavaScript for the key-rate decomposition. |
| Enable JavaScript for the aggregation. |
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.
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.
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.
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.
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.
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.
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.
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.
| Basis | Numerator D | Denominator B | Algorithm as implemented |
|---|---|---|---|
| ACT/ACT (ICMA) | Actual days elapsed in the coupon period, A | None fixed; the period itself, E | Accrued = (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 December | 365 or 366 per calendar year | D/B = (days in non-leap years)/365 + (days in leap years)/366. |
| 30/360 Bond Basis | 30-day months, three month-end adjustments | 360 | D = 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 Eurobond | 30-day months, one symmetric adjustment | 360 | D1 = min(D1, 30) and D2 = min(D2, 30), unconditionally. February is not special. |
| 30E/360 (ISDA) | 30-day months, month-end test generalised | 360 | Any last day of its month becomes 30, at either end, except a termination date falling in February. |
| ACT/360 | Actual days | 360 | A 365-day year accrues 365/360 = 1.013889 of the stated rate. The denominator does not change in a leap year. |
| ACT/365F | Actual days | 365, fixed | Fixed in leap years too, which is what the Fixed suffix denotes. |
| NL/365 | Actual days less every 29 February in (start, end] | 365 | 29 February is an interest-free day, so a period of n calendar days always accrues the same amount. |
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.
| Quantity | Target, 4.500% 2034-11-15 | Hedge, 2.750% 2029-05-15 |
|---|---|---|
| Quoted price | 98.750000 | 95.000000 |
| Accrued interest per 100 | 1.271739 | 0.777174 |
| Full price per 100 | 100.021739 | 95.777174 |
| Yield, nominal semiannual | 4.684070 percent | 4.730886 percent |
| Macaulay duration | 6.863229 | 2.614036 |
| Modified duration | 6.706168 | 2.553631 |
| DV01 per 100 of par | 0.067076 | 0.024458 |
| Convexity | 53.827761 | 7.940756 |
| Hedge result at beta 1.00, 10,000,000 par of the target | Value |
|---|---|
| DV01-neutral hedge ratio, 0.067076 / 0.024458 | 2.742513 |
| Hedge par amount | 27,425,126 |
| Hedge market value at the full price | 26,267,010.44 |
| DV01 of each leg per basis point | 6,707.63 |
| Portfolio DV01 after the hedge | 0.00 |
| Hedge par at beta 0.90 | 30,472,362 |
| Hedge par at beta 1.10 | 24,931,933 |
| Parallel shift, bp | Target leg, 10,000,000 par long | Hedge leg, short | Net |
|---|---|---|---|
| -200 | 1,455,783.29 | -1,384,266.81 | 71,516.48 |
| -100 | 698,485.30 | -681,318.46 | 17,166.84 |
| -50 | 342,210.42 | -338,004.32 | 4,206.10 |
| -25 | 169,385.45 | -168,344.42 | 1,041.03 |
| -1 | 6,710.32 | -6,708.67 | 1.65 |
| +1 | -6,704.93 | 6,706.58 | 1.65 |
| +25 | -166,020.34 | 167,040.79 | 1,020.44 |
| +50 | -328,748.27 | 332,789.66 | 4,041.39 |
| +100 | -644,609.25 | 660,457.88 | 15,848.64 |
| +200 | -1,239,839.47 | 1,300,793.57 | 60,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.
Every input is a query parameter, so any hedge on this page is a link.
| Parameter | Meaning | Default |
|---|---|---|
settle | Settlement date for both legs, ISO format | 2026-08-27 |
target | Target bond as maturity:coupon:price, the leg being hedged | 2034-11-15:4.500:98.750 |
hedge | Hedge bond as maturity:coupon:price | 2029-05-15:2.750:95.000 |
par | Par amount of the target bond | 10000000 |
beta | Yield beta of the hedge leg against the target leg | 1.00 |
shifts | Comma-separated parallel yield shifts in basis points | -200,-100,-50,-25,25,50,100,200 |
keyrates | Comma-separated key-rate maturities in years | 2,5,10 |
freq | Coupon periods per year, both legs | 2 |
basis | Day-count basis, both legs | actacticma |
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.