MATLAB: Does SWAPBYZERO include the principal in its computation of the Interest Rate Swaps in MATLAB (R2013b)

Financial Instruments Toolboxprincipalswapbyzeroswaps

SWAPBYZERO seems to treat an interest rate (IR) swap as a combination of a floating bond and a fixed rate bond. But this is actually wrong, because a IR swap does not have principal payment to exchange at the end. If I set the principal equal to 0, then SWAPBYZERO errors out. It seems that it replies on the principal to calculate the coupon payments.

Best Answer

As mentioned in the documentation (R2013b), the "Principal" parameter is a "notional" amount used to determine the cash flows, although there is no actual exchange of principal. So you should not set this parameter to zero. Although the cash flow outputs "RecCF" and "PayCF" do include principal amounts, this should not affect the computation of the swap price since the principal amounts in the two legs cancel each other out. 
 
If you have access to John Hull textbook "Options, futures, and other derivatives", it is mentioned that:
 
"If the principal were exchanged at the end of the life of the swap, the nature of the deal would not be changed in anyway. The principal is the same for both the fixed and the floating payments. Exchanging $100 million for $100 million at the end of the life of the swap is a transaction that would have no financial value...."
 
An enhancement request has been submitted so that the cash flow outputs, "RecCF" and "PayCF", not include the notional principal at the end of the swap to reflect the actual mechanics of the swap.