100% found this document useful (2 votes)
249 views40 pages

Swaptions Complete Doc 1695378807

This document provides an introduction to interest rates, bonds, swaps, and swaptions. It covers topics such as what interest rates are, interest rate mathematics including day count conventions and present/future value calculations, models for interest rate movements, an introduction to bond pricing, interest rate swaps including pricing and basis swaps, an introduction to swaptions including definitions and payoffs, swaption pricing theory and Greeks, and various swaption strategies. The goal is to provide theory, code, and applications related to these fixed income instruments.

Uploaded by

Constant Toure
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
249 views40 pages

Swaptions Complete Doc 1695378807

This document provides an introduction to interest rates, bonds, swaps, and swaptions. It covers topics such as what interest rates are, interest rate mathematics including day count conventions and present/future value calculations, models for interest rate movements, an introduction to bond pricing, interest rate swaps including pricing and basis swaps, an introduction to swaptions including definitions and payoffs, swaption pricing theory and Greeks, and various swaption strategies. The goal is to provide theory, code, and applications related to these fixed income instruments.

Uploaded by

Constant Toure
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Introduction to Interest Rates, Bonds,

Swaps and Swaptions


Theory, Code and Applications

Bailey Arm

September 21, 2023


Contents
Page

1 Interest Rates 3
1.1 What are Interest Rates? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Interest Rate Mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.1 Day Count Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.2 Present Value and Future Value of Cash Flows . . . . . . . . . . . . . . . . 4
1.2.3 Yield of an Investment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

2 Interest Rate Modelling 7


2.1 The Most Basic Non-Deterministic Interest rate model . . . . . . . . . . . . . . . 7
2.2 Mean-Reverting Interest Rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3 A Synthesis of Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

3 Bonds 11
3.1 An Introduction to Bonds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1.1 Bond Pricing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1.2 Finding the Yield on a Bond . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.1.3 Zero Coupon Bonds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.1.4 Pricing a Bond between Coupon Payments . . . . . . . . . . . . . . . . . . 12
3.2 Bond Yield Calculation under Newton-Raphson . . . . . . . . . . . . . . . . . . . 13

4 Interest Rate Swaps 15


4.1 What is an Interest Rate Swap? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.2 Pricing an Interest Rate Swap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.2.1 Deciding the Fixed Rate on an Interest Rate Swap . . . . . . . . . . . . . 16
4.3 Python Pricing of Interest Rate Swaps . . . . . . . . . . . . . . . . . . . . . . . . 18
4.4 Vanilla Basis Swaps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.5 Cross Currency Basis Swap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.5.1 Non MTM (Mark-To-Market) Cross Currency Basis Swap . . . . . . . . . 20

5 An Introduction to Swaptions 23
5.1 What is a Swaption? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.1.1 Definition of a Swaption . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.1.2 Swaption Payoffs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

6 Swaption Pricing Theory 24


6.1 A Brief Aside - Option Intuition Advice . . . . . . . . . . . . . . . . . . . . . . . . 24
6.2 Back to Swaption Pricing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
6.2.1 Binary Pricing Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
6.2.2 Pricing European Swaptions . . . . . . . . . . . . . . . . . . . . . . . . . . 26

1
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm

7 Swaption Greeks 27
7.1 Delta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
7.1.1 Swaption Delta Derivation . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
7.1.2 Delta Structure of Payer Swaption . . . . . . . . . . . . . . . . . . . . . . 28
7.1.3 Delta Hedging a Swaption . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
7.2 Gamma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
7.2.1 Swaption Gamma Derivation . . . . . . . . . . . . . . . . . . . . . . . . . 29
7.2.2 Swaption Gamma Python Code . . . . . . . . . . . . . . . . . . . . . . . . 29
7.3 Vega . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
7.3.1 Swaption Vega Derivation . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
7.3.2 Swaption Vega Python Code . . . . . . . . . . . . . . . . . . . . . . . . . . 31
7.4 Theta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
7.4.1 Swaption Theta Python Code . . . . . . . . . . . . . . . . . . . . . . . . . 32

8 Swaption Strategies 34
8.1 Directional Strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
8.1.1 Outright Payers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
8.1.2 Payer Spread . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
8.2 Interest Rate Volatility Trading . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
8.3 Modelling Swaption Trades with Python . . . . . . . . . . . . . . . . . . . . . . . 36
8.3.1 Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
8.3.2 Modelling Directional Swaption Trades with Python . . . . . . . . . . . . . 36
8.3.3 Modelling Swaption Straddle Prices with Python . . . . . . . . . . . . . . 38

2
1 Interest Rates
1.1 What are Interest Rates?
Interest rates are essentially the cost of borrowing money over a fixed period of time. For example,
say you need $100 for a new coat and I am happy to lend you that $100, in exchange for you
giving me 1% interest extra back. So, you get to buy a coat and I make a $1 profit after giving
you the money. Intuitively, non-zero interest rates make sense; I am giving up the opportunity
to use my $100 over the time that you are borrowing it from me.

1.2 Interest Rate Mathematics


1.2.1 Day Count Conventions
Day count conventions are the rules for calculating the amount of interest payable/accrued over
a time period. The day count adjusted interest payable is:

Interest Payable = Notional × Day Count Factor × Interest Rate Per Annum
Here is an example of day count adjusting a $1mn loan at an annual interest rate of 5%
between the days of Jan 1st 2023 to Mar 1st 2023:

Day Convention Day Count Factor Interest Payable on Loan

1/1 1/1 $1mn × 1 × 0.05 = $50000/

ACT/ACT (30 + 28 )/365 = 0.1589 $1mn × 0.1589 × 0.05 = $7945.2

ACT/365F (30 + 28 )/365 = 0.15891 $1mn × 0.1589 × 0.05 = $7945.2

30/360 (30 + 30)/360 = 0.16667 $1mn × 0.16667 × 0.05 = $8333.50

We will be utilising day count conventions in later chapters, for example when evaluating the
PV of an interest rate swap, day count conventions play a significant role.

Annualisation of Interest Rates


Say we have an annual rate of 10%. Dividing this in half, as we will do later on, does not give a
semi-annual rate2 . For example, a 10% annual interest on $1mn would be $100,000, whereas 5%
semi-annually would be 1.052 × $1mn = $102, 500 as we earn 5% on the initial $1mn principal
2
This is to say that when compounding, one must take care with how they scale rates

3
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm

and then both 5% on the principal again and also 5% on our original 5%. To find an equivalent
semi-annual yield to an annual yield of 10%, we are essentially solving:

(1 + r)2 = 1.10
So then we find:

r= 1.10 − 1 = 0.0489
So then 10% compounded annually is equivalent to 4.9% compounded semi-annually.
To solve generally, one has that:

(1 + r)m = 1 + R
Where r is the period rate, m is the number of periods in a year and R is the annual rate.

1.2.2 Present Value and Future Value of Cash Flows


Say that I have $X and that the current interest rates are r (for example r = 0.04), one might
ask ’what is the future value of this principal?’. We can simply compute:

F V = (1 + r)X
So say I have $1000 and that current annual interest rates are 5%, the future value of my
original principal will be F V = 1.05 × 1000 = 1050. Now, what about after two years? We can
simply multiply again by the same factor and get the answer:

F V = 1.05 × (1.05 × 1000) = 1102.5


Where we see a bigger increase as we are earning ’interest on interest’.
Now say that you want to give me $1000 one year in the future, with current interest rates
at 5%. The most suitable question to ask would be ’what is that worth currently?’. This is
equivalent to asking ’with current interest rates at 5%, what initial principal do I need to receive
$1000 one year in the future?’.
Let X be the initial principal. We can formalise the question by solving for X in:

