Bootstrapping a Yield Curve from Three-Month Futures
Summary
The post asks how to build a yield curve from three-month interest-rate futures, using Euribor as an example, and whether cubic-spline interpolation is available in Python. It points to a reference on multi-curve bootstrapping and a worked Python reproduction as sources for the underlying theory and a fuller implementation.
A second answer sketches a simpler alternative: convert futures prices into implied rates, place those rates at their dates in a curve object, and supply a knot sequence for cubic-spline interpolation. It gives an illustrative set of market nodes and an interpolated rate, but the example is not a complete bootstrapping procedure. The answer also cautions that the resulting futures curve ignores convexity adjustments, which may matter when relating futures to swap markets.
Key ideas
- Three-month futures prices can be converted into implied rates to supply yield-curve nodes.
- Cubic-spline interpolation requires a knot sequence in the illustrated curve construction.
- A reference and a worked Python example are suggested for fuller bootstrapping details.
- The simplified futures curve omits convexity adjustments associated with the swaps market.
Tags
Full text
# QuantLib: How to bootstrap Yield Curve using 3M futures - Python
# QuantLib: How to bootstrap Yield Curve using 3M futures - Python
I need to bootstrap a yieldcurve with 3M futures, using a cubic spline if possible.
Using, for example 3M Euribor, how do I bootstrap the yield curve using python?
I have a vector of dates and a vector of future prices.
I found about the QuantLib library, and more specifically, the `ql.PiecewiseCubicZero`. However there is a big lack of documentation on how to use it, and even more, with futures.
Any help would be much appreciated!
## Answer by Luigi Ballabio (score 3)
https://quant.stackexchange.com/a/76752
The theory and a worked-out example are in Ametrano and Bianchetti, Everything You Always Wanted to Know About Multiple Interest Rate Curve Bootstrapping but Were Afraid to Ask.
Recently I reproduced their example in Python; you can read my code at https://www.implementingquantlib.com/2023/09/ametrano-bianchetti.html.
## Answer by Attack68 (score 2)
https://quant.stackexchange.com/a/76753
If you want a really easy answer, you can do the following:
- Convert your futures prices into rates e.g. $100 - price = rate$.
- Construct a `LineCurve` in `rateslib`:
```
from rateslib import *
curve = LineCurve(
nodes={
dt(2023, 9, 21): 3.92,
dt(2023, 12, 20): 4.01,
dt(2024, 3, 20): 3.96,
dt(2024, 6, 20): 3.83,
dt(2024, 9, 20): 3.62,
dt(2024, 12, 20): 3.42,
dt(2025, 3, 20): 3.25,
},
t=[
dt(2023, 9, 21), dt(2023, 9, 21), dt(2023, 9, 21), dt(2023, 9, 21),
dt(2023, 12, 20),
dt(2024, 3, 20),
dt(2024, 6, 20),
dt(2024, 9, 20),
dt(2024, 12, 20),
dt(2025, 3, 20), dt(2025, 3, 20), dt(2025, 3, 20), dt(2025, 3, 20),
]
)
curve.plot()
```
The `t` parameter is the knot sequence which is needed to instruct a cubic spline. You can read about this in the rateslib docs
The `curve` rate on 18th Jan 2024
```
>>> curve[dt(2024, 1, 18)]
4.008222134667067
```
The curve that is produced is a futures curves and it ignores convexity adjustments which are generally created by the presence of a swaps market.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.