4

Pricing Interest Rate Swaps

 1 year ago
source link: https://oneraynyday.github.io/math/2022/07/16/IRS/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Pricing Interest Rate Swaps

This is somewhat of a continuation on the portfolio risk, specifically focusing on interest rate swaps as an example of a complicated financial instrument which is hard to model risk for.

What is an Interest Rate Swap(IRS)?

Interest rate swaps, or IRS, are one of the most liquid financial instruments in the world. These swaps are issued over the counter(abbreviated as OTC, as opposed to posting your orders on an orderbook) between two parties and have the following properties:

  1. The interest rate swap is a contract which has a maturity date T and coupon payout dates U=u1,…,um≤T1.
  2. The buyer pays the seller a fixed interest rate every ui. We’ll denote this as S.
  3. The seller pays the buyer a floating interest rate over time, which changes every payout period. We’ll denote this as a function E:U→R which maps coupon payment periods to the expected floating interest rate payment for that period.
  4. The buyer and seller stops paying each other on the maturity date of the contract.
  5. The net present value(or NPV) is defined as the expected difference between the fixed interest rate payout and the floating interest rate payout, or in other words, how much the buyer is expected to make - “how much money the buyer should pay upfront to make the contract on par or zero expected value”

IRS’s are tricky because they don’t have a price - if you’re buying GOOG stocks on an exchange or through a broker, you’ll be quoted an asking price. Afterwards, you own the stock as an asset and depending on the type of stock, you may have some degree of voting power or stake in the company itself. Interest rate swaps are weird because you get none of the above - you simply enter a bilateral agreement with someone else, promising to pay each other interest rates until the contract’s maturity. The astute reader might be curious about the safety of trading such instruments - can’t someone rug pull on me and take a flight to Brazil and never pay me my interest rates if they enter an unfavorable position?

Fortunately, in the US we have a few central clearing houses which support OTC trades such as interest rate swaps, and their job is to protect both sides of the agreement in case either side can no longer support their side of the agreement. How does this work (in a nutshell)?

  1. Both sides consent to entering the trade, and notifies the clearing house. Both sides usually pay the clearing house administrative fees for the steps below.
  2. Each side posts some amount of money for the clearing house to hold. This is usually called the margin requirement, and is usually proportional to the size of your trades and how volatile the instrument is.
  3. In the US, the clearing houses will pay each party an overnight holding fee according to the SOFR(secure overnight funding rate) which should usually be positive. You can think of this as inflationary adjustments to the collateral for the trade.
  4. If a party loses money from the trade and their losses are covered by the margin, they will need to post more money to continue the trade or else they’ll get margin called. If the party cannot post more money, then their positions will be liquidated (the clearing house will try to close out all of your positions and take all the money to cover the losses).

Now that we know how IRS’s works and are protected by clearing houses, let’s see how we can price these contracts.

Par Rates and Pricing

Our objective here is to understand the dynamics of IRSes with each other and the underlying yield curve so we can price their NPV. To do this, let’s set up some definition:

Now, as mentioned above, the net present value of an existing IRS contract with a fixed rate S (which is usually not exactly the par rate) is:

V=∑iP(ui)[E(ui)−S]

A contract is at par if its net present value is zero. This means the fixed rate is the par rate:

m∑iP(ui)[E(ui)−S′]=0

For some S′. Here, E(ui) is the floating interest rate payment, and P(ui) is the present value discount rate applied to the interest rate payments in the future. Intuitively, the discount rate should be lower so we weigh recent payments more. P(ui) is usually modeled using the SOFR (secure overnight funding rate):

P(ui)=e−Z(ui)ui

and E(ui) is typically2 modeled as:

E(ui)=P(ui−1)P(ui)−1

when the coupon dates are in the future3.

Here, Z(t) is a function4. In my head, I think of it like the “inflation rate” of the US dollar when using SOFR, but the technical term is zero rate/yield of the yield curve. Z(t) typically increases over time, since US currency is inherently an inflationary asset. In addition, for practical purposes Z(t) has a positive bias to factor in the uncertainty when entering an IRS (as a result, we diminish the weights on future terms of E(ui)−S′ and we also price in the uncertainty, increasing E(ui)).

Typically, par rates S′ of multiple tenors is given to us, and we are given the following relationship:

S′=∑iP(ui)E(ui)∑iP(ui)

which (if we’re dealing with IRS on SOFR rates) is purely parametrized by Z(ui)i≤m. However, a single par rate S′ relates to Z(ui) for many i, so this equation is underdetermined and we can’t solve this.

