Speed

Longer Bonds, Larger DV01

For the same face the DV01 grows with maturity, more slowly for long bonds, and a zero bond has less of it than a coupon bond; it is not a law.

The question

Two bonds of the same face value are valued at the same yield. Which one moves more when the yield moves by one basis point? Common sense says the longer one, because its money arrives later and a later amount reacts more to the yield. This lesson draws the DV01 of a bond for each maturity from 1 to 15 years and then looks for the exceptions. The yield, the coupon and the face are made-up inputs; all bonds share one yield, which no market offers across 15 maturities.

Work it by hand

DV01 is modified duration times value times 0.0001. Take 1,000,000 of face, a yield of 5% and a maturity of one year. A bond with a 5% coupon is worth 1,000,000 and has a modified duration of 1 / 1.05 = 0.95238, so its DV01 is 1,000,000 times 0.95238 times 0.0001 = 95.24.

A zero bond of the same face and maturity pays only at the end and is worth 952,380.95 now. It has the same modified duration, so its DV01 is 952,380.95 times 0.95238 times 0.0001 = 90.70. The smaller value makes the smaller DV01. For a longer maturity both durations grow, the coupon bond's more slowly, because part of its money comes earlier.

Run it

The program computes the DV01 of a coupon bond and of a zero bond for each maturity from 1 to 15 years, at one yield and one face. risk.bond_dv01_yield answers in currency for the whole face, so no scaling is needed. The loop is bounded by 15 maturities.

Fifteen pairs of bars for the maturities 1 to 15 years: the DV01 of a bond with a 5% coupon at a yield of 5% rises from 95.24 to 1,037.97, and that of a zero bond from 90.70 to 687.17. The answer is 10, the number of coupon bonds with a DV01 above the level 500: those of 6 to 15 years.
Watch the steps (recorded video)
market.set_date("2025-01-02");
let year = str_list(); let with_coupon = float_list(); let zero = float_list();
let above = 0;
for (t in range(1, 16)) {
  let bond = instrument.bond(face, coupon, float(t), 1);
  let c = risk.bond_dv01_yield(bond, rate);
  let z = risk.bond_dv01_yield(instrument.zero_bond(face, float(t)), rate);
  year.add(str(t)); with_coupon.add(lmf.round(c, 2)); zero.add(lmf.round(z, 2));
  if (c > level) { above = above + 1; }
}
lmcode_return_put("year", year);
lmcode_return_put("with_coupon", with_coupon);
lmcode_return_put("zero", zero);
let answer = above;
{
  "answer": 10,
  "year": [
    "1",
    "2",
    "3",
    "4",
    "5",
    "6",
    "7",
    "8",
    "9",
    "10",
    "11",
    "12",
    "13",
    "14",
    "15"
  ],
  "with_coupon": [
    95.24,
    185.94,
    272.32,
    354.6,
    432.95,
    507.57,
    578.64,
    646.32,
    710.78,
    772.17,
    830.64,
    886.33,
    939.36,
    989.86,
    1037.97
  ],
  "zero": [
    90.7,
    172.77,
    246.81,
    313.41,
    373.11,
    426.41,
    473.79,
    515.69,
    552.52,
    584.68,
    612.52,
    636.39,
    656.59,
    673.42,
    687.17
  ]
}

Lines 5 and 6 build the coupon bond for the year t of the loop and take its DV01; line 7 does the same for the zero bond. Line 9 counts the coupon bonds above level. For the inputs shown the coupon bond's DV01 rises from 95.24 at one year to 1,037.97 at 15 years, the zero bond's from 90.70 to 687.17, and 10 coupon bonds are above 500: those of 6 to 15 years. The answer is that count, on line 14.

You can change all four inputs. A yield of -1 or lower stops line 6 with "risk.bond_dv01_yield: yield must be above -100% per coupon period (above -100% a year for 1 period a year), got -1", and a face of 0 or below with "face value must be positive". A coupon of 0 or below does not stop. With a yield of 0.12 and a coupon of 0.02 the DV01 peaks at 334.25 for 11 years and falls to 317.42 at 15 years.

Your turn

The program below should find, among bond positions, the one with the largest DV01. Several candidate programs are offered. Read them, run them on positions of your own, and decide which of them is right for every set. Check runs each candidate on the positions shown and on five others.

Three bond positions, shown as four lists: faces 2000000, 500000 and 300000, coupons 0.04, 0.05 and 0.05, maturities 2, 10 and 30 years, yields 0.04, 0.05 and 0.05, and the position number that the shown program returns.
market.set_date("2025-01-02");
let best = 0.0; let answer = 0; let shown = 0.0;
for (i in range(0, faces.len())) {
  let bond = instrument.bond(faces.at(i), coupons.at(i), maturities.at(i), 1);
  let dv = risk.bond_dv01_yield(bond, yields.at(i));
  let key = faces.at(i);
  if (key > best) { best = key; answer = i + 1; shown = dv; }
}
lmcode_return_put("dv01_of_answer", lmf.money(shown));
{
  "answer": 1,
  "dv01_of_answer": "377.22"
}

The lists faces, coupons, maturities and yields describe bond positions: position i, counting from 1, is a bond with the face faces[i], a coupon of coupons[i] paid once a year, maturities[i] whole years and the yield yields[i]. Return the number of the position whose DV01 (the change in its value for one basis point of its own yield, for its whole face) is the largest. No two positions have the same DV01. Check runs your program on these positions and on five others.

Read the result carefully

The pictures compare maturities only because every bond is valued at the same yield and the same face. In a market the yields differ by maturity, so the exercise lets every input differ from position to position.

The values are a model's sensitivities at one yield, not a forecast of price moves. The bonds pay for certain and each pays its coupon once a year. DV01 is shown in currency, rounded to cents with lmf.round because binary floats are not exact; the position of the answer is a whole number.

Recap

  • The DV01 of a bond of fixed face grows with its maturity, at a slowing pace.
  • A zero bond has a smaller DV01 than a coupon bond of the same maturity and face in this example: 584.68 against 772.17 at 10 years.
  • DV01 compares positions in currency: it depends on face, coupon, yield and maturity together.