## Carry

Function Carry within
IRS with keys IRS Carry keys returns the at-the-money carry C of the referenced swap between the trade date T₀ and a horizon date , with T₀ < Tʰ in a given market environment defined by a discounting and forecasting curve represented as objects of type Yield Curve

Web blog examples
here and here

C is defined like in Bloomberg, as this screenshot shows:

Accordingly, C is calculated as the par swap rate from horizon date to maturity minus the par rate from swap start to maturity, in bps per annum.

Formally:
C = rʰ - r₀
where
r₀ is the swap's fair rate as of T₀ using the supplied yield curves, which is defined as the rate the swap's fixed leg ought to have so that its PV at T₀ to equal 0.
is the fair rate as of T₀ of a forward swap that starts at the horizon date , which is defined as the rate the forward swap's fixed leg ought to have so that its PV at T₀ to equal 0.

There exist two different methods for calculating the rate that can be selected through the optional key
Method

irs-carryroll.xlsx and ois-carryroll.xlsx that demonstrate both methods described here.

The first method is the default and corresponds to the key
Method set to Modify Disc Crv, whereby the swap is kept as it is and the fair rate is calculated by using a modified discounting curve produced by forcing all discount factors of the initial discounting curve maturing before to equal 0.

The second method corresponds to the key
Method set to Modify Swap, whereby the swap is replaced by one that starts at

The Bloomberg phrase par swap rate from horizon date to maturity allows some room to ambiguity in those cases where the date falls inside an accrual period of either the fixed or the floating leg of the swap.
It alludes to a swap extending from to Tᵐ, where Tᵐ is the maturity of the original swap.
But in the mentioned case, it is not clear what the first cash flow - the one that occurs at the end of the broken accrual period - should be!
Deriscope supports two treatments specified through the key
Clean Terms
In the same case, there is also ambiguity regarding how the floating index of the first cash flow is defined.
Then the key
Keep Reset Dates can be used to select the desired definition.