# 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.

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

## Further questions

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

Views
Question
115
views
781
views
394
views
LATEST NEWS
Block shares surge as much as 14% after company announces surprise profit

There was particularly strong growth in Block's payment platform, Cash App, and its point-of-sale suite, Square.

LATEST NEWS
Stephanie Kusie, Member of (Canadian) Parliament, Makes a Historic Trip to Miami to Meet Members of the Cuban Diaspora and Other Leaders Concerned About the Expansion of Totalitarian Governments

Visit included meetings with representatives of the Assembly of the Cuban Resistance and Florida Congresswoman Maria Elvira Salazar and a visit to honor the victims of the Cuban Communist dictatorship MIAMI — Member of Canadian Parliament Stephanie Kusie joined representatives of the Cuban, Nicaraguan and…

LATEST NEWS
Vice Media says ‘several hundred’ staff members will be laid off, Vice.com news site shuttered

NEW YORK (AP) — Vice Media plans to lay off several hundred employees and no longer publish material on its Vice.com website, the company’s CEO said in a memo to staff Thursday. Vice, which filed for bankruptcy last year before being sold for \$350 million…

LATEST NEWS
Reddit plans share sales to platform’s users as it moves ahead with IPO

Prospectus filing shows \$804mn in revenue and a \$91mn net loss in 2023