These are credit default swaps. I don't know if they are implementable as smart contracts (I don't think so, but I could be wrong). I was thinking about overcolateralised DeFi loans which can be seen as a kind of swap where two parties exchange the returns of two different assets.