Fair Spread


Function Fair Spread within
FxdFlt IRS with keys FxdFlt IRS Fair Spread keysreturns the spread that the referenced swap needs to have at its floating rate leg in order to have a given NPV, usually a zero NPV.

Note 1:
If the swap contains more than 1 spreads, i.e. if the value associated with its key
Spread is an array containing more than 1 elements, the returned spread corresponds only to the first of these elements, while all other elements retain their original values.

Note 2:
While the generic implementation is based on a quite slow iterative root finding method that makes use of an optional input of type
Solver, in the special but frequent case where the target NPV is 0 and the swap is either a Vanilla IRS or OIS with a single fixed rate, the implementation switches to a much faster non-iterative formula that does not need the Solver input.