To get around this, we first make the assumption that Z(ui) is a well behaved continuous function which we can fit a spline over. We then relax the constant-period coupon payment intervals {ui}i≤m for each individual contract we’re given to be the maturity times of each of the n contracts {ti}i≤n. Now we have the same number of unknowns, Z(ti), as the number of knowns, S′i. Although this system of equations is nonlinear we can still solve it with e.g. Newton’s method. Here’s what the system of equations look like (recall P and E are both functions of Z):

S′1=P(t1)E(t1)P(t1)S′2=P(t1)E(t1)+P(t2)E(t2)P(t1)+P(t2)S′3=P(t1)E(t1)+P(t2)E(t2)+P(t3)E(t3)P(t1)+P(t2)+P(t3)...

After we have these points Z(t1),…,Z(tn), we can fit a spline over these points (which can be as fancy as you’d like). We can use the spline to get us {Z(ui)}i≤m, and it should be zero for par-rate contracts.

IRS Dynamics

Now that we are equipped with some definitions, for n theoretical par-rate contracts with rates S′ii≤n, what happens to V as S′is change? Ideally, we’d like to perform an update to V of a fixed contract on a day-to-day basis: Vt+1≈Vt+∑i∂V∂S′i(S′i,t+1−S′i,t)

Unfortunately, as you can see from above, we don’t have an equation for V as a function of Si’s and it’s a bit hard to back out. Instead, recall ∂V∂Z(uk) and ∂Si∂Z(uk) are easy to get. Denote

∂V∂→Zm∈Rm

as the gradient with respect to all Z(uk)k≤m which are the coupon periods for the contract. Similarly, denote

J→S′(→Zn):=∂→S′∂→Zn∈Rn×n

which is the jacobian mapping from different par rates to the zero rate/yield of the yield curve at their expiries {ti}i≤n (hence the subscript on Zn to disambiguate which ones we’re talking about). If we had contracts {S′i}i≤m parametrized by Z(t) exactly on the coupon dates of the contract associated with V (so n=m, ui=ti∀i) then we can easily get the sensitivity of V with respect to these contracts:

∂V∂→S′=∂V∂→ZmJ−1→S′(→Zm)

This is also under the assumption that S is locally invertible (in practice this is almost always true due to the way Z is constructed). With this, we can recover the sensitivity measurements for V. However, it’s often the case that the set of {ti}i≤n do not match the coupon dates of the contract for V, {ui}i≤m.

Recall the coupon date rates Z(ui) are actually interpolated by the points Z(tj). This means Z(ui) changes as a function of Z(tj), and the tj’s closer to ui impact its change more. We can express this as another jacobian transform squeezed in between:

∂V∂→S′=∂V∂→ZmJ→Z′m(→Zn)J−1→S′(→Zn)

If we used linear splines, the jacobian J→Z′m(→Zn) is very sparse, and that may have computational & theoretical benefits for the purposes of risk modeling.

  1. Typically the fixed rate and the floating rate payment dates are the same, but there are instances of IRS’s where the floating rate is paid quarterly while the fixed rate is half year. We ignore them to make the problem statement simpler. 

  2. Typically we trade IRS’s with floating SOFR rates, but there are contracts with LIBOR (london interbank offered rates) around. If it’s LIBOR, then we would need to swap PSOFR(ui):=P(ui) with PLIBOR(ui), which is using Z from a different yield curve. 

  3. If we’re talking about in the past, we should be calculating the actual compounding rates on SOFR or LIBOR to see what the realized E(ui) is. To be precise, that is E(ui)=[ΠLk=1(1+dcf(tk−1,tk)SOFR(tk)]−1 where there are L days with SOFR rates between coupon dates ui−1 and ui and dcf is a function that gives us how many dates have passed, and SOFR gives us the rates for that date. If the previous coupon date is in the past but the next coupon date is in the future, we’d need to stitch up the past and future calculations: E(ui)=[[Πpresentk=1(1+dcf(tk−1,tk)SOFR(tk)]−1][1P(ui)−1]. The numerator of the second term should be P(present) which is 1 by definition of present value discount rate. 

  4. In the rates modeling world, this function P(t) is actually a nonstationary stochastic process and is parametrized by random variables r,ω and r is modeled by (potentially multiple) stochastic differential equations: P(t)=E(P(t,ω)), and we can back out Z(t) as a random process as well. However, that’s getting very deep in the weeds for my pea sized brain and for practical purposes we should consider it a function. 


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK