# Bank A and Bank B enter into a five-year plain vanilla, fixed for floating interest rate swap on today 12/01/2020

Project II

Bank A and Bank B enter into a five-year plain vanilla, fixed for floating interest rate swap on today 12/01/2020 on a notional amount of \$10 million. floating at three-month London Interbank Offered Rate (LIBOR). The market swap rate today is (see picture)

Once you decide the deal, please use HW 1 factor model to simulate 1000 path of interest term structure for LIBOR swap rates,  then plot the price distribution of the swap on 12/01/2021.

(Bonus: calibration is not required but could be bonus, you need to download the swaption data from Bloomberg)

Step 1:  Using the swap rates observed in the market to build the swap rate curve

Choice one: Using the excel do the bootstrapping manually to build the t0 swap rate curve

Choice two: Using Qunatlib tool to build the t0 swap rate curve

The t0 swap rate curve can be t0 discounting curve ( or spot rate curve) that will be used for late steps for discounting purpose

Step 2:  Since the NPV for the swap deal at the beginning must be zero. The floating leg NPV must be equal to the fixed leg NPV.  The float leg payment and cashflow will be dependent on the 3-Month forward rate indicated in the t0 swap rate curve (you should be able to calculate 3-M forward rate for every three months in the future).  The fixed leg cashflow will be unknow fixed coupon rate multiplied by notional every 6 month in the future.  Discounting the future cashflow back to t0 based on the t0 discounting curve. Then solve the equation (fixed leg NPV = floating leg NPV) to get the fixed leg defined coupon rate.

Step 3:  Using HW1 factor model to simulate the short rate move for one year path, you will get the t1  (year 1) short rate. Based on the t1 short rate, you can calculate the zero coupon price for any maturity zero coupon bond (with \$1 as face value) based on the formula in HW1 model, those prices can be translated into the spot rate for any tenor as if you are at t1. By doing that, you can essentially build the t1 spot rate curve, and you can also translate the spot rate curve into t1 discounting curve.  (this step can be done by Quantlib, refer to the blog or weblink below)

Step 4: at t1, the swap still have 4 years left until maturity. You need to calculate all the future cashflow from the floating leg and fixed leg  as if you are at t1 . (Again, the floating leg 3M forward rates for the rest of the 4 year will be indicated from the t1 spot rate curve). Discounting both leg’s future cashflow to the t1 based on the t1 discounting curve.  Net the NPV of two legs, you will get the swap price at t1.

Step5 :  repeat step 3, and step 4 with different HW1 factor short interest rate path, maybe 100 times, you will get the distribution of the swap price at t1.  Draw the distribution and find the most likely the price and 5% tail of the worse price.

http://mikejuniperhill.blogspot.com/2018/12/quantlib-python-term-structure.html

http://gouthamanbalaraman.com/blog/hull-white-simulation-quantlib-python.html

https://clinthoward.github.io/portfolio/2017/08/19/Rates-Simulations/