Skip to content
All library documents

When to Link an Overnight Index to Its Discount Curve

Article Quant Q&A · Author: JonDoe

Summary

The document explains how to handle the curve handle when bootstrapping a discount curve from overnight indexed swap quotes in QuantLib. An overnight index can be created without a linked curve for this stage because the bootstrap helpers use it to obtain index conventions, such as the calendar and day-count rules.

After bootstrapping, a handle to the resulting curve can be supplied to the index when forecasting future fixings. The example concerns a Singapore overnight rate and illustrates a curve built from deposit and overnight swap helpers. It gives no output or independent validation of the sample code, so it does not establish that the chosen market data, conventions, or curve configuration are appropriate for a particular use.

Key ideas

  • Curve handles can be omitted from an overnight index during discount-curve bootstrapping.
  • Bootstrap helpers can use the index for its conventions without requiring a forecasting curve.
  • A bootstrapped curve can later be wrapped in a handle and passed to the index to forecast fixings.
  • The example demonstrates setup mechanics but does not validate its quotes or conventions.

Tags

Full text
# Set-Up OvernightIndex Quantlib


# Set-Up OvernightIndex Quantlib












somehow I am struggling on my old question concerning set-up an Overnight index in QuantLib (see question: Old Question). What I don't understand is how can I set-up the `curve_handle`:

```
index = OvernightIndex("EONIA", 0, EURCurrency(),
                       TARGET(), Actual360(), curve_handle)
```

I have a set of data for the Singapore Overnight Index Sonar. I don't know how to set-up now the `curve_handle` in my example below marked as xxxxx. I think I can leave it out as shown below. The code looks like the following:

```
import QuantLib as ql

todaysDate = ql.Date(10, ql.December, 2017)
ql.Settings.instance().evaluationDate = todaysDate

calendar = ql.Singapore()
dayCounter_Act365 = ql.Actual365()
settlement_days_sonar = 2

SGD_SONAT_OIS = ql.OvernightIndex("SONAR", settlement_days_sonar, ql.SGDCurrency(), calendar, dayCounter_Act365)

#--------------------------------------------------------------------
# Discounting curve
#--------------------------------------------------------------------

# setup DepositRateHelper for 0-1 days
helpers_disc = [ql.DepositRateHelper(ql.QuoteHandle(ql.SimpleQuote(rate/100)),
                                     ql.Period(1,ql.Days), fixingDays,
                                     calendar, ql.ModifiedFollowing, False, ql.Actual365())
            for rate, fixingDays in [(0.081, 0)]]

# Overnight Index Swap rate
# setup OISRateHelper for 1,2,3 weeks and 1 month
helpers_disc += [ql.OISRateHelper(settlement_days_sonar, ql.Period(*tenor),
                                  ql.QuoteHandle(ql.SimpleQuote(rate/100)), SGD_SONAT_OIS)
            for rate, tenor in [(0.0713, (1,ql.Weeks)), 
                                (0.0688, (2,ql.Weeks)),
                                (0.0663, (3,ql.Weeks))]]

# OIS quotes up to 30 years
# setup OISRateHelper from 1 months to 30 years
helpers_disc += [ql.OISRateHelper(settlement_days_sonar, ql.Period(*tenor),
                                 ql.QuoteHandle(ql.SimpleQuote(rate/100)), SGD_SONAT_OIS)
            for rate, tenor in [(0.0656, (1,ql.Months)), 
                                (0.0613  , (2,ql.Months)),
                                (0.06 , (3,ql.Months)),
                                (0.0563 , (4,ql.Months)),
                                (0.055  , (5,ql.Months)),
                                (0.0538 , (6,ql.Months)),
                                (0.3356 , (9,ql.Years)),
                                (0.3806 , (10,ql.Years)),
                                (0.4938 , (12,ql.Years)),
                                (0.6888 , (15,ql.Years)),
                                (0.965 , (20,ql.Years)),
                                (1.1081 , (25,ql.Years)),
                                (1.1831, (30,ql.Years))]]

sonar_curve = ql.PiecewiseLogCubicDiscount(date, helpers_disc, ql.Actual365())
sonar_curve.enableExtrapolation()
```

## Answer by Luigi Ballabio (score 4, accepted)

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

You can leave it out during the bootstrap of the curve. In that context, the index is only used to ask for its conventions.

Later, if you want to forecast index fixings, you can initialize a handle with the curve you bootstrapped and pass it to the index.

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.