Documentation

Concepts

The NitroX multi-curve model, its vocabulary, and how a set of conventions and quotes becomes a global curve set.

This chapter describes the model before the API. NitroX builds multi-curve sets in a way that differs from the textbook construction used by QuantLib and most systems, and the difference has a measurable effect on forwards. Read this before comparing numbers with another library.

Vocabulary

Class names follow a small vocabulary. Once it is familiar, the API reads directly.

TermClassesMeaning
ParamNxIndexParamStatic conventions of one index: currency, name, holiday calendars, spot rule ("2USD"), roll rule, floating day count, and the fixed-leg conventions, which switch from a short set to a long set at ShortLimit days. No market data. See Conventions.
DataNxOisData, NxIborDataThe market quotes for one index, attached to a Param: overnight rate or last fixing, deposit, FRA, futures, swap and basis quotes, turn-of-period jumps, central-bank dates, past fixings. Inflation has its own Data class, covered in Inflation.
ShapeNxOisShape, NxIborShape (base NxShape)A single-curve bootstrap of one Data: the shape of the curve before any funding or tenor-basis adjustment. A shape is a discount-factor curve; its zero rate is derived from its discount factor.
FundingNxDiscountLocThe discount curve of a currency: a shape plus a calibrated zero-rate spread. The spread is zero, or fitted to funding margins, or fitted to cross-currency basis swaps.
IndexNxOisIndex, NxIborIndex (base IndexLoc)A projection curve: a shape plus a calibrated spread, with every cash flow discounted on a funding curve. This is what produces forward fixings.
LocDiscountLoc, IndexLoc, CcyIndexesLocal: one curve, or one currency.
GlobDiscountGlob, IndexGlobGlobal: a container over currencies. NxIndexGlob is the object handed to pricers.
Diracinside a shapeA one-night jump in the discount factor, used for turn-of-year, quarter or month effects.

The containers sit on top of the curves:

  • NxCcyIndexes holds one currency: exactly one funding curve and any number of indexes, all of which must have been calibrated on that same funding curve.
  • NxIndexGlob holds one NxCcyIndexes per currency and answers DiscountFactor(date, ccy) and IndexRate(from, to, ccy, indexName, basis).

The pipeline

 conventions            quotes                     single-curve bootstrap
 NxIndexParam ───────►  NxOisData / NxIborData ──► NxOisShape / NxIborShape
 (calendars, spot,      (overnight, deposits,       one pillar per instrument,
  roll rule, bases,      FRAs, futures, swaps,      turn Diracs inside the fit,
  frequencies,           basis spreads, Diracs,     OIS: central-bank steps,
  ShortLimit)            step dates, fixings)       long end from IBOR
                                                           │
                                                           ▼
                                            NxDiscountLoc  (funding, one per currency)
                                            DF(t) = exp(-(z_shape(t) + s_fund(t)) * t)
                                            s_fund = 0, or fitted to funding margins,
                                            or fitted to cross-currency basis swaps
                                                           │
                           ┌───────────────────────────────┴──────────────┐
                           ▼                                              ▼
                  NxOisIndex                                     NxIborIndex
                  shape zero + zero spread s(T),                 shape forward zero + forward
                  fitted so OIS quotes reprice                   spread s(fixing), fitted so the
                  with discounting on funding                    fixing, FRAs and swaps reprice
                                                                 with discounting on funding
                           └───────────────────────┬──────────────────────┘
                                                   ▼
                                  NxCcyIndexes (1 funding + N indexes, one currency)
                                                   │
                                                   ▼
                                  NxIndexGlob (all currencies) ──► pricers

Each arrow is a constructor call, and every object is held by std::shared_ptr. An index keeps pointers to its shape and to its funding curve; nothing is copied. Curves walks through each step with code.

The shape

A shape is a single-curve bootstrap: every calibration instrument is valued as a par bond on the shape itself,

PV = DF(end) - DF(start) + K * sum_i( cov_i * DF(t_i) ) = 0

with K the quote. One pillar is placed per instrument, at its end date, and solved in maturity order.

  • An OIS shape (NxOisShape) is a discount curve anchored on the overnight rate and fitted to OIS quotes. Its first calibration instrument is the one-day deposit from the curve date at the overnight rate; the OIS tenors, OIS FRAs and custom-dated periods (how futures enter) follow. Its discount factor is therefore the one obtained by compounding overnight rates. Central-bank meeting steps and turn-of-period Diracs are applied inside the fit.
  • An IBOR shape (NxIborShape) is the same construction on deposits, FRAs, futures and IBOR swaps, anchored on a one-day deposit ("1D", or a synthetic one at the rate of the earliest-maturing deposit or FRA if none is given). The float leg is implicitly at par, so it is a single-curve IBOR curve, used for the shape of the IBOR term structure.

What ZcRate is

NxShape::ZcRate(start, end) is

ZcRate(start, end) = -log( DF(start, end) ) / t,   t = (end - start) / 365.25 days

It carries no convention of its own. It is the exact continuous log form of the shape’s discount factor, which is the overnight-compounded discount factor for an OIS shape. Continuous compounding on ACT/365.25 is the lossless way to carry such a curve, not a modelling choice: any discount factor can be written this way and recovered exactly. Interpolation (Hagan-West or the local modes) works on these zero rates, and every time fraction inside a shape is days / 365.25.

Shape plus spread: the multi-curve design

Indexes

A projection index is a shape plus a spread, calibrated so that the index reprices its own market instruments with discounting on the funding curve. The calibration instrument is a two-leg swap: a fixed leg at the quote and a floating leg whose coupons are the index’s own forwards, both discounted on funding. The spread is solved pillar by pillar until the par rate equals the quote.