1.05 × X = 1000
Simply dividing yields:
1
X=1000 = 952.38
1.05
Thus, the present value of $1000 dollars one year in the future under a 5% interest rate
environment would be $952.38 3
Now imagine a more complex but realistic situation where interest rates are not stationary. An
example of this can be seen in 1.1 This graph shows the Effective Federal Funds Rate (EFFR),
a volume-weighted median of overnight federal funds transactions reported. This is a major
3
Think of this as the fair cost to buy into this agreement to receive this cash flow. It is important to note that
we are assuming the cash flow to be certain, with zero default probability

4
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm

Figure 1.1: Effective Federal Funds Rate from 4th Sep 2022 to 4th Sep 2023

benchmark in the interest rate world. We can see that the Federal Reserve (the Fed) have been
hiking (raising) interest rates in order to combat inflation, with EFFR increasing from 2.4% to
more than 5.3%.
Let us start with a simple example. Let’s say that interest rates are projected to follow
5% → 5.5% → 6% over the next two years, and say that I want to know how much my $100 will
be worth at the end of the two years.
I can simply compute this as such:

$100 × 1.055 × 1.06 = $111.83


Mathematically, let us say we have a series of projected interest rates r := (ri )ni=0 where ri is
the interest rate i years from now, and r0 is the current interest rate. Say that I want to know
what the present value of $X is k ≤ n years in the future is. I compute:
k
Y
PV = X (1 + ri )
i=1

Let us further complicated this example by examining the present value of a series of cash
flows X := (Xi )ki=1 , k ≤ n. We compute the following sum in order to find the present value4 :
k
X Xi
PV = Qi
i=1 j=1 (1 + ri )

Periodic Compounding
Some interest payments are calculated semi-annually or quarterly. To deal with this in present
value calculations, we can adjust the annual rate in the following way:
4
It is essential to point out that we are assuming that the payments are in the same currency, if they were not
we could adjust using the fx rate, or use some chain of fx options to fix the conversion:
k
X Xi × fxi
P VFX CONVERTED = Qi
i=1 j=1 (1 + ri )

Where fxi is the fx conversion for our ith payment

5
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm

X
PV =
(1 + i/m)n×m
Where X is our periodic cash flow ($1000 annually may be seen as $250 quarterly), m is the
number of periods in a year and n is the number of years.
Putting this into an example, say I have invested in company X and expect $1mn in 5 years.
Furthermore, say that I am assuming that interest rates will stay static over this 5 year period
at 4% compounded semi-annually. The present value of this cash flow is:
1000000
PV = = $820, 348.30
(1 + 0.04/2)5×2
So in other words, a fair value of this cash flow, assuming static interest rates and complete
certainty in the cash flow, would be $820,348.305

1.2.3 Yield of an Investment


Imagine that you have bought into some security that promises a series of cash flows X that,
under the current interest rate expectations, is currently worth C. The yield on this investment
is defined to the value y such that:
n
X Xi
C=
i=1
(1 + y)i
For example, let us say that I have paid $858.76 for a 4% Government bond maturing in 10
years. What is the yield? We can see that given our bond is trading at a discount6 . we know
that the yield must be higher than the coupon rate. Guessing the yield to be 6%, gives a PV of
$851.23, and thus the yield must be slightly lower. In fact, the exact yield is 5.889%.
There is in fact a formal way of doing this iteratively, using the Newton-Raphson method
which I shall discuss in the later chapter ’Bond Yield Calculation under Newton-Raphson’

5
This is technically incorrect, recall that the semi-annual rate is not exactly equal to half the annual rate
6
Here are some terms used when discussing bonds:
(i) Discount Bond: The bond is trading below par. This happens when the coupon rate is below the required
yield,
(ii) Bond is Trading at a Premium: The bond is trading above par. This is when the coupon rate is above the
required yield

6
2 Interest Rate Modelling
This chapter can probably be skipped if you aren’t interested in interest rate models or
applying stochastic processes to finance - the rest of this document is not dependent on these
models but I felt it best to include a chapter on modelling interest rates.
An assumption that I will build upon is that interest rates are mostly random1 processes. It
is perhaps better that I mention that the model that we will be building together will focus on
short term movements (intra-week even) in interest rates.

2.1 The Most Basic Non-Deterministic Interest rate model


So, we could assume first that interest rates follow a random walk. Let r be the interest rate we
want to model. Then, we could perhaps assume:

dr = dWt
Where Wt is the standard 1-Dimensional Wiener process. This model is basically saying that
at every interval, interest rates follow a normal distribution.
In Python:
1 def simpleModel ( initialRate , time , intervals ) :
2 dt = time / intervals
3 r = initialRate
4 rates = []
5 for i in range ( intervals ) :
6 r += ( np . random . standard _ normal () - np . random . standard _ normal () )
/ 100
7 rates . append ( r )
8
9 plt . figure ( figsize = (12 ,6) )
10 plt . plot ( rates )
11 plt . xlabel ( f ’ Time (1 = { dt } years ) ’)
12 plt . ylabel ( ’ Interest Rate ’)
13 plt . title ( ’ Random Interest Rate Model ’)
14 plt . show ()
Running ’simpleModel(5, 1,1000)’ for me, yields:
It is important to note that if you run this code, you will get a different graph, even when
putting in the same variables. More accurately, we should scale the movements in line with a
historical volatility of the interest rate:

dr = σdWt
1
By mostly I am referring to the fact that interest rates will probably revert after some period of time, i.e. it
is highly unlikely that the FED will continue to keep interest rates at around the 5% level

7
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm

Figure 2.1: Simple Interest Rate Model, dr = dWt

Where σ is the average historical volatility over our chosen time interval. Have a go at
modifying my code above in order to include an extra input of historical volatility, and look at
how this can affect the graph.

2.2 Mean-Reverting Interest Rates


One could safely assume that interest rates tend to return to some base level or a long term
average. Let θ be this long term average. We could assume that each time step causes interest
rates to creep back to this long term average with some strength κ. A possible model would be:

dr = κ(θ − r)dt
Here is some code to plot the evolution of interest rates under this assumption:
15 def meanRevertingModel ( kappa , longTermRate , initialRate , time , intervals
):
16 dt = time / intervals
17 r = initialRate
18 rates = []
19
20 for i in range ( intervals ) :
21 r0 = r
22 r += kappa * ( longTermRate - r0 ) * dt
23 rates . append ( r )
24
25 plt . figure ( figsize = (12 ,6) )
26 plt . plot ( rates )
27 plt . xlabel ( f ’ Time (1 = { dt } years ) ’)
28 plt . ylabel ( ’ Interest Rate ’)
29 plt . title ( ’ Mean - Reverting Interest Rate Model ’)
30 plt . show ()
Running this and ’meanRevertingModel(0.5,2,3, 1,1000)’ shows why this model is not very
realistic:

8
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm

Figure 2.2: Mean-Reverting Model dr = κ(θ − r)dt

It is clear to see why this model is never used on its own.

2.3 A Synthesis of Models


Now we combine the two models to make a more accurate model. We want to include some
reversion characteristics but also randomness. We can simply add the models together:

dr = κ(θ − r)dt + σ rdWt
Here is some Python code:
31 def interestRateModel ( kappa , longTermAverage , initialRate , volatility ,
time , intervals ) :
32 dt = time / intervals
33 r = initialRate
34 rates = []
35
36 for i in range ( intervals ) :
37 r0 = r
38 r += kappa * ( longTermAverage - r0 ) * dt + volatility * np . sqrt ( r0 ) * (
np . random . standard _ normal () - np . random . standard _ normal () ) /
100
39 rates . append ( r )
40
41 plt . figure ( figsize = (12 ,6) )
42 plt . plot ( rates )
43 plt . xlabel ( f ’ Time (1 = { dt } years ) ’)
44 plt . ylabel ( ’ Interest Rate ’)
45 plt . title ( ’ Mean - Reverting and Random Interest Rate Model ’)
46 plt . show ()
Running this and ’interestRateModel(0.3,2,5,0.2,1,1000)’ shows the nature of the model (2.3).
It is clear to see why this synthesis model might be more suitable for interest rate modelling,
not only does it include the random nature of interest rates, it also includes long term rate

9
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm


Figure 2.3: Synthesis Model, dr = κ(θ − r)dt + σ rdWt

reversion. I have deliberately picked a large reversion number κ in order to demonstrate how
interest rates behave under this model (note that as κ → 0, we get a scaled version of our original
model2 )
The paper ’Mean Reversion in Interest Rates: New Evidence from a Panel of OECD Coun-
tries’ by Wu and Zhang could suggest that there are no statistically significant reversion charac-
teristics in the interest rates of multiple different countries.
This chapter was just to show how one can build up from relatively simple assumptions and
produce a model that exhibits interesting and hopefully useful results.

2
Studies have found κ to be relatively low, close to 0 but skewed postively very slightly

10
3 Bonds
3.1 An Introduction to Bonds
Possibly the best example of using what we have learnt previously is in pricing bonds. Simply
put, issuing a bond is an agreement to pay some coupon with some frequency until maturity
and then a final coupon plus a ’par’ at maturity. It can be thought of as a series of coupon
payments at regular intervals (semi-annual for typical Government bonds and quarterly for some
other bonds), plus some ’par’ value at maturity.
For example, a 10 year 5% Government bond on a par of $1000 has the following cash flows:

(i) 10 × 2 = 20 coupons of $251 paid every 6 months for 10 years,

(ii) $1000 at maturity (in 10 years)

3.1.1 Bond Pricing


To price this to yield a certain amount2 , we discount by our yield, say 3%:
20
X $25 $1000
PV = i
+
i=1
(1 + 0.03/2) (1 + 0.03/2)20
Noting that the left most part is actually a geometric series yields:
1 1
$25 1 − 1.01520 $1000 1 − 1.01520 $1000
PV = 1 + 20
= $25 + = $1171.69
1.015 1 − 1.015 1.015 0.015 1.01520
It should be clear that we can substitute in algebraic expressions in place of our numbers in order
to achieve a formulaic expression of the bond’s PV:
1
1− (1+y/k)n Par
PV = c × +
y/k (1 + y/k)n
Where y is the annual yield expressed as a decimal, c is the periodic coupon payment and k is
the number of payments per year (as stated earlier, this is typically 2 or 4)
1
There are 5 × 2 coupons as the coupons are paid semi-annually. These coupons are $25 each, simply as 5%
of par must be paid each year, equating to $50 per year or $25 semi-annually
2
This yield is usually chosen by comparing this bond to other bonds with equal maturity and equal credit
quality

11
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm

3.1.2 Finding the Yield on a Bond


Let’s say that we have bought a 9% 5 year Government bond and its present value is $1253.86.
Finding the yield is an iterative process. If the yield was equal to the coupon rate (9%) then
one should have that the present value of the bond is equal to its par of $1000. As the PV is
greater than par, we have that the coupon rate must be greater than the yield. Let’s guess that
the yield is 5%. The price is then:

1 − 1.0251 5×2 $1000


P V = 0.09/2 × $1000 + = $1175.04
0.025 (1.025)10
Then we now have to adjust our 5% estimate down to say 3.4%, yielding a price of $1255.51.
The yield must be very close to 3.4%.

3.1.3 Zero Coupon Bonds


As their name suggests, Zero Coupon Bonds, or ZCBs are bonds which pay no coupon. Instead,
they accrue interest over the entire maturity of the bond and pay it out at maturity. Simply put,
ZCBs are priced at a steep discount to par. For example imagine a world where interest rates
have sky rocketed to 10%. A $1000 par 10 year ZCB would cost:

$1000
= $376.89
1.0520

3.1.4 Pricing a Bond between Coupon Payments


Sometimes when buying bonds, a price adjustment must be made between the day that you
bought it and the last coupon date. Using the standard day count convention with US Treasuries
of ACT/ACT, we can price a 5% 5 year bond bought on Mar 1st with the next coupon on Sep
1st with the required yield of 4.8%, understanding that there are 8 more coupons to be paid.
We start by finding the number of days between the settlement date and the next coupon
under the ACT/ACT convention:

(30 + 30 + 31 + 30 + 31)/180 = 0.84443


Then, we price as follows:

7 1
$25 $25 X 1 $1000 1 − 1.0247 $1000
PV = 0.8444
+ 0.8444 i
+ 0.8444+7
= $25 0.8444
+
1.024 1.024 i=1
1.024 1.024 0.024 × 1.024 1.0247.8444

Finding that P V = $986.42


In fact, as we are buying between coupon payments, to buy the bond we must pay the above
PV plus accrued interest, compensating the issuer for the amount they have earned but not
received.
Accrued interest is calculated as:
3
We divide by 180 here as the number of days between coupons is 180

12
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm

Number of Days from Last Coupon to Settlement Date


Accrued Interest = Coupon ×
Number of Days in a Coupon Period

In our case, the total bond price is: $986.42 + $25 × 24


180
= $989.75

Formula for Bond Price between Coupon Payments


1
1− (1+i)n−1 Par
P V = Coupon × +
i× (1 + i)DCF (1 + i)n−1+DCF
Where:
No. Days between Settlement Period and Next Coupon
DCF =
No. Days in a Coupon Period
Where these calculations are done in the relevant day count conventions

3.2 Bond Yield Calculation under Newton-Raphson


As mentioned previously, finding the yield requires a numerical process. We will be doing this
through the Newton-Raphson method which states that if I want to find where some function
f (x) is equal to a, I iterate as follows:

a − f (xn )
xn+1 = xn + df
dx
(xn )
Writing the dirty price of a bond in terms of its yield, with w = DCF :

c 1 − (1+y)1 n−1 P
Pd (y) = (w + ) +
(1 + y)w y (1 + y)n−1+w
We can follow my derivation:
This gives a formula that will iterate to find the semi-annual yield of a dirty bond expressed
as a decimal.

13
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm

Figure 3.1: Iterating to find the Bond Yield under Newton-Raphson

14
4 Interest Rate Swaps
4.1 What is an Interest Rate Swap?
An interest rate swap is simply an agreement (or a contract) between two parties to exchange
cash flows on certain dates over a specified maturity. More specifically, one party agrees to
pay some fixed percentage (say 5%) of some agreed amount called the notional ($1, 000, 000 for
example) in order to receive a variable, or floating, percentage that is bench marked by some
index.

Figure 4.1: Interest Rate Swap Diagram

The image above is useful when understanding one payment during an IRS, however to think
about the entirety of an IRS, imagine a sequence of these diagrams pasted above on another.
For future ease, when I am referring to the payer of an IRS, I am simply referring to the payer
of the fixed leg/receiver of the floating leg.

4.2 Pricing an Interest Rate Swap


Pricing an interest rate swap is fairly simple, from the perspective of the payer of a (vanilla) IRS,
every period we pay some fixed amount and receive a variable amount.
Starting at the basics, imagine a one period IRS on a notional of N , with fixed rate f and
floating rate r0 in 6 months time. So, as the payer, in 6 months I will pay f N and receive rN ,
with my profit being the difference N (r − f ). Then I must discount this back in order to find the
present value. So, the PV of the 1 period interest rate swap is N(1+k)
(r−f )
with k being the 6 month
interest rate.
Now imagine I string these in a chain, receiving ri N every 6 months and paying f N every 6
months. Then, my PV will be:
n
X (ri − f )
PV = N Qi
i=1 j=1 (1 + kj )

Perhaps putting this into an example could be useful. Say I am currently paying off my $1mn
mortgage which is on a floating rate (let’s call it the MB rate). Because of economic uncertainty
and issues in the housing market, I believe that the floating rate will skyrocket from 6% to 20%

15
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm

