0
$\begingroup$

I'm trying to create a yield curve in QuantLib based on swap rates. The swap rates I'm using have a 6 months fixed frequency and a 3 month float frequency based on LIBOR.

What I don't understand is why changing the Euribor index doesn't seem to have an effect on the values of the spot rates derived from the yield curves. Please see below for a working example.

import xlwings as xw
import pandas as pd
import QuantLib as ql
from QuantLib import *
from IPython.display import display, HTML
import re
from pprint import pprint


calc_date = Date(22, May, 2019)
ql.Settings.instance().evaluationDate = calc_date

rates = [0.02437,0.0252475,0.025574,0.02457,0.022801,0.02202,0.021819,0.02188,0.022125,0.022375,0.022682,0.023005,0.023324,0.024505,0.025045,0.025275]
tenors = ['1M','3M','6M','1Y','2Y','3Y','4Y','5Y','6Y','7Y','8Y','9Y','10Y','15Y','20Y','30Y',]
tenors = [ (int(re.search(r'\d+', tenor).group()), Months if tenor[-1]=='M' else Years) for tenor in tenors ]

helpers1 = [
    SwapRateHelper(QuoteHandle(SimpleQuote(rate)),
                   Period(*tenor),
                   UnitedStates(),
                   Semiannual,
                   Unadjusted,
                   Thirty360(),
                   Euribor3M())
    for tenor, rate in zip(tenors, rates)
]

curve1 = PiecewiseFlatForward(0, UnitedStates(), helpers1, Actual360())

print('\nSpot rates from curve 1 based on 3M Euribor.')
print(curve1.zeroRate(1, Compounded))
print(curve1.zeroRate(Date(22, May, 2020), Actual360(), Compounded))
print(curve1.zeroRate(Date(22, May, 2020), Actual365Fixed(), Compounded))


helpers2 = [
    SwapRateHelper(QuoteHandle(SimpleQuote(rate)),
                   Period(*tenor),
                   UnitedStates(),
                   Semiannual,
                   Unadjusted,
                   Thirty360(),
                   Euribor11M())
    for tenor, rate in zip(tenors, rates)
]

curve2 = PiecewiseFlatForward(0, UnitedStates(), helpers2, Actual360())

print('\nSpot rates from curve 2 based on 11M Euribor.')
print(curve1.zeroRate(1, Compounded))
print(curve1.zeroRate(Date(22, May, 2020), Actual360(), Compounded))
print(curve1.zeroRate(Date(22, May, 2020), Actual365Fixed(), Compounded))

```
$\endgroup$

2 Answers 2

2
$\begingroup$

In a single curve framework, you can think of a vanilla swap as a short position in a floating rate bond and a long position in a fixed rate bond (the notionals cancel out and you have fixed vs floating interest payments).

Because you are using the same curve for both forward estimation and discounting, the frequency of the floating leg is irrelevant because that floating rate bond will always be at par.

Using the same rates with the same frequency of the fixed leg in both cases, you are essentially building the same curve, and therefore you are getting the same results.

$\endgroup$
0
$\begingroup$

They are different, because you print the curve1 again under curve2.

$\endgroup$
1
  • $\begingroup$ Although he did print the rates from curve1 again, the rates for curve2 would in fact be the same. Both curves are bootstrapped with the same par rates in a single curve framework $\endgroup$ Commented Jan 27, 2020 at 22:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.