A credit default swap, or CDS, is a derivative contract that pays out if a borrower fails to repay a debt. It is commonly written on bonds, loans, companies, or governments.
The buyer of a CDS pays the seller regular premiums. In return, the seller agrees to compensate the buyer if a defined credit event happens, such as a default, a bankruptcy, or a debt restructuring.
A credit default swap works much like insurance on a debt, but with two differences from a standard policy. The buyer does not have to own the underlying bond, so a CDS can be used to speculate on a borrower's credit as well as to hedge it. The premium itself signals the market's view of default risk, since a higher CDS premium means higher perceived risk.
You own USD 1 million of a company's corporate bonds and worry that the issuer might default. You buy a credit default swap for protection and pay the seller a regular premium.
If the company defaults, the CDS seller compensates you under the contract terms, so your credit loss is reduced. If the company keeps paying, the premiums are the cost of that protection.