within a year. In order to do this, I will be the payer of a semi-IRS1 on a notional of $1mn, with
a 1 year maturity receiving the MB rate and paying a fixed rate of 6%.
What I have essentially done here is cancelled the floating rate I pay on my mortgage, and
will instead pay the fixed rate which is 6%. Now say that interest rates stay at 3% and the MB
rate is expected to go from 6% → 11% → 15% (every 6 months). Then, the PV of the interest
rate swap is:

11% − 6% 15% − 6%
$1mn × ( + ) = $133, 377
1.03 1.032
However say that the MB rate falls 6% → 5% → 2%. The PV of this would be −$47, 412.

4.2.1 Deciding the Fixed Rate on an Interest Rate Swap


Recall the price of an interest rate swap being:
n
X (ri − f )
PV = N Qi
i=1 j=1 (1 + kj )

Typically when trading IRS, traders like to find the fixed rate at which the IRS has 0 value. In
essence, we are solving:
n
X (ri − f )
N Qi =0
i=1 j=1 (1 + kj )

This is hopefully easy to solve:


n n n
X (ri − f ) X ri X f
Qi = 0 =⇒ Qi = Qi
i=1 j=1 (1 + kj ) i=1 j=1 (1 + kj ) i=1 j=1 (1 + kj )

We have that:
n n
X f X 1
Qi =f Qi
i=1 j=1 (1 + kj ) i=1 j=1 (1 + kj )

Yielding
Pn ri
n n
1 ri
Qi
i=1
j=1 (1+kj )
X X
f Qi = Qi =⇒ f = Pn 1
j=1 (1 + kj ) j=1 (1 + kj )
Qi
i=1
i=1 i=1 j=1 (1+kj )

This is called the swap rate, or the mid-market rate. For example, say that we know for
certain that the discounting interest rates ki will remain at 4.5% for the next 3 years, and the
market is pricing for the floating rate to go from 3% → 5% → 4%. We can now find the swap
rate of a 3y IRS:
0.03 0.05 0.04
1.045
+ 1.0452
+ 1.0453
f= 1 1 1 = 0.0399 = 4%
1.045
+ 1.0452
+ 1.0453
1
The ’semi’ prefix refers to the frequency of payments, i.e. every 6 months

16
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm

In short, the swap rate contains useful information about the rate of return on an interest rate
swap.
It is important to note that I have assumed that the interests given are quoted and scaled
by their appropriate day count convention. Technically, the actual pricing formula, from the
perspective of the payer is:
N1
X dcf(fixed)i
N2
X rj dcf(floating)j
P V = N (−f Qi + Qj )
i=1 k=1 (1 + αk ) j=1 k=1 (1 + βk )

Where N1 , N2 are the number of payments on the fixed and floating leg, respectively, dcf(...)i
is the day count factor for the ith payment of the ... leg, rj is the floating rate on the j th payment
and αk , βk are the discounting rates for the fixed and floating leg respectively. Although this is
a rather daunting formula, an example illustrates the utility of explicitly stating each involved
factor.
For example, say I’m the payer of a $100mn 1Y semi-quarterly IRS, with fixed rate of 2%.
Furthermore, let’s say that the fixed leg payments happen on the 1st every 3 months and the
floating is on the 1st every 6 months, with our calculations happening under the 30/360 day
count convention, and assuming that the discount rate is 5% per annum, we can value this swap
as follows.

Figure 4.2: The 1Y Semi-Quarterly IRS

Fixed Leg
The fixed leg pricing formula is simply:
N1
X dcf(fixed)i
P VFixed Leg = N ∗ f Qi
i=1 k=1 (1 + αk )

Where N = 100mn, f = 0.02, dcf(fixed)i = (30 + 30)/360 = 0.16667 and αk = (1 + 0.05)1/4 −


1 = 0.0123, we have:
4
X 1
P VFixed Leg = 100mn ∗ 0.02 ∗ 0.1667 = $1, 293, 579
i=1
1.0123i

17
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm

Now to calculate the PV of the floating leg, under the assumption that the floating rate will
rise to 3% and then 5%:

0.03 ∗ (6 ∗ 30)/360 0.05 ∗ (6 ∗ 30)/360


P VFloating Leg = N ( √ + ) = $3, 844, 802
1 + 0.05 1.05
Then subtracting the fixed PV from the floating PV yields a price of $2,551,223. In short,
adjusting the formula to include day count conventions allows us to be more flexible and to price
different structures/IRS with different day count conventions on either leg.

4.3 Python Pricing of Interest Rate Swaps


I have included code to be used in pricing interest rate swaps in my post, however I felt a quick
explanation necessary.
47 import numpy as np
48
49 def swapPrice ( notional , floating , fixed , volatility , maturity ,
discountingRates ) :
50 # floating is an array of your expectations of the floating leg , say
there are n entries ,
51 # periods is the number of different coupon payments ,
52 # discounting rates is an array of expecations of continuous
discounting rates on each period ( must also be n entries )
53 floatingLeg = 0
54 periods = len ( floating )
55 for i in range ( periods ) :
56 floatingLeg += ( notional * floating [ i ]) * np . exp ( - discountingRates [ i
] * ( i +1) * maturity / periods )
57
58 fixedLeg = 0
59 for j in range ( periods ) :
60 fixedLeg += ( notional * fixed ) * np . exp ( - discountingRates [ i ] * ( i +1) *
maturity / periods )
61
62 print ( f ’ The price that the payer of this swap should pay is : {
floatingLeg - fixedLeg } ’)
Let’s say that I want to be the payer of an XYZ swap, thinking that the XYZ rate will go as
follows 3% → 3.5% → 3.8% → 4.5% over the next year. Furthermore, say for some reason I
want to hedge against this rise and want to be the payer of a swap on XYZ, maturing in a year.
Obviously, I want to know how much this will cost. We can then simply run the following code
(after running the code above):
63 swapPrice (1000000 , [0.035 , 0.038 , 0.045] , 0.03 , 0.02 , 1 , [0.045 ,
0.043 , 0.043])
Resulting in a price of $28,299. Now say instead that I pay that much and the rate will go:
3% → 4% → 5.2% → 6.5%. A good question to ask is, what is my profit? It is calculated
through calculating:

18
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm

64 swapPrice (1000000 , [0.04 , 0.052 , 0.065] , 0.03 , 0.02 , 1 , [0.045 ,


0.043 , 0.043])
And then subtracting, resulting in a profit of $65987 − $28299 = $376882

4.4 Vanilla Basis Swaps


A basis swap is a swap in which both legs are floating. For example, say I want to buy a $1mn
6mo 1M $LIBOR vs 3M $LIBOR, i.e. I want to pay the 1mo $LIBOR rate for 6mo and receive
the 3mo $LIBOR rate over the same period of time. The question is how to price this. We will
first start by pricing the leg to pay:
N1
X pi dcfi
P VPaying Leg = N Qi
i=1 k=1 (1 + αk )

Where pi is the rate to pay at time i. Pricing the receiving leg is identical apart from the
rate, dcf and discounting:
N2
X rj dcfj
P VReceiving Leg = N Qj
j=1 k=1 (1 + βk )

Note that typically a spread adjustment is made to the shorter tenor rate such that the total
PV is 0. Adding a spread onto the paying leg, we have that the PV of a basis swap is:
N1 N2
X (pi + S)dcfi X rj dcfj
P V = N (− Qi + Qj )
i=1 k=1 (1 + α i ) j=1 k=1 (1 + β k )
It is a simple exercise to find the spread necessary for a zero PV:
N1 N2
X (pi + S)dcfi X rj dcfj
P V = 0 =⇒ Qi = Qj
i=1 k=1 (1 + αi ) j=1 k=1 (1 + βk )

Pulling out our adjusting spread S:


N1 N N
X dcfi X 1
pi dcfi X 2
rj dcfj
S Qi + Qi = Qj
i=1 k=1 (1 + αk ) i=1 k=1 (1 + αk ) j=1 k=1 (1 + βk )

