Skip to content
All library documents

Why Floating-Leg Tenor May Not Change a Single-Curve Swap Curve

Article Quant Q&A · Author: N4v

Summary

The document investigates why changing a Euribor index tenor appears not to alter zero rates built from swap quotes in a QuantLib example. The explanation focuses on single-curve construction: the same curve is used both to estimate floating-leg forwards and to discount cash flows. In this setup, the floating-rate bond component of a vanilla swap is treated as being at par, so its payment frequency does not change the curve inference in the way the questioner expects.

With the same swap quotes and fixed-leg schedule, the two helper sets therefore construct the same curve under that framework. A second answer identifies a separate coding mistake: the displayed outputs under the second case still query the first curve object, so the example does not actually print the second curve’s rates. The discussion is limited to the stated single-curve setup; it does not address multi-curve discounting or provide a detailed treatment of conventions and instrument schedules.

Key ideas

  • In a single-curve framework, the curve provides both floating-rate forecasts and discount factors.
  • The floating leg can be viewed as a floating-rate bond whose value remains at par in that framework.
  • Keeping swap quotes and fixed-leg conventions the same can produce the same inferred curve despite changing the floating index tenor.
  • The example’s second set of print statements queries the first curve again, obscuring any comparison.

Tags

Full text
# Why doesn't tenor of Euribor index change spot rate in Quantlib?


# Why doesn't tenor of Euribor index change spot rate in Quantlib?












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))

```
```

## Answer by David Duarte (score 2)

https://quant.stackexchange.com/a/50446

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.

## Answer by QiQi (score 0)

https://quant.stackexchange.com/a/50869

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

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.