Infermath logo


Open source of math


Financial Markets in Python:
Fixed Income


The course consists of two modules: concept and valuation. The concept part is supposed to give basic understanding of market instruments. The valuation part is supposed to give further insight by looking at practical examples. The first asset class we will look at is fixed income.

Loans valuation

Download Python
Downloading and launching python and idle. Introduction to object oriented programming: class, constructor, object, attribute, methods. Loan valuation: present value, future value and discount factor.

Bonds concept

Bonds are debt instruments used by big institutions to borrow money. Among major debt issuers are governments, corporates and banks. Bonds pay interest in form of fixed coupon or discounted price. Bonds are characterised by yield - the return on initial investment. The better the credit of the borrower the higher the bond price and the lower the yield. As Financial Times would put it: the prices of bonds and interest rates are inversely related.

Zero concept

Zero coupon bonds are debt certificates with three main features. The issuer of the bond is the institution that borrows money. The maturity is the date when the money will be repaid. The notional is the amount to be repaid at maturity. Bonds are bearer securities which means that whoever owns them at the moment is the lender to the issuer. They can be traded at the market, where their price is established.

Zero bond valuation

Yield to maturity is an interest rate that reflects annual return on a current price of a bond if held to maturity. Yield quotatation is equivalent to price quotation and is useful to compare different bonds. In this video we are calculating yield-to-maturity of a zero coupoun bond based on price and vice versa. Python math library

Yield curve

In the video we are building yield curve using matplotlib in python. We also explain how to price bonds based on the yield curve. You can find the code I use in: GitHub