In which we have that :


PN2 rj dcfj PN1 p dcf
j=1 Qj − Q i i
i=1 i (1+αk )
k=1 (1+βk ) k=1
S= PN1 dcfi
i=1 i (1+αk )
Q
k=1

Going back to my example, let’s say that the market is expecting the 1mo $LIBOR rate to
follow: 3%,4%,3.5%, 3.1%, 3%,3% and the 3mo $LIBOR rate to follow: 3.7%, 3.6%. To keep
2
It is important to note that I have placed assumptions of stability in the discounting rates, these can and do
change and will affect the prices

19
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm

this example nice and simple we will just assume that we can discount by an annual rate of 2%,
and that we can use the 30/365 day count convention, along with every payment date falling on
the 1st of its month.
To find the PV of the paying leg, we use the formula:
N1
X pi dcfi
P VPaying Leg = N Qi
i=1 k=1 (1 + αk )

With N = $1mn, αk = 1.021/12 − 1 = 0.00165 and dcfi = 30/365 = 0.0822. Our PV is then:
6
X pi
P VPaying Leg = $1mn ∗ 0.0822 = $16, 020.85
i=1
1.00165i
In a similar fashion, we find the PV of our receiving leg to be $35,472.12. So then, the PV of
this basis swap would be $35,472.12 - $16,020.85 = $19,451.27.
Plugging our values in to the spread formula would yield a spread adjustment of 4bps3

4.5 Cross Currency Basis Swap


4.5.1 Non MTM (Mark-To-Market) Cross Currency Basis Swap
A cross currency basis swap (XCBS) is very similar to a standard basis swap, apart from the fact
that in a XCBS, the legs are paid in different currencies. Take for example a $1mn 1y GBP/USD
Semi-Quarterly XCBS on two imaginary rates - the pound rate and the dollar rate. On one side
of this swap, I would be paying the pound rate in pounds every 6 months for 1y on a notional of
$1mn, and receiving the dollar rate in dollars every 3 months for 1y on a notional of $1mn.
It is best to draw a diagram in order to understand this type of swap.
Where pi is the pound rate of the ith period and di is the dollar rate of the ith period. It is
important to note that in XCBSs, both day count conventions and discounting rates are different.
We will price the example XCBS first, from the perspective of the payer of the pound, and then
build up from there.
Technically the diagram I have drawn is incorrect. Before any interest is exchanged, the no-
tionals are exchanged (for example a $1mn EUR/USD XCBS would involve one party giving the
other $1mn in euros and the other party paying $1mn). At maturity of the swap, these notionals
are converted back to their original currency and then switched back.

3
Given the PV, it is relatively simple to find the spread adjustment:
PN2 rj dcfj PN1
− i=1 Qi pi dcfi
j=1 Qj
k=1 (1+β k ) k=1 (1+αk ) P V /N
S= PN1 dcf
= PN1
Qi i Qi dcfi
i=1 k=1 (1+αk )
i=1 k=1 (1+αk )

20
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm

Figure 4.3: Cross Currency Basis Swap

Let us start pricing these models through an example - that of a €1mn EUR/USD 1y semi-
semi non-MTM with a fixing rate of 1.3, i.e. €1 = $1.3. We have the following cash flows:

(i) Pay €1mn and receive $1.3mn (to/from counterparty),

(ii) Pay (x1 + Z)% on $1.3mn, receive y1 % on €1mn,

(iii) Pay (x2 + Z)% on $1.3mn, receive y2 % on €1mn,

(iv) Pay $1.3mn and receive €1mn

Breaking this swap into parts (i), (ii)-(iii), (iv):

i - PV of Initial Notional Exchange


P V = F0 N k 0 − N l 0
Where N is our notional amount, ki is the discount rate on a USD cash flow, li is the discount
rate on a EUR cash flow and F0 is the initial fixing rate.

ii-iii - PV of Basis Section


2
X 2
X
P V = N F0 (xi + Z)dcf($)i ki − N yj dcf(€)j lj
i=1 j=1

iv - PV of Final Currency Swap


P V = f0 N l2 − N F0 k2
So then we can add all of these to get the PV of a cross currency basis swap:

N1
X N2
X
P V = (F0 N k0 − N l0 ) + N F0 (xi + Z)dcf($)i ki − N yj dcf(€)j lj + f0 N lN2 − N F0 kN1
i=1 j=1

21
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm

It is important to note that this is from the perspective of the payer of the spread. We can
find the mid-market spread value such that the swap has 0 PV:

j=1 yj dcf(€)j lj − F0
F 0 k0 − N l 0 + N i=1 xi dcf($)i ki + f0 lN2 − F0 kN1
P 2 PN1
Z=
F0 i=1 dcf($)i ki
PN1

I will not be looking at these in much detail but there is another important type of swap -
the mark-to-market XCBS. Pricing these is very similar to above, however we use that currencies
change in value respective to one another, for example today $1 might be £0.95 and could be
£0.9 tomorrow.

P V = N F0 k0 − N l0
N1
X N2
X
+ N fj−1 (xi + Z)dcf($)i ki − N F0 yj dcf(€)j lj
i=1 j=1
N1
X
+N (fj−1 − fj )dcf($)i ki
i=1
+ N fN1 kN1 − N F0 lN2

As an exercise, send me the formula for the mid market rate of this swap!

22
5 An Introduction to Swaptions
5.1 What is a Swaption?
5.1.1 Definition of a Swaption
A swaption is an option to enter a determined leg of an IRS at a specified rate (called the strike
rate) at expiry.
An example of a swaption is a ’GBP $1mn 6m 2y receiver 4%’, i.e the option to receive fixed
and pay floating on a 2y GB rate swap if, in 6 months, the rate is below 4% (think of this as
receiver is a put and payer is a call).

5.1.2 Swaption Payoffs


Payer Swaption
A payer swaption is the right to enter into the payer side of a swap at a specified rate, called
the strike rate. The payoff increases linearly with swap rate (if the swap rate is greater than the
strike rate, in which case the payoff is 0).

Receiver Swaption
A receiver swaption is the right to enter into the receiver side of a swap at a strike rate. The
option can be exercised if the strike rate is greater than the swap rate, with payoff increasing
linearly as swap rate decreases towards 0 when strike rate equals swap rate.

Straddle
Akin to vanilla equity options, a swaption straddle is simply a combination of a receiver and a
payer swaption with the same strike rate and maturity. Similar to vanilla options, our payoff is
0 when swap rate equals strike rate, but increases with deviation from strike rate.

23
6 Swaption Pricing Theory
During the rest of this document, I will be using ideas from vanilla equity option pricing the-
ory to help gain intuition behind how different factors affect the price of a swaption. Arguably,
the biggest factor in option pricing is volatility. Volatility is simply a measure of how much an
underlying asset moves over a period of time; it is a quantification of uncertainty. In swaption
pricing, this is no different. As volatility increases, so too does the probability that our swap
rate is where we want it to be.

A common mistake is thinking that an increase in volatility also increases the chance that our
swap rate is not where we want it to be and thus the swaption should be cheaper. This is false
thinking; options have a one-sided payoff structure and thus we do not care about how far the
swap rate goes away from us.

To put it further into context, imagine I have bought a 100 strike call on company XYZ, maturing
in 1 year, and XYZ is currently trading at 110. At the time of purchase, implied volatility was
at 20%, meaning that typically XYZ moves up or down 20% over a year. If by the end of the
year, XYZ does fall 20% to 88, my payoff from the option will be 0. If instead it fell to 20, my
payoff is still 0.

6.1 A Brief Aside - Option Intuition Advice


A useful bit of advice that I learnt during my internship was that when dealing with options and
trying to understand the intuition behind almost anything, the best place to start is with the
payoff structure. As an example, we can informally derive characteristics about the delta of a
vanilla option through looking at the payoff and how that changes when our underlying moves
around key points:

