Table of Contents

Class BMASwap

Namespace
NanoQL.Instruments
Assembly
NanoQL.dll

A swap paying Libor against BMA coupons.

public sealed class BMASwap : Swap
Inheritance
BMASwap
Inherited Members

Remarks

The type, payer or receiver, refers to the BMA leg. The Libor leg is the first leg, Ibor coupons geared by the Libor fraction with the Libor spread; the BMA leg is the second, average-BMA coupons. Each leg's payments follow its schedule's convention.

The constructor builds the Libor leg with the index's default pricer, which reads the context's at-par switch, so it takes the context. It refuses a type that isn't a member of SwapType on entry, before it builds the legs, where QuantLib refuses it after them. An engine's results are a BMASwapResults, with QuantLib's inspectors derived from the swap's results.

Constructors

BMASwap(SwapType, double, Schedule, double, double, IborIndex, DayCounter?, Schedule, BMAIndex, DayCounter?, EvaluationContext)

Initializes a new instance of the BMASwap class.

public BMASwap(SwapType type, double nominal, Schedule liborSchedule, double liborFraction, double liborSpread, IborIndex liborIndex, DayCounter? liborDayCount, Schedule bmaSchedule, BMAIndex bmaIndex, DayCounter? bmaDayCount, EvaluationContext context)

Parameters

type SwapType

Whether the BMA leg is paid or received.

nominal double

The nominal of both legs.

liborSchedule Schedule

The Libor leg's schedule.

liborFraction double

The gearing of the Libor fixings.

liborSpread double

The spread over the Libor leg.

liborIndex IborIndex

The Libor leg's index.

liborDayCount DayCounter

The Libor leg's day counter; the index's when null, QuantLib's empty day counter.

bmaSchedule Schedule

The BMA leg's schedule.

bmaIndex BMAIndex

The BMA index.

bmaDayCount DayCounter

The BMA leg's day counter; the index's when null, QuantLib's empty day counter.

context EvaluationContext

The evaluation context, whose at-par switch the Libor leg reads.

Exceptions

ArgumentNullException

An argument but a day counter is null.

ArgumentOutOfRangeException

type isn't a member of its type.

ArgumentException

A leg can't be built from its arguments, a zero gearing among them.

NanoQLException

A leg can't be built from its arguments, an empty schedule among them.

Properties

BmaLeg

Gets the BMA leg.

public ImmutableArray<CashFlow> BmaLeg { get; }

Property Value

ImmutableArray<CashFlow>

LiborFraction

Gets the gearing of the Libor fixings.

public double LiborFraction { get; }

Property Value

double

LiborLeg

Gets the Libor leg.

public ImmutableArray<CashFlow> LiborLeg { get; }

Property Value

ImmutableArray<CashFlow>

LiborSpread

Gets the spread over the Libor leg.

public double LiborSpread { get; }

Property Value

double

Nominal

Gets the nominal of both legs.

public double Nominal { get; }

Property Value

double

Type

Gets whether the BMA leg is paid or received.

public SwapType Type { get; }

Property Value

SwapType

Methods

FetchResults(InstrumentResults)

Reads an engine's results into the instrument's, applying any derivations the instrument makes.

public override BMASwapResults FetchResults(InstrumentResults results)

Parameters

results InstrumentResults

The engine's results.

Returns

BMASwapResults

The instrument's results.

Remarks

The fair Libor fraction and spread are derived from the swap's results, as QuantLib derives them.

Exceptions

ArgumentException

The results aren't a swap's, or a per-leg result has the wrong number of legs.

SetupExpired()

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

public override BMASwapResults SetupExpired()

Returns

BMASwapResults

The expired results.

Remarks

An expired swap has zero leg NPVs and BPS, so no fair Libor fraction, and a fair Libor spread of NaN, the quotient of zeros QuantLib computes.