Interest Rate Swap-Derivative Pricing in Python

In a previous post, we presented an example of Interest Rate Swap Pricing in Excel. In this post, we are going to provide an example of interest rate swap pricing in Python. We are going to use the USD Libor swap curve as at December 31 2018. Picture below shows the swap curve.

Interest Rate Swap-Derivative Pricing in Python

USD Swap Curve as at Dec 31, 2018. Source: Bloomberg

Recall that an interest rate swap (IRS) is a financial derivative instrument that involves an exchange of a fixed interest rate for a floating interest rate.  More specifically,

An interest rate swap’s (IRS’s) effective description is a derivative contract, agreed between two counterparties, which specifies the nature of an exchange of payments benchmarked against an interest rate index. The most common IRS is a fixed for floating swap, whereby one party will make payments to the other based on an initially agreed fixed rate of interest, to receive back payments based on a floating interest rate index. Each of these series of payments is termed a ‘leg’, so a typical IRS has both a fixed and a floating leg. The floating index is commonly an interbank offered rate (IBOR) of specific tenor in the appropriate currency of the IRS, for example LIBOR in USD, GBP, EURIBOR in EUR or STIBOR in SEK. To completely determine any IRS a number of parameters must be specified for each leg; the notional principal amount (or varying notional schedule), the start and end dates and date scheduling, the fixed rate, the chosen floating interest rate index tenor, and day count conventions for interest calculations. Read more

The valuation of an interest rate swap proceeds as follows,

  1. Construction of the zero-coupon curve
  2. Determination of the payment schedules
  3. Calculation of the net present value of future cash flows

The hypothetical interest rate swap is as follows,

Maturity: 10 years

Notional: 10 Million USD

Fixed rate: 2.5%

Floating rate:  Libor

Note that we utilize the deposit and swap rates only and ignore the futures prices in the bootstrapping process. The values of the fixed, floating legs and the interest rate swap are calculated using a Python program. We obtain the following result

Interest Rate Swap-Derivative Valuation in Python

Further questions

What's your question? Ask it in the discussion forum

Have an answer to the questions below? Post it here or in the forum

LATEST NEWSStocks decline on U.S. rate hike jitters, China CPI
Stocks decline on U.S. rate hike jitters, China CPI

Emerging market stocks fell for a third consecutive session on Thursday after U.S. data exacerbated concerns of larger interest rate hikes by the Federal Reserve, while a bigger-than-expected drop in China’s consumer price inflation also hurt sentiment. MSCI’s emerging markets equities index slid 0.7% after…

Stay up-to-date with the latest news - click here
LATEST NEWSMartin Currie Fund Beating 95% of Peers Prefers European Stocks
Martin Currie Fund Beating 95% of Peers Prefers European Stocks

A global stock fund from Franklin Templeton’s Martin Currie that’s beating 95% of peers is picking Europe over the US in a bet on cheap valuations.

Stay up-to-date with the latest news - click here
LATEST NEWSDrug developer QurAlis raises $88 mln in Sanofi-backed funding round
Drug developer QurAlis raises $88 mln in Sanofi-backed funding round

Drug developer QurAlis Corp said on Thursday it had raised $88 million in a funding round led by Dutch firm EQT Life Sciences and French drugmaker Sanofi’s venture capital arm, among others. The company did not reveal the valuation at which it raised the funding,…

Stay up-to-date with the latest news - click here
LATEST NEWSEuro zone bond yields in touching distance of multi-year highs, eyes on data
Euro zone bond yields in touching distance of multi-year highs, eyes on data

LONDON — Euro area government bond yields headed back towards multi-year highs on Thursday, as central bank commentary had investors bracing for interest rates to rise and stay there longer than previously expected. In a second day in Congress on Wednesday, Federal Reserve Chair Jerome…

Stay up-to-date with the latest news - click here
LATEST NEWSUK stocks slip as investors gauge prospects of U.S. rate hike
UK stocks slip as investors gauge prospects of U.S. rate hike

March 9 (Reuters) – London’s FTSE 100 fell on Thursday as investors braced for a likely faster and longer period of interest rate hikes from the U.S. Federal Reserve, with miners leading declines as metal prices dropped in the wake of a stronger dollar. The…

Stay up-to-date with the latest news - click here

5 Comments

Leave a Reply