A swap is an agreement between two counterparties to exchange two streams of cash flows—the parties "swap" the cash flow streams. Those cash flow streams can be defined in almost any manner. All that matters is that their present values be equal (except for a bid-ask spread, if one party to the swap is a dealer). While swaps are used for various purposes—from hedging to speculation—their fundamental purpose is to change the character of an asset or liability without liquidating that asset or liability.
For example, an investor realizing returns from an equity investment can swap those returns into less risky fixed income cash flows—without having to liquidate the equities. A corporation with floating rate debt can swap that debt into a fixed rate obligation—without having to retire and reissue debt.
This is illustrated in Exhibit 1. Suppose you are receiving Cash Flow Stream A from a counterparty. You would like to change the nature of that cash flow stream—perhaps making it less risky. Rather than attempt to renegotiate the obligation with the counterparty, you enter into a swap agreement with another party. Under that agreement, you swap Cash Flow Stream A for a Cash Flow Stream B, which better suits your needs.
Exhibit 1 illustrates how a swap can modify the character of an asset. If you reversed all the arrows in that exhibit, it would then illustrate how a swap can change the character of a liability.
When a swap is first entered into, it has zero market value (except possibly for a small bid-ask spread). This is because both cash flow streams have identical, offsetting market values. As time goes by, the swap is likely to take on a positive or negative market value. This may happen for one or two reasons:
Market variables that affect the market values of one or both cash flow streams will fluctuate, causing the values of the cash flow streams to change. The swap's market value, which is simply the difference between the two cash flow streams' market values, will then also change.
One cash flow stream may have more accelerated payments than the other, so the swap takes on a positive market value for the party making the more accelerated payments. An extreme case of this is some customized swaps that require one party to make a substantial payment right at the outset.
For the first of the above reasons, swaps entail market risk. For both reasons, they entail pre-settlement risk. Collateralization is a common way of addressing pre-settlement risk of one or both of the counterparties. Settlement risk can be a problem for some swaps. However, cash flow streams are often structured so that payments for one occur on the same dates as payments for the other. This allows cash flows to be netted against each other (so long as the cash flows are in the same currency).
A vanilla swap is any swap with fairly standardized provisions. The term is usually applied to vanilla interest rate swaps or vanilla currency swaps. Vanilla swaps are appealing because pricing tends to be transparent and transaction costs are small. Vanilla swaps can be used to speculate or to quickly hedge the market risk of a position without necessarily offsetting the specific cash flows of that position.
Swaps can also be customized to offset the specific cash flows of a position. Dealers often structure such non-vanilla swaps for clients. They may charge a fee for doing so, and pricing may reflect a large bid-ask spread (caveat emptor). An asset swap is a non-vanilla swap customized to change the character of a specific asset. A liability swap is such a swap customized to change the character of a specific liability.