The forward the index returns is defined as follows. For a period [T1, T2], with t1, t2 the ACT/365.25 times from the curve date:

  • OIS index. Let Z(t) = z_shape(t) + s(t) be the shape zero plus the calibrated zero-coupon spread (one spread pillar per OIS maturity). The forward is the simple rate the period compounds to, ( exp(Z(t2)·t2 − Z(t1)·t1) − 1 ) / tau(T1, T2), with tau the accrual fraction in the index’s floating day count: a ratio of the index’s own discount factors.
  • IBOR index. The forward is the shape’s forward zero over the period, ZcRate(T1, T2), plus the calibrated forward spread read at the fixing date T1 (one spread pillar per instrument, at its last fixing date).

For the IBOR index that number is then read as a simple rate in the index’s floating day count: it is not converted from continuous to simple compounding, and it is not a ratio of discount factors. For both indexes, if the caller asks for another day count, the rate is scaled by the ratio of the two accrual fractions. Periods that start before the curve date are handled from past fixings (OIS: compounded overnight fixings up to the curve date, then the forward; IBOR: the published fixing).

Because the spread is precisely what makes the index reprice its inputs, forwards are exact at the calibration tenors: every quoted OIS, FRA, future and swap reprices to the solver tolerance (see Accuracy).

How this differs from DF-ratio projection

The conventional multi-curve construction builds one projection curve per index and defines a forward as a ratio of its discount factors:

F(T1, T2) = ( P(T1) / P(T2) - 1 ) / tau(T1, T2)

OIS indexes use this construction (since December 2026): the forward is the ratio of the index’s discount factors, shape plus calibrated spread. With no funding margin the spread is zero and the index’s forwards are exactly its shape’s, day by day. The earlier definition, the continuous forward zero read as a simple rate, carried an error that depends on the period length (about +4 bp on one day, +3 bp on a quarter, ~0 on a year); next to futures quarters the spread absorbed it unevenly and produced a one-day spike after the last future.

IBOR indexes keep the shape + spread definition above. The two constructions agree wherever the index was calibrated, and differ away from the calibration tenors; no DF-ratio mode is available for IBOR. If your application requires DF-ratio IBOR forwards between calibration tenors, compute them from the discount factors yourself and be aware that they will not reprice the index’s own quotes in this model.

Practical consequences:

  • Quoted instruments reprice exactly on any curve built from them.
  • IBOR sub-period forwards (a 1M forward inside a 6M IBOR period) differ from what a DF-ratio library computes from the same quotes. OIS forwards are DF-ratio forwards.
  • Comparisons with another library are meaningful on par rates at the quoted tenors and on discount factors at the pillar dates. Do not use sub-period forwards to judge whether a build is correct.

Funding curves

A funding curve (NxDiscountLoc) is a shape plus a zero-rate spread s(T):

DF_fund(T) = exp( -( z_shape(T) + s(T) ) * T ),   T in ACT/365.25 years

The spread is linearly interpolated between pillars, flat before the first and flat-forward after the last. It is calibrated in one of three ways:

  1. No spread. NxDiscountLoc(shape) discounts on the shape itself. An OIS shape used this way gives OIS discounting.
  2. Funding margins. For each funding tenor, a par bond is set up from spot (from the curve date for "1D") with the frequency and day count you give. Its target coupon is the shape’s own par coupon plus the margin. The spread pillar at the bond’s maturity is solved so that the funding curve prices the bond at that coupon. A margin is therefore a spread on a par coupon, not on a zero rate.
  3. Cross-currency basis. The funding curve of currency C is fitted to cross-currency basis swaps against a reference currency whose index is already built. For each tenor, the C leg is represented by a fixed coupon equal to the par rate of the C index shape plus the quoted basis, with notional exchange, and is valued on the curve being built. The reference leg pays the reference index plus that currency’s own funding margin (interpolated from the margins you pass), with notional exchange, and is valued with the reference index’s forwards and its funding curve. The spread pillar is solved so that, per unit notional, the two legs have the same value.

There is one funding curve per currency. NxCcyIndexes::AddIndexLoc refuses an index calibrated on a different funding object (identified by pointer, not by value) from the one the container already holds.

Indexes are discounted on funding

An index does not discount on its own shape. IndexLoc::DiscountFactor delegates to the funding curve it was built on, and the index spread is calibrated with that discounting. Changing the funding curve changes the index: build the funding curve first, then the indexes on it. An IBOR index may use either an IBOR shape or the OIS shape of the same currency as its shape; the forward spread absorbs the difference in level, and the choice of shape only affects how forwards are distributed between calibration tenors.

Tenor basis enters in two ways. The forward spread of each IBOR index is fitted to that index’s own instruments, so two IBOR indexes on one shape carry different spreads. An index can also be quoted as basis spreads over another index, in which case the library turns those spreads into synthetic swap quotes (see Curves).

What a curve set answers

double df  = glob->DiscountFactor(payDate, "EUR");                  // funding DF from the curve date
double fwd = glob->IndexRate(start, end, "EUR", "EURIBOR6", "MM");  // simple rate, ACT/360
  • Discount factors come from the currency’s funding curve, measured from the curve date. DiscountFactor(toDate, fromDate) returns DF(fromDate) / DF(toDate), the value at toDate of one unit paid at fromDate.
  • Index rates come from the named index in the named currency, as a simple rate in the requested day count.
  • An IBOR index is named after its Param name with the fixing tenor in months appended ("EURIBOR" with a 6-month fixing becomes "EURIBOR6"). An OIS index takes the Param name unchanged ("ESTR", "SOFR").

Lookups by an unknown currency or index name throw. The library reports errors by throwing std::string; catch const std::string&.

From the library at v1.0.0 (ccaff0b). Edit this page on GitHub