A credit default swap is a contract where a buyer pays a seller a periodic fee in exchange for a payout if a third party defaults on its debt obligations. For example, if party A lends to party B, party A can buy a CDS from party C to insure against party B's default. If party B defaults, party C pays party A instead of party B. CDS contracts transfer credit risk from one party to another and resemble insurance policies against borrower defaults.