Collateral Debt Position (CDP) and Liquidations Example

Marco_112358
6 min readMar 3, 2022

--

CDPs are a really interesting way to create stablecoins and synthetic assets. I am going to focus this article on the synthetic asset piece. I am really interested in Indigo Protocol and their development of synthetic assets on Cardano. This will be bring real world and traditional assets into the DeFi space.

The way a CDP works is a user typically is required to deposit collateral into a contract, and then can mint a max amount of the borrowed synthetic asset (iAsset in the case of Indigo). The user must keep the ratio of value of collateral / value of borrowed asset greater than some threshold. Most protocols require overcollateralization. This means that you must deposit enough tokens of the collateral so that the value is over 100% (usually well over 100%) of the value of the minted/borrowed asset. The minimum required collateral ratio is that minimum amount you must have or you will get liquidated (more on that below).

Collateral Ratio (CR) = (Price of Collateral * deposited amount of Collateral) divided by (Price of Minted/Borrowed Asset * amount of Minted/Borrowed Asset)

If the user’s CR drops below the minimum required collateral ratio, that user will be liquidated. What that means is that the user will lose all of their collateral that they deposited, and be left with just the minted/borrowed asset. The user will end up with a loss if their CR is still above 100%. The liquidators will make money in this case as well.

Indigo has a really interesting way of doing this. They are creating liquidation pools that allow users to deposit their minted/borrowed iAssets into the liquidation pool for yield. If all goes smoothly, the users will just earn yield on their deposited iAssets (think of this as single sided, no Impermanent Loss). However, if there are any CDPs in the protocol that can be liquidated on that iAsset, the Liquidation Pool with burn the needed amount of iAsset in the Liquidation Pool and cover the CDP. So the users who deposit in the Liquidation Pool will lose any or all of their deposited iAsset, and they will receive the collateral from the liquidated CDP. Indigo has a great example of this in their Yellow Paper.

Indigo Yellow Paper Example of Liquidation Pool

I really wanted to get a better understanding of the risks of CDPs, liquidations, and depositing into Liquidation Pools. So I created the stylized example below of Alice and Bob. Bob will get liquidated while Alice does not, and she deposits into the liquidation pool.

Example

Bob and Alice both mint iAsset and deposit collateral (stablecoin) into the CDP. The protocol has a collateral ratio (CR) requirement of 150%, meaning that the value of the collateral must be 1.5x the value of the minted iAsset. Bob sets his initial CR to 200% and Alice sets her initial CR to 400%. Alice takes her iAsset and deposits it into the Liquidation Pool. This means that Alice’s iAsset will be burned if there are any liquidations, and she will receive the liquidated CDPs collateral in return.

There are 4 boxes for Bob and Alice. The first box is the initial CDP and initial iAsset price. The second box shows the change in iAsset price, and the CDPs right before liquidation. The third box shows the liquidation process. The fourth box shows Alice swapping back into the iAsset after the liquidation.

Scenario 1:

Price of iAsset increases by 33.4%, pushing Bob’s CL below the 150% threshold and Bob get’s liquidated. Bob loses all $100 of his collateral that he deposited, and is left with $66.7 worth of the iAsset, a loss of $33.3. Alice’s iAsset is used to liquidate Bob’s CDP. She receives all $100 of Bob’s collateral in return (3rd box titled “Post Liquidation”). Alice then swaps back the necessary amount of the asset she received in the liquidation to get back her 10 iAssets, so she can close her CDP. She is left with an extra $33.3 of the collateral asset as a profit from the liquidation.

Scenario 2:

Price of iAsset increases by 100%, pushing Bob’s CL below the 150% threshold (to 100%) and Bob get’s liquidated. Bob loses all $100 of his collateral that he deposited, and is left with $100 worth of the iAsset. This leads to no loss or gain for him. Alice’s iAsset is used to liquidate Bob’s CDP. She receives all $100 of Bob’s collateral in return (3rd box titled “Post Liquidation”). Alice then swaps back the necessary amount of the asset she received in the liquidation to get back her 10 iAssets, so she can close her CDP. She is left with the exact same amount of iAsset and Collateral tokens she started with, so no loss or gain for her.

Scenario 3:

Price of iAsset increases by 140%, pushing Bob’s CL below the 150% threshold (and below 100%) and Bob get’s liquidated. Bob loses all $100 of his collateral that he deposited, and is left with $120 worth of the iAsset, a gain of $20. Alice’s iAsset is used to liquidate Bob’s CDP. She receives all $100 of Bob’s collateral in return (3rd box titled “Post Liquidation”). Alice then swaps back the all of the liquidation proceeds received to the iAsset. But because the iAsset price moved to quickly, she cannot fully swap back the full amount of iAsset needed. She is left with a loss of $20.

Overall we see that Bob is worse off if he gets liquidated while his CR is > 100%. Alice is worse off if the liquidation process does not occur in a timely fashion, and Bob’s CR falls below 100% before he is liquidated. We can see the risk of the liquidator comes down to blockchain congestion, systematic failure, or massive market events. If these unlikely things occur, its possible to lose money as a liquidator. As a user of CDPs, your risks are all about managing your collateral and CR. If you get liquidated, you may end up with less total value than you started.

Conclusion

Synthetic assets and CDPs are great for the DeFi ecosystem. But they do come with a risk. Please understand that liquidations can and do happen. They are a necessary part of the stability mechanism for pegging the minted/borrowed asset to their market prices. Anyone who uses a CDP must carefully manage their collateral. Anyone who participates in liquidations must understand some of the (unlikely but possible) risks they are taking as well. I hope this helps explain CDPs and liquidations!

About the Author

For full disclosure I mostly use Solana for DeFi, because I don’t have enough assets to justify Ethereum gas fees. I have a little bit in Algorand, Cardano and Polkadot DeFi. I am actively involved in multiple Friktion volts and a contributor in their Discord, and am beta testing Dappio Wonderland 🐰.

I am invested in SOL, ADA, ETH, DOT, ALGO, MIOTA along with plenty of other tokens.

This is not Financial Advice!

I would love to hear your feedback/questions/comments. Reach out to me on Twitter… Marco_112358, or Discord… marco_112358 in Wonderland#2400

--

--

Marco_112358
Marco_112358

Written by Marco_112358

TradFi background (CFA/CFP), DeFi Degen

No responses yet