Skip to content
All library documents

QuantLib Overnight Futures Fixings and Curve Bootstrapping

Article Quant Q&A · Author: Fiesteban

Summary

The document describes a QuantLib curve-building problem involving overnight index futures. Bootstrapping fails because a required historical fixing is missing; adding a fixing for a Mexican public holiday then triggers an invalid-fixing error. The example sets an evaluation date, creates an overnight index, supplies historical rates, constructs monthly futures helpers, and attempts to bootstrap a discount curve.

The error messages point to index calendar and fixing-date conventions as key parts of the problem: a date that the curve helper expects may not be a valid fixing date for the index. However, the document contains only the question and its code, with no answer or confirmed workaround. It therefore offers a useful troubleshooting scenario rather than a complete procedure. Readers should verify the index’s holiday calendar, fixing calendar, and futures accrual conventions, and check that helper inputs and quotes match the instrument being modeled before relying on the resulting curve.

Key ideas

  • Overnight futures curve bootstrapping can require historical index fixings for elapsed accrual dates.
  • A date required by a helper may be invalid as a fixing date under the index calendar.
  • Index calendars and fixing conventions should be checked before adding historical observations.
  • The example reports errors but does not provide a verified resolution.

Tags

Full text
# ql.OvernightIndexFutureRateHelper asking for a fixing, but not able to add it


# ql.OvernightIndexFutureRateHelper asking for a fixing, but not able to add it












I´m trying to make a Overnight Index FutureRateHelper but when bootstrapping, the following Error arises:

RuntimeError: 1st iteration: failed at 1st alive instrument, pillar May 31st, 2024, maturity May 31st, 2024, reference date May 9th, 2024: missing rate on May 1st, 2024 for index TIIE_OISTN Actual/360

```
import numpy as np
import QuantLib as ql
import calendar

ql.Settings.instance().evaluationDate = ql.Date(9,5,2024)
ibor_MXNTIIE_oi = ql.OvernightIndex('TIIE_OIS',
                                    1, 
                                    ql.MXNCurrency(), ql.Mexico(),
                                    ql.Actual360())

fixing_dates = ['30/04/2024', '02/05/2024', '03/05/2024',  
                        '06/05/2024','07/05/2024', '08/05/2024']

fixings = [11.07, 11.02, 11.05, 11.01, 11.00, 11.01]        

ibor_MXNTIIE_oi.clearFixings()

ibor_MXNTIIE_oi.addFixings([ql.Date(d, '%d/%m/%Y') for d in fixing_dates], 
                           (np.array(fixings)/100).tolist())

fwd_quotes = [88.94, 88.9801, 89.2003, 89.1606]
month_year = [(5, 2024), (6, 2024), (7, 2024), (8, 2024)]

helpers = []
for d, q in zip(month_year, fwd_quotes):
    
    priceQuote = ql.QuoteHandle(ql.SimpleQuote(88.94))
    month = d[0]
    year = d[1]
    last_day = calendar.monthrange(year, month)[-1]
    
    startDate = ql.Date(1, month, year)
    
    endDate = ql.Date(last_day, month, year)
                                 
    
    helpers.append(ql.OvernightIndexFutureRateHelper(
        priceQuote, startDate, endDate, ibor_MXNTIIE_oi))
    
    
crvTIIE = ql.PiecewiseNaturalLogCubicDiscount(0, ql.Mexico(), 
                                              helpers, 
                                              ql.Actual360())

fwd_rate = crvTIIE.forwardRate(ql.Date(9,5,2024), ql.Date(10,5,2024),
                               ql.Actual360(), ql.Simple).rate()
```

I tried ading the fixing for 1 of May of 2024, but this other error arises: RuntimeError: At least one invalid fixing provided: Wednesday May 1st, 2024, 0.1102

This is the code I used:

```

import numpy as np
import QuantLib as ql
import calendar

ql.Settings.instance().evaluationDate = ql.Date(9,5,2024)
ibor_MXNTIIE_oi = ql.OvernightIndex('TIIE_OIS',
                                    1, 
                                    ql.MXNCurrency(), ql.Mexico(),
                                    ql.Actual360())

fixing_dates = ['30/04/2024', '01/05/2024', '02/05/2024', '03/05/2024',  
                        '06/05/2024','07/05/2024', '08/05/2024']

fixings = [11.07, 11.07, 11.02, 11.05, 11.01, 11.00, 11.01]        

ibor_MXNTIIE_oi.clearFixings()

ibor_MXNTIIE_oi.addFixings([ql.Date(d, '%d/%m/%Y') for d in fixing_dates], 
                           (np.array(fixings)/100).tolist())

fwd_quotes = [88.94, 88.9801, 89.2003, 89.1606]
month_year = [(5, 2024), (6, 2024), (7, 2024), (8, 2024)]

helpers = []
for d, q in zip(month_year, fwd_quotes):
    
    priceQuote = ql.QuoteHandle(ql.SimpleQuote(88.94))
    month = d[0]
    year = d[1]
    last_day = calendar.monthrange(year, month)[-1]
    
    startDate = ql.Date(1, month, year)
    
    endDate = ql.Date(last_day, month, year)
                                 
    
    helpers.append(ql.OvernightIndexFutureRateHelper(
        priceQuote, startDate, endDate, ibor_MXNTIIE_oi))
    
    
crvTIIE = ql.PiecewiseNaturalLogCubicDiscount(0, ql.Mexico(), 
                                              helpers, 
                                              ql.Actual360())

fwd_rate = crvTIIE.forwardRate(ql.Date(9,5,2024), ql.Date(10,5,2024),
                               ql.Actual360(), ql.Simple).rate()
```

Can someone please explain or tell me how I can workaround this issue

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.