Table of Contents

Class OvernightOvernightBasisSwapRateHelper

Namespace
NanoQL.Experimental
Assembly
NanoQL.dll

A rate helper for bootstrapping over overnight-overnight basis swaps.

[Experimental("NQL0001")]
public sealed class OvernightOvernightBasisSwapRateHelper : RelativeDateRateHelper, IBootstrapHelper
Inheritance
OvernightOvernightBasisSwapRateHelper
Implements
Inherited Members
Extension Methods

Remarks

The swap is assumed to pay the base index plus the basis and receive the other index. The helper can be used to bootstrap the forecast curve for either index; the other index must have an existing forecast curve.

An exogenous discount curve can be passed. If none is passed, the curve being bootstrapped is also used for discounting.

Both legs share the same schedule and payment lag, but their averaging methods can be configured independently. This allows, for instance, an arithmetically averaged Fed Funds leg to be matched against a compounded SOFR leg. Telescopic value dates are only applied to compounded legs. Arithmetically averaged legs retain their full value-date schedule so that they are priced exactly.

Passing NoFrequency as the payment frequency creates one coupon on each leg spanning the full swap tenor.

The helper builds its swap, on a nominal of 100, when it is constructed and when it is re-dated, so it reads the context's evaluation date then. Bound to the curve being built, its bootstrapped leg is rebuilt on the index cloned onto that curve, what QuantLib's relinked handle gives its coupons.

Constructors

OvernightOvernightBasisSwapRateHelper(double, Period, int, Calendar, BusinessDayConvention, bool, OvernightIndex, OvernightIndex, EvaluationContext, YieldTermStructure?, bool, int, Frequency, RateAveragingType, RateAveragingType, bool, DateGenerationRule)

Initializes a new instance of the OvernightOvernightBasisSwapRateHelper class.

public OvernightOvernightBasisSwapRateHelper(double basis, Period tenor, int settlementDays, Calendar calendar, BusinessDayConvention convention, bool endOfMonth, OvernightIndex baseIndex, OvernightIndex otherIndex, EvaluationContext context, YieldTermStructure? discountHandle = null, bool bootstrapBaseCurve = false, int paymentLag = 0, Frequency paymentFrequency = Frequency.Annual, RateAveragingType baseAveragingMethod = RateAveragingType.Compound, RateAveragingType otherAveragingMethod = RateAveragingType.Compound, bool telescopicValueDates = false, DateGenerationRule rule = DateGenerationRule.Backward)

Parameters

basis double

The quoted basis, added to the base index.

tenor Period

The swap's maturity, from the settlement date.

settlementDays int

The settlement days, counted from the evaluation date on the calendar.

calendar Calendar

The calendar of the settlement and the schedule.

convention BusinessDayConvention

The schedule's business-day convention.

endOfMonth bool

Whether the schedule follows the end-of-month rule.

baseIndex OvernightIndex

The index of the leg that pays the basis.

otherIndex OvernightIndex

The index of the other leg.

context EvaluationContext

The evaluation context, read when the swap is built.

discountHandle YieldTermStructure

The exogenous discount curve; the curve being bootstrapped when null.

bootstrapBaseCurve bool

Whether the base index's forecast curve is bootstrapped, rather than the other index's.

paymentLag int

The payment lag of both legs, in business days.

paymentFrequency Frequency

The legs' payment frequency.

baseAveragingMethod RateAveragingType

The base leg's averaging method.

otherAveragingMethod RateAveragingType

The other leg's averaging method.

telescopicValueDates bool

Whether the compounded legs use telescopic value dates.

rule DateGenerationRule

The schedule's date-generation rule.

Exceptions

ArgumentNullException

An index, the calendar or the context is null.

ArgumentOutOfRangeException

settlementDays is negative, or an enum argument isn't a member of its enum or a frequency a period has.

ArgumentException

The swap can't be built from the arguments.

Properties

Swap

Gets the swap the helper prices: QuantLib's swap(), the base leg first.

public Swap Swap { get; }

Property Value

Swap

Methods

ImpliedQuote(EvaluationContext)

The quote implied by the term structure the helper is bound to.

public override double ImpliedQuote(EvaluationContext context)

Parameters

context EvaluationContext

The evaluation context.

Returns

double

The implied quote.

Exceptions

ArgumentNullException

context is null.

NanoQLException

The helper isn't bound to a term structure.

NanoQLException

The swap's results aren't available.

InitializeDates(EvaluationContext)

Computes the helper's dates for an evaluation date: QuantLib's initializeDates(). A helper whose dates follow the evaluation date overrides it and calls it from its constructor; the bootstraps call it on a fresh copy to re-date the helper for a curve built under another evaluation date. The base does nothing.

protected override void InitializeDates(EvaluationContext context)

Parameters

context EvaluationContext

The evaluation context whose evaluation date the dates are computed from.

WithTermStructure(YieldTermStructure)

A copy of the helper bound to a term structure: QuantLib's setTermStructure. A derived helper that prices against the term structure overrides it, calls the base, and rebuilds on the copy what prices against it.

protected override BootstrapHelper<YieldTermStructure> WithTermStructure(YieldTermStructure t)

Parameters

t YieldTermStructure

The term structure.

Returns

BootstrapHelper<YieldTermStructure>

The copy, of the receiver's runtime type; the receiver is unchanged.

Exceptions

ArgumentNullException

t is null.