Table of Contents

Class ZeroCouponSwap

Namespace
NanoQL.Instruments
Assembly
NanoQL.dll

A zero-coupon interest-rate swap: at maturity a fixed amount N[(1 + R)^α(T₀, T_K) − 1], or a given one, is swapped for the floating amount N[∏(1 + α(T_k, T_{k+1}) L(T_k, T_{k+1})) − 1], the index's fixings compounded over its own periods.

public sealed class ZeroCouponSwap : Swap
Inheritance
ZeroCouponSwap
Inherited Members

Remarks

The legs carry one cash flow each, on unadjusted dates; only the payment date is adjusted, the payment delay's business days after maturity. The fixed leg is the first, the floating leg the second. An engine's results are a ZeroCouponSwapResults, whose fair payment DiscountingSwapEngine's overload gives at the fixed flow's payment date, where QuantLib's reads the discount at the fixed leg's maturity date, the accrual end for the fixed-rate constructor's coupon, so with a payment delay its fair payment fed back leaves a non-zero NPV.

Constructors

ZeroCouponSwap(SwapType, double, Date, Date, double, IborIndex, Calendar, BusinessDayConvention, int)

Initializes a new instance of the ZeroCouponSwap class paying a fixed amount.

public ZeroCouponSwap(SwapType type, double baseNominal, Date startDate, Date maturityDate, double fixedPayment, IborIndex iborIndex, Calendar paymentCalendar, BusinessDayConvention paymentConvention = BusinessDayConvention.Following, int paymentDelay = 0)

Parameters

type SwapType

Whether the fixed amount is paid (payer) or received.

baseNominal double

The nominal before compounding.

startDate Date

The start date.

maturityDate Date

The maturity date.

fixedPayment double

The fixed amount.

iborIndex IborIndex

The index compounded on the floating leg.

paymentCalendar Calendar

The calendar the payment date is adjusted on.

paymentConvention BusinessDayConvention

The payment date's convention.

paymentDelay int

The payment delay, in business days after maturity.

Exceptions

ArgumentNullException

The index or the calendar is null.

ArgumentOutOfRangeException

The type or the convention isn't a member of its enum, or the delay is negative.

ArgumentException

The base nominal is negative, or the start isn't before maturity, with QuantLib's texts.

ZeroCouponSwap(SwapType, double, Date, Date, double, DayCounter, IborIndex, Calendar, BusinessDayConvention, int)

Initializes a new instance of the ZeroCouponSwap class paying a fixed rate, compounded annually over the swap's term.

public ZeroCouponSwap(SwapType type, double baseNominal, Date startDate, Date maturityDate, double fixedRate, DayCounter fixedDayCounter, IborIndex iborIndex, Calendar paymentCalendar, BusinessDayConvention paymentConvention = BusinessDayConvention.Following, int paymentDelay = 0)

Parameters

type SwapType

Whether the fixed amount is paid (payer) or received.

baseNominal double

The nominal before compounding.

startDate Date

The start date.

maturityDate Date

The maturity date.

fixedRate double

The fixed rate.

fixedDayCounter DayCounter

The fixed rate's day counter.

iborIndex IborIndex

The index compounded on the floating leg.

paymentCalendar Calendar

The calendar the payment date is adjusted on.

paymentConvention BusinessDayConvention

The payment date's convention.

paymentDelay int

The payment delay, in business days after maturity.

Exceptions

ArgumentNullException

The day counter, the index or the calendar is null.

ArgumentOutOfRangeException

The type or the convention isn't a member of its enum, or the delay is negative.

ArgumentException

The base nominal is negative, or the start isn't before maturity, with QuantLib's texts.

Properties

BaseNominal

Gets the nominal before compounding.

public double BaseNominal { get; }

Property Value

double

FixedLeg

Gets the fixed leg.

public ImmutableArray<CashFlow> FixedLeg { get; }

Property Value

ImmutableArray<CashFlow>

FloatingLeg

Gets the floating leg.

public ImmutableArray<CashFlow> FloatingLeg { get; }

Property Value

ImmutableArray<CashFlow>

IborIndex

Gets the index compounded on the floating leg.

public IborIndex IborIndex { get; }

Property Value

IborIndex

PaymentDate

Gets the payment date of both amounts.

public Date PaymentDate { get; }

Property Value

Date

Type

Gets whether the fixed amount is paid (payer) or received.

public SwapType Type { get; }

Property Value

SwapType

Methods

FairFixedRate(ZeroCouponSwapResults, DayCounter)

The fixed rate, compounded annually over the swap's term on a day counter, that gives the swap a zero NPV: QuantLib's fairFixedRate, from the results' fair payment.

public double FairFixedRate(ZeroCouponSwapResults results, DayCounter dayCounter)

Parameters

results ZeroCouponSwapResults

The swap's results.

dayCounter DayCounter

The rate's day counter.

Returns

double

The rate.

Exceptions

ArgumentNullException

An argument is null.

NanoQLException

The results have no fair payment, QuantLib's "result not available".

FetchResults(InstrumentResults)

The swap's results, with the engine's fair payment when it gave one.

public override ZeroCouponSwapResults FetchResults(InstrumentResults results)

Parameters

results InstrumentResults

The engine's results.

Returns

ZeroCouponSwapResults

The results.

FixedPayment(EvaluationContext)

The fixed amount.

public double FixedPayment(EvaluationContext context)

Parameters

context EvaluationContext

The evaluation context.

Returns

double

The amount.

MaturityDate()

The maturity date.

public override Date MaturityDate()

Returns

Date

The date the swap was given.

SetupExpired()

The results of an expired instrument: a zero value and error estimate, and no valuation date.

public override ZeroCouponSwapResults SetupExpired()

Returns

ZeroCouponSwapResults

The expired results.

StartDate()

The start date.

public override Date StartDate()

Returns

Date

The date the swap was given.