In this second example, we consider the pricing of CDS. The details of the approach are shown in the following Bento Box template for the CDS:
A CDS is a financial contract between two counterparties A and B, in which one party pays to the other party to buy credit protection against the possible default of an underlying C.
In structure, the CDS is similar to the plain vanilla IRS, as it is composed of an exchange of cash flows between the parties. In a typical CDS with duration of five years, counterparty A pays B a series of premium payments at regular intervals upon an agreed notional. These payments will be made as long as underlying C "survives" (that is, doesn't go in default).
Counterparty B pays A a single contingent payment at the time of default of underlying C. The amount paid is equal to the notional minus the recovery rate. In mathematical terms, it can be expressed as follows:
Like in an IRS, the "price" of the contract...