Speed

A Swaption, an Option on a Swap Rate

A payer swaption is the right to enter a swap that pays a fixed rate; its Black value is the annuity of the forward swap times Black's formula on the forward swap rate. The engine prices a one-year option on a five-year swap and the program checks it by hand and by Black's formula.

The question

A company expects to take a five-year loan in a year and pay a fixed rate on it through a swap. It wants the right, not the obligation, to enter that swap at a chosen fixed rate. The right is a payer swaption: an option, exercisable in one year, to pay the strike and receive the floating rate for five years. What is it worth today?

The underlying is the swap's fixed rate as seen from today, the forward swap rate. The option pays when that rate is above the strike, so it is like a caplet on a swap rate, except that what it pays is a stream of five years of payments, not one.

Work it by hand

The payoff at the exercise date is the difference between the forward swap rate and the strike, paid on every period of the swap. Valued today, a unit difference on all periods is worth the annuity: the sum of the notional times accrual times discount factor over the swap's payments. So the swaption is the annuity times a one-period call on the swap rate.

  • The forward swap rate F: for the demo, 4.0834%. The strike K is 4%.
  • The annuity A, with the notional and the discounting to today: 4,265,397.26.
  • Black's formula on F and K with volatility 20% and time 1 year, discount 1, per unit: d1 is 0.2031, and N(d1) and N(d2) are 0.5805 and 0.5012.
  • The value is A times (F N(d1) minus K N(d2)).

The model makes the forward swap rate lognormal with one volatility and treats the annuity as known. Both are assumptions.

Run it

The program takes notional, strike, the flat continuous rate, vol, and the whole years expiry of the option and tenor of the swap. Line 3 describes the swap and line 4 the option on it. Lines 5 and 6 ask the engine for the forward swap rate and the annuity, and line 7 for the price with pricing.swaption_npv.

Lines 8 to 11 price it by hand, line 12 with pricing.black76 and a discount of 1, because the annuity already includes the discounting. Line 13 recovers the volatility from the price. The program returns the engine's price minus the annuity times Black's price in whole cents.

Rows with the forward swap rate 0.040834, the annuity 4,265,397.26, the engine's price 15,582.60, the price by hand 15,582.60, the annuity times Black's price 15,582.60 and the implied volatility 0.2.
market.set_date("2025-01-02");
let curve = market.flat_curve(rate);
let swap = instrument.swap(notional, strike, float(tenor));
let option = instrument.swaption(swap, float(expiry));
let forward = pricing.swaption_forward_rate(option, curve);
let annuity = pricing.swaption_annuity(option, curve);
let price = pricing.swaption_npv(option, curve, vol);
let sd = vol * math_sqrt(float(expiry));
let d1 = lmf.log(forward / strike) / sd + sd / 2.0;
let n1 = lmf.norm_cdf(d1); let n2 = lmf.norm_cdf(d1 - sd);
let by_hand = annuity * (forward * n1 - strike * n2);
let unit = pricing.black76("call", forward, strike, vol, float(expiry), 1.0);
let implied = pricing.swaption_implied_vol(option, curve, price);
lmcode_return_put("forward", lmf.round(forward, 6));
lmcode_return_put("annuity", lmf.money(annuity));
lmcode_return_put("price", lmf.money(price));
lmcode_return_put("d1", lmf.round(d1, 4));
lmcode_return_put("n_d1", lmf.round(n1, 4));
lmcode_return_put("n_d2", lmf.round(n2, 4));
lmcode_return_put("by_hand", lmf.money(by_hand));
lmcode_return_put("annuity_x_black", lmf.money(annuity * unit));
lmcode_return_put("implied_vol", lmf.round(implied, 6));
let answer = int(math_round(lmf.round(price - annuity * unit, 2) * 100.0));
{
  "answer": 0,
  "forward": 0.040834,
  "annuity": "4,265,397.26",
  "price": "15,582.60",
  "d1": 0.2031,
  "n_d1": 0.5805,
  "n_d2": 0.5012,
  "by_hand": "15,582.60",
  "annuity_x_black": "15,582.60",
  "implied_vol": 0.2
}

The two sides are the engine's values on the evaluation date 2025-01-02, and Check compares the residual. It is 0 for expiry 1. For other whole years the time the engine uses to the exercise date differs a little from the number of years that black76 is given, so the residual is not 0: at expiry 2 it is 2526 cents.

The recovered volatility stays 0.2 while the price depends on it. When the forward swap rate is very far from the strike, the price hardly moves with the volatility and the recovered value is no longer 0.2: a strike of 0.0001 or a rate of 0.0001 returns 0.00001.

The other limits stop the program in the engine's own words. A notional of 0 stops line 5 with "swap notional must be positive". The same line stops for a tenor outside 1 to 100 with "swap maturity must be a whole number of years, 1 to 100" and for an expiry above 50 years with "swaption expiry must be a whole number of months, up to 50 years".

An expiry of 0 stops line 4 with "swaption expiry must be positive", a volatility of 0 stops line 7 with "swaption volatility must be positive", and a strike of 0 stops line 9 with "LmfApi.log argument 1 must be finite".

A negative strike stops line 6 with "strike + displacement (-0.01 + 0) must be non-negative" (for -0.01), a rate below 0 stops line 6 with "forward + displacement (-0.00995559 + 0) must be positive" (for -0.01), and a rate of 0 stops line 13 with "swaption price must be positive".

Two more limits are at the far end. A volatility above 4 stops line 13 with a message that begins "root not bracketed", because the search for the implied volatility covers 0.00001 to 4 only. A rate so large that the discount factors become 0, such as 150, stops line 6 with "forward + displacement (nan + 0) must be positive".

Your turn

The list discounts holds the discount factors of the fixed payments of a swap, one for each year. The program below is meant to return the value of a payer swaption on it in whole cents: the annuity, which is the notional times the sum of the discount factors, times Black's call price on the forward swap rate with discount 1. Decide whether it does, and find the candidates that do. Check runs each candidate on the data shown and on five others.

The inputs notional 1500000, forward 0.042, strike 0.039, vol 0.22 and expiry 1, with the whole number of cents that the shown program returns.
let total = 0.0;
for (i in range(0, discounts.len())) { total = total + discounts.at(i); }
let annuity = notional * float(discounts.len());
let unit = pricing.black76("call", forward, strike, vol, expiry, 1.0);
let answer = int(math_round(lmf.round(annuity * unit, 2) * 100.0));
{
  "answer": 2360649
}

The list discounts holds the discount factors from today to the payment dates of the fixed leg of a swap, one for each year. The annuity of the swap is notional times the sum of the discount factors. Return, in whole cents, the value of a payer swaption on it with the given forward swap rate, strike, vol and expiry in years: the annuity times Black's call price on the forward swap rate with a discount factor of 1. Round the result to cents.

Read the result carefully

The model treats the forward swap rate as lognormal with one volatility and the annuity as known; real swap rates and annuities move together. The underlying here is the engine's market swap with its own calendar and day counts, not the textbook swap of the swaps book, so numbers are not comparable. The flat 4% curve and the 20% are made up.

The page shows what the engine and these formulas do for made-up inputs and says nothing about real swaption prices or about whether to buy or sell one. It is a description of an arithmetic model and not investment advice.

Recap

  • A payer swaption is the right to pay a fixed rate on a swap from a future date.
  • Its Black value is the annuity of the forward swap times Black's formula on the forward swap rate.
  • The engine's pricing.swaption_npv agrees with the annuity times Black's price when the exercise date is exactly expiry years away, as at expiry 1.
  • The volatility recovered from the engine's price gives the volatility put in.