Use of interest rate swaps

“Swaps can be used to convert a floating rate loan or a bond into a fixed rate, or vice versa. They can also be used to alter the duration of portfolio. Receiving fixed in a swap increases duration while paying fixed reduces duration”

Can someone please explain the application of interest rate swaps to alter portfolio durations?

Recalling that a swap is equivalent to issuing one bond and purchasing another (with the same par value), the dollar duration of a swap is the dollar duration of payments you receive (the bond you purchase) less the dollar duration of the payments you make (the bond you issue).

If you want to increase the duration of a bond portfolio, you can enter into a pay floating, receive fixed swap. The fixed rate payments you receive have a large (positive) dollar duration, while the floating rate payments you make have a small (negative) dollar duration; the net dollar duration is a large, positive amount.

If you want to decrease the duration of a bond portfolio, you can enter into a pay fixed, receive floating swap. The floating rate payments you receive have a small (positive) dollar duration, while the fixed rate payments you make have a large (negative) dollar duration; the net dollar duration is a large, negative amount.