To intuit what the delta of an extremely deep ITM vanilla call option is, we start off with
the payoff. Deeply ITM tells us that our strike is significantly below the underlying, i.e our pay-
off is max (S − K, 0), K << S where S is the underlying price and K is the strike. Clearly, if
we are super deep ITM, our payoff will approach the underlying S. The delta is then simply the
rate of change of our payoff with respect to the underlying1 . It is hopefully clear that ∂S∂
S=1
and therefore the delta of a deep ITM call is 1.

Now to intuit the delta of an ATM call option, we can do a similar trick. The payoff of an
ATM call is max(S − S0 , 0) where S0 is the strike when the option is bought. If the underlying
moves up by 1, our payoff is 1 and if it moves down by 1, our payoff is 0. As a rough assumption,
let us further assume that the probability a stock moves up equals the probability it moves down.
1
It is important to note that delta is actually the rate of change of the price with respect to the underlying,
but we can use payoff as a proxy

24
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm

Then, our expected change in payoff will be 12 × 1 + 12 × 0 = 21 . Then we have found that the
delta of an ATM vanilla call is 0.5.
I will leave it up to you to find and intuit the delta of a far OTM option (when K >> S).

6.2 Back to Swaption Pricing


Different to equity options, our implied volatility is measured in bps, or basis points. These are
one one hundredth of a percentage point. As I mentioned before, implied volatility affects prices
positively, and implied volatility increases with maturity2

6.2.1 Binary Pricing Model


This is the simplest model used to price options, and is perhaps best used in illustrative examples.
In short, the binomial asset pricing model assumes that the underlying swap rate only moves up
or down by a fixed amount. In the example below, I have drawn a diagram of an example of
the model. We start off by determining the initial rate, say 2.50. Then, over each time interval

Figure 6.1: Two-Period Binomial Asset Pricing Model

(could be a day, hour, month), there is a 50% chance that the rate moves up by 10bps and the
same chance it moves down 10bps. I won’t be using this model much, but it is certainly a useful
model to look at.
2
Try to think as to why this is!

25
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm

6.2.2 Pricing European Swaptions


European swaptions are simply swaptions that give the right to buy into a swap at, and only at,
maturity.
The present value of a payer swaption is:

N e−rτ (SΦ(d1 ) − KΦ(d2 ))


Where:

(i) N is the notional amount,

(ii) S is the forward swap rate,

(iii) K is the strike rate,


σ2
(iv) d1 = 1

σ τ
S
(ln( K ) + 2
τ ),

(v) d2 = d1 − σ τ ,
Rx
(vi) Φ(x) := √12π −∞ e−t /2 dt,
2

(vii) r is some discounting rate,

(viii) τ is the maturity of the swaption

26
7 Swaption Greeks
7.1 Delta
7.1.1 Swaption Delta Derivation
This derivation can definitely be skipped, it does not give any intuition behind delta but instead
focuses on deriving the formula. The delta of a swaption is the change in price with respect to
a 1bps change in the floating rate. Formalising, it is:

∆ = ∂S N e−rτ (SΦ(d1 ) − KΦ(d2 ))


We will start the derivation by calculating ∂S Φ(d1 ).
Z d1
1 2 1 2
∂S Φ(d1 ) = √ ∂S e−t /2 dt = √ e−d1 /2 ∂S d1
2π −∞ 2π
And with
1 S σ2 1 1
∂S d1 = ∂S ( √ (ln( ) + τ )) = √
σ τ K 2 σ τS
So then, letting ϕ(x) = Φ′ (x), i.e. the normal pdf, one has that
1
∂S Φ(d1 ) = ϕ(d1 ) √
Sσ τ

Noting that Φ(d2 ) = Φ(d1 − σ τ ), and by the chain rule, we have:
√ 1
∂S Φ(d2 ) = ϕ(d2 )∂S (d1 − σ τ ) = ϕ(d2 ) √
Sσ τ
Noting that by the product rule, delta is:

∆ = N e−rτ (S∂S Φ(d1 ) + Φ(d1 ) + K∂S Φ(d2 ))


Noting that
1 2 √ 2 S 2 √ √ 2
ϕ(d2 ) = √ e−(d1 −2d1 σ τ +σ τ )/2 = ϕ(d1 )e(ln( K )−σ τ /2)/σ τ )×σ τ +σ τ /2

Which then shows
S
ϕ(d2 ) = ϕ(d1 )
K
So finally,

1 1 1 S
N e−rτ (Φ(d1 )+ √ Sϕ(d1 )− √ Kϕ(d2 )) = N e−rτ (Φ(d1 )+ √ (Sϕ(d1 )−K ϕ(d1 )) = N e−rτ Φ(d1 )
Sσ τ Sσ τ Sσ τ K

27
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm

This is probably recognisable from the delta of a vanilla equity option is Φ(d1 ).
The delta of a receiver swaption is simply N e−rτ (Φ(d1 ) − 1)

7.1.2 Delta Structure of Payer Swaption


It is a useful exercise to try to think about the delta structure as strike varies for a swaption,
however I will include Python code here and in a Jupyter notebook so that you can play around
and investigate for yourself.
Summarising the previous chapter, we found that the delta of a payer swaption is

∆ = N e−rτ Φ(d1 )

66 import numpy as np
67 import matplotlib . pyplot as plt
68 from scipy . stats import norm
69
70 def payerDelta ( notional , swapRate , strike , volatility , maturity ,
discountingRate ) :
71 d1 = (1 / ( volatility * np . sqrt ( maturity ) ) ) * ( np . log ( swapRate / strike ) +
0.5 * volatility * * 2 * maturity )
72 n1 = norm . cdf ( d1 , 0 , 1)
73 delta = notional * n1 * np . exp ( - discountingRate * maturity )
74 return delta
75
76 def plot _ deltaVSstrike ( notional , swapRate , strike , volatility , maturity ,
discountingRate ) :
77 k = np . linspace (0.8 * strike , 1.2 * strike , 1000)
78 plt . figure ( figsize = (12 ,6) )
79 plt . plot (k , payerDelta ( notional , swapRate , k , volatility , maturity ,
discountingRate ) )
80 plt . title ( ’ Delta - Strike Relationship ’)
81 plt . xlabel ( ’ Strike Rate ’)
82 plt . ylabel ( ’ Swaption Delta ’)
83 plt . show ()
84
85 plot _ deltaVSstrike (1 , 0.05 , 0.05 , 0.02 , 1 , 0.05)
Running this yields the following output:
So we can see that in 7.1 the delta is 1 for a deep ITM payer swaption, 0.5 for an ATM payer
swaption and 0 for a far OTM payer swaption (exactly the same as an equity option).

7.1.3 Delta Hedging a Swaption


Say we have bought a swaption, the $1mn 1y*5y payer struck ATM has a delta of $1000. If the
1yf 5y rate rises by 1bp, our swaption appreciates by $1000 and the inverse happens. Now say I
want to have zero exposure to the underlying swap and instead want to profit from volatility. I
can do this by buying the underlying swap in a size large enough such that my DV01 equals my
delta. For instance let the $1mn 5y payer have a DV01 of $4000. Then I delta hedge by selling
$0.25mn 5y payer (or equally buying a $0.25mn 5y receiver)

28
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm

Figure 7.1: Delta vs Strike Rate for a Payer Swaption

7.2 Gamma
7.2.1 Swaption Gamma Derivation
Recall the delta of a payer swaption:

∆ = N e−rτ Φ(d1 )
Gamma, or Γ is the rate of change of delta with respect to the swap rate. So, we want to
compute:

Γ = N e−rτ ∂S Φ(d1 ) = N e−rτ ϕ(d1 )∂S d1


We have already computed the majority of this:

N e−rτ ϕ(d1 )
Γ= √
Sσ τ
Now let us theorise about what the gamma-strike relationship looks like. I can (very very
roughly) guess, by looking at the delta-strike graph and knowing that gamma is going to be the
gradient of the curve, that gamma is 0 when we are far away from the current swap rate, and
high when close to the swap rate.

7.2.2 Swaption Gamma Python Code


Building code to plot gamma is not hard at all, it is simply a modification of our delta code:
86 import numpy as np
87 import matplotlib . pyplot as plt
88 from scipy . stats import norm
89
90 def payerGamma ( notional , swapRate , strike , volatility , maturity ,
discountingRate ) :
91 d1 = (1 / ( volatility * np . sqrt ( maturity ) ) ) * ( np . log ( swapRate / strike ) +
0.5 * volatility * * 2 * maturity )

29
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm

92 n1 = norm . pdf ( d1 )
93 gamma = notional * np . exp ( - discountingRate * maturity ) * n1 / ( swapRate *
volatility * np . sqrt ( maturity ) )
94 return 0.0001 * gamma
95
96 def plot _ gammaVSstrike ( notional , swapRate , strike , volatility , maturity ,
discountingRate ) :
97 k = np . linspace (0.8 * strike , 1.2 * strike , 1000)
98 plt . figure ( figsize = (12 ,6) )
99 plt . plot (k , payerGamma ( notional , swapRate , k , volatility , maturity ,
discountingRate ) )
100 plt . title ( ’ Gamma - Strike Relationship ’)
101 plt . xlabel ( ’ Strike Rate ’)
102 plt . ylabel ( ’ Swaption Gamma ’)
103 plt . show ()
104
105 plot _ gammaVSstrike (1 , 0.05 , 0.05 , 0.02 , 1 , 0.05)
Running the above code yields the following graph:

Figure 7.2: Gamma vs Strike Rate for a Payer Swaption

So now we can see that our hypothesis generated from the delta graph was correct. Although
it might not seem it due to its second order nature, gamma is one of the most vital greeks,
especially when trading volatility through dynamic swaption hedging.

7.3 Vega
7.3.1 Swaption Vega Derivation
Vega is the rate of change of the swaption price with respect to a change in volatility. Mathe-
matically, we are finding:

ϑ = N e−rτ (S∂σ Φ(d1 ) − K∂σ Φ(d2 ))


Let’s start by working with ∂σ Φ(d1 ) and then build up from there.

30
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm

S
ln( K ) + σ 2 τ /2
∂σ Φ(d1 ) = ϕ(d1 )∂σ d1 = ϕ(d1 )∂σ ( √ )
σ τ
Using the quotient rule yields:
√ S √ S
σ τ στ − (ln( K ) + σ 2 τ /2) τ σ 2 τ − (ln( K ) + σ 2 τ /2)
∂σ Φ(d1 ) = ϕ(d1 ) = ϕ(d 1 ) √
σ2τ σ2 τ
Which is then
S
σ 2 τ /2 − ln( K )
∂σ Φ(d1 ) = ϕ(d1 ) √
σ2 τ
Now we should probably find ∂σ Φ(d2 ) in terms of its d1 -analogue.

∂σ Φ(d2 ) = ϕ(d2 )∂σ d2 = ϕ(d2 )∂σ (d1 − σ τ )

√ √
ϕ(d2 )∂σ (d1 − σ τ ) = ϕ(d2 )∂σ d1 − τ ϕ(d2 )
So plugging this in,

ϑ = N e−rτ (Sϕ(d1 )∂σ d1 − Kϕ(d2 )∂σ d1 + K τ ϕ(d2 ))
Recall ϕ(d2 ) = S
K
ϕ(d1 ), we end up with the following formula for vega:
√ √
ϑ = N e−rτ ϕ(d1 )(S∂σ d1 − S∂σ d2 + τ S) = N e−rτ Sϕ(d1 ) τ

7.3.2 Swaption Vega Python Code


Once again, pricing vega is a relatively simple task in Python and we just have to modify our
other functions 1 :
106 def payerVega ( notional , swapRate , strike , volatility , maturity ,
discountingRate ) :
107 d1 = (1 / ( volatility * np . sqrt ( maturity ) ) ) * ( np . log ( swapRate / strike ) +
0.5 * volatility * * 2 * maturity )
108 n1 = norm . pdf ( d1 )
109 vega = notional * np . exp ( - discountingRate * maturity ) * n1 * swapRate * np .
sqrt ( maturity )
110 return 0.01 * vega
111
112 def plot _ vegaVSstrike ( notional , swapRate , strike , volatility , maturity ,
discountingRate ) :
113 k = np . linspace (0.8 * strike , 1.2 * strike , 1000)
114 plt . figure ( figsize = (12 ,6) )
115 plt . plot (k , payerVega ( notional , swapRate , k , volatility , maturity ,
discountingRate ) )
116 plt . title ( ’ Vega - Strike Relationship ’)
1
I have omitted the imported libraries as they are the same as previous

31
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm

117 plt . xlabel ( ’ Strike Rate ’)


118 plt . ylabel ( ’ Swaption Vega ’)
119 plt . show ()
120
121 plot _ vegaVSstrike (1 , 0.05 , 0.05 , 0.02 , 1 , 0.05)
Running this code will give the following graph:

Figure 7.3: Vega vs Strike Rate for a Payer Swaption

7.4 Theta
Theta is a measure of how much my swaption decreases in value as I get closer to maturity. It
is:

Θ = N ∂t e−rt (SΦ(d1 ) − KΦ(d2 ))


It is a simple but long derivation so I will leave it as an exercise for you (it is just differentiating
each term with respect to time and then adding them up in the correct order), using the previous
ideas from earlier derivations.
In short, you should arrive to

e−rT Sσ
Θ = −N √ ϕ(d1 ) + rN e−rt (SΦ(d1 ) − KΦ(d2 ))
2 t
Here is the Python code for theta:

7.4.1 Swaption Theta Python Code

122 def payerTheta ( notional , swapRate , strike , volatility , maturity ,


discountingRate ) :
123 d1 = (1 / ( volatility * np . sqrt ( maturity ) ) ) * ( np . log ( swapRate / strike ) +
0.5 * volatility * * 2 * maturity )
124 n1 = norm . pdf ( d1 )
125 N1 = norm . cdf ( d1 )

32
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm

126 N2 = norm . cdf ( d1 - volatility * np . sqrt ( maturity ) )


127 theta = - notional * np . exp ( - discountingRate * maturity ) * swapRate *
volatility / (2 * np . sqrt ( maturity ) ) + discountingRate * notional * np .
exp ( - discountingRate * maturity ) * ( swapRate * N1 - strike * N2 )
128 return theta / (360 * maturity )
129
130 def plot _ thetaVSstrike ( notional , swapRate , strike , volatility , maturity ,
discountingRate ) :
131 k = np . linspace (0.8 * strike , 1.2 * strike , 1000)
132 plt . figure ( figsize = (12 ,6) )
133 plt . plot (k , payerTheta ( notional , swapRate , k , volatility , maturity ,
discountingRate ) )
134 plt . title ( ’ Theta - Strike Relationship ’)
135 plt . xlabel ( ’ Strike Rate ’)
136 plt . ylabel ( ’ Swaption Theta ’)
137 plt . show ()
138
139 plot _ thetaVSstrike (1 , 0.05 , 0.05 , 0.02 , 1 , 0.05)
Plotting this graph shows us that theta is always negative when buying a payer swaption, with
time decay increasing in magnitude as we get closer to ATM, and then plateauing at OTM payer
swaptions.

33
8 Swaption Strategies
8.1 Directional Strategies
8.1.1 Outright Payers
Now all of this is good to know, but it is even better to actually be able to use it. Say that I
have a high conviction that the Fed have no idea as to how bad rates are and that there will be
a severe inflation surprise with the Fed needing to increase rates to 10% in the next 6 months,
and then rapidly cutting them back down to 2%. What I can do is buy a payer swaption on
FFOIS (the Federal Funds Overnight Index Swap Rate), more specifically the $100mn FFOIS
6mo 2y Payer struck ATM + some spread (say 200 bps). This would cost almost $11,000. If,
after 3mo, FFOIS increases to 8.5%, the swaption is worth $2,468,944. However, if the FFOIS
remains relatively stable, I will lose all $11,000.

8.1.2 Payer Spread


Now say that I think the Fed will still have to raise rates up, but this time no more than 6.5%.
I can buy intro a $100mn 6mo 6mo Payer (ATM, 6.5%). More specifically, this is buying one
swaption (the $100mn 6mo 6mo Payer struck ATM) and selling another one (the $100mn 6mo
6mo Payer struck at 6.5%). This strategy is very common in the world of equities and is called a
call spread. What a payer spread allows me to do is profit from a move upwards in the underlying
rate but only up to a certain level, but as I am capping my maximum profit, I receive premium
for selling the payer option.

8.2 Interest Rate Volatility Trading


Recall from vanilla equity options that I can buy a straddle (a call and a put with equivalent
maturities), delta hedge through buying/selling the underlying and then trade stock volatility.
We can do an equivalent strategy for interest rate volatility through buying swaption straddles.
For example, say that the XYZ rate is at 7% has volatility of 5% per year and that this is
an all time volatility high, and I believe that in 6 months, volatility will cool to the long term
average of 2%. In order to sell volatility, I sell both a payer and a receiver swaption on the same
underlying swap and then delta hedge through buying or selling the underlying swap.
Let us first price these swaptions in Python but first I will state the price and greeks of a
receiver swaption:

(i) Price: N e−rτ (KΦ(−d2 ) − SΦ(−d1 ))

(ii) Delta: −N e−rτ Φ(−d1 )


N e−rτ ϕ(d1 )
(iii) Gamma: √
Sσ τ

34
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm


(iv) Vega: N e−rτ S τ ϕ(d1 )
−rτ Sσϕ(d )
(v) Theta: − e √
2 τ
1
+ rPrice
In order to price our straddle, it is as simple as pricing the swaptions separately and then adding
them.
140 def swaptionPayerPrice ( notional , swapRate , strike , volatility , maturity
, discountingRate ) :
141 d1 = (1 / ( volatility * np . sqrt ( maturity ) ) ) * ( np . log ( swapRate / strike ) +
0.5 * volatility * * 2 * maturity )
142 N1 = norm . cdf ( d1 )
143 N2 = norm . cdf ( d1 - volatility * np . sqrt ( maturity ) )
144
145 price = notional * np . exp ( - discountingRate * maturity ) * ( swapRate * N1 -
strike * N2 )
146
147 return price
148
149 def swaptionReceiverPrice ( notional , swapRate , strike , volatility ,
maturity , discountingRate ) :
150 d1 = (1 / ( volatility * np . sqrt ( maturity ) ) ) * ( np . log ( swapRate / strike ) +
0.5 * volatility * * 2 * maturity )
151 N1 = norm . cdf ( - d1 )
152 N2 = norm . cdf ( - d1 + volatility * np . sqrt ( maturity ) )
153
154 price = notional * np . exp ( - discountingRate * maturity ) * ( - swapRate * N1 +
strike * N2 )
155
156 return price
157
158 def swaptionStraddlePrice ( notional , swapRate , strike , volatility ,
maturity , discountingRate ) :
159 payerPrice = swaptionPayerPrice ( notional , swapRate , strike ,
volatility , maturity , discountingRate )
160 receiverPrice = swaptionReceiverPrice ( notional , swapRate , strike ,
volatility , maturity , discountingRate )
161 price = payerPrice + receiverPrice
162
163 return price
Running ’swaptionStraddlePrice(1000000, 0.07, 0.07, 0.05, 0.5, 0.05)’ tells us the net price of
buying:

• $1mn 6mo 1y ATM Payer Swaption,

• $1mn 6mo 1y ATM Receiver Swaption

Costing around $2656. We will be selling these swaptions so we will receive a premium of
$2656. Remember, we aren’t trading the price, and that we want to trade volatility and thus we
have to delta hedge this position.

35
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm

Our delta will be the sum of each swaption delta. For the sake of being concise, here is a
function that will calculate the price of a swaption straddle and the associated greeks. Running
’swaptionStraddleInfo(1000000, 0.07, 0.07, 0.05, 1, 0.05)’ gives an output of:

Swaption Straddle Price: $2656.12

Delta: 18972.31

Gamma: 21678.12

Vega: 531.11

Theta: -8.88
Using the greeks to delta hedge, we can calculate our expected profit from cooling volatility
with:

Profit = 10000(σT − σ0 ) ∗ ϑ = 10000(0.05 − 0.02) × 531 = $159, 300


Where we multiply by 10000 to get the number of basis points in the change.

8.3 Modelling Swaption Trades with Python


8.3.1 Methodology
Let us combine what we have learnt in this chapter, together with the ’Synthesis Model’2.3,
to study the evolutions of swaptions trades over simulated rate paths. Our model will run as
follows:

(i) Simulate sample rate paths under the synthesis model,

(ii) Price different swaption trades under these assumptions,

(iii) Verify that the code has given the correct answer

8.3.2 Modelling Directional Swaption Trades with Python


We first start by stating our swaption conditions. Say we want to study a 1y maturity swaption,
with the current swap rate at 5% which is assumed to probably cool to 2% in the long-term. We
choose our reversion strength to be 0.11 which is on the extreme upper end of what some papers
suggest, as well as volatility being 25% over the year:
164 time = 1
165 intervals = 500
166 initialRate = 0.05
167 longTermRate = 0.02
168 kappa = 0.11
169 volatility = 0.25
170 discountingRate = 0.03

36
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm

171
172 dt = time / intervals
173 r = initialRate
174 rates = []
Next, we simulate the swap rate under the synthesis model:
175 for i in range ( intervals ) :
176 r0 = r
177 r += kappa * ( longTermRate - r0 ) * dt + volatility * np . sqrt ( r0 ) * ( np .
random . standard _ normal () - np . random . standard _ normal () ) / 100
178 rates . append ( r )
Then with this sample path, we simulate the price of the payer swaption:
179 strike = 0.055
180 prices = []
181
182 for i in range ( intervals ) :
183 price = swaptionPayerPrice (1000000 , rates [ i ] , strike , volatility ,
time - i * dt , discountingRate )
184 prices . append ( price )
And then finally we plot:
185 plt . figure ( figsize = (12 ,6) )
186 plt . plot ( prices )
187 plt . xlabel ( f ’ Time (1 = { dt } years ) ’)
188 plt . ylabel ( ’ Swaption Price ’)
189 plt . show ()
190
191 plt . figure ( figsize = (12 ,6) )
192 plt . plot ( rates , label = ’ Simulated Swap Rates ’)
193 plt . axhline ( strike , color = ’r ’ , label = ’ Strike ’)
194 plt . xlabel ( f ’ Time (1 = { dt } years ) ’)
195 plt . ylabel ( ’ Interest Rate ’)
196 plt . legend ()
197 plt . show ()
Running this as an example:
We can see that at expiry, our strike is far above the current swap rate and thus the swaptions
expire worthless.
I have included the code necessary for the next part in the attached Jupyter Notebook -
please let me know if there are any issues with it!

37
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm

Figure 8.1: Example Payer Swaption Price

Figure 8.2: Example Swap Rate Path

8.3.3 Modelling Swaption Straddle Prices with Python


Looking at the graphs, we can see that although at no point is the straddle worthless, the initial
cost is much higher.

38
Introduction to Interest Rates, Bonds, Swaps and Swaptions Bailey Arm

Figure 8.3: Simulated ATM Straddle Prices

Figure 8.4: Swap Rate Model Output

39

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy