> For the complete documentation index, see [llms.txt](https://docs.divaprotocol.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.divaprotocol.io/use-cases/insurance/credit-default-protection.md).

# Credit default protection

Bob has provided an undercollateralized loan to a DAO using a DeFi protocol. He is concerned that the DAO may not repay the loan in full and he will lose money. Bob would like to protect himself against a (partial) default by purchasing a position whose payout increases as the repayment amount decreases.

### :gear: Pool configuration

Bob uses the DIVA App to create a credit insurance product with the following configuration:

![Example configuration for a credit default insurance product in the DIVA App using a linear payoff profile.](/files/6LGs7uRF1B1TY4xkVWCU)

Notes:

1. The Reference Asset is the on-chain bond address.
2. The Expiry Time is equal to the maturity/grace period end of the bond.
3. Given the on-chain nature of the loan, the repayment amount information is stored on-chain providing a fully trustless oracle for settlement.

### :handshake: Sell long position tokens

After creating the pool, Bob puts all long position tokens for sale (1'000'000 in total in our example), for a price of USDC 0.95 each. Alice purchases all long position tokens for a total of USDC 950'000. After the trade, the two parties end up with the following positions:

![Payoff profiles for Bob and Alice.](/files/TZ1R8W8oRvNMdrDPurFi)

Bob's net contribution / premium paid for the credit default insurance (short position) after the sale is USDC 1'000'000 - 950'000 = USDC 50'000.

### 💵 Payoff scenarios

1\) DAO has repaid the full loan amount (USDC 1'000'000):

* Bob paid a premium of USDC 50'000 but doesn't receive any payout from the short position as the loan was fully repaid: \
  -> <mark style="color:orange;">**net loss for Bob: USDC 50'000**</mark>\
  -> <mark style="color:green;">**net gain for Alice: USDC 50'000**</mark> (5.26% on USDC 950'000)

2\) DAO has repaid 50% of the loan (USDC 500'000):

* Bob paid a premium of USDC 50'000 and receives USDC 500'000 as payout due to partial repayment of the loan:\
  -> <mark style="color:green;">**net gain for Bob: USDC 450'000**</mark>\
  -> <mark style="color:orange;">**net loss for Alice: USDC 450'000**</mark>

3\) DAO doesn't repay the loan (USDC 0):

* Bob paid a premium of USDC 50'000 and receives USDC 1'000'000 as payout due to a full default:\
  -> <mark style="color:green;">**net gain for Bob: USDC 950'000**</mark>\
  -> <mark style="color:orange;">**net loss for Alice: USDC 950'000**</mark>
