Understanding Collateralized Debt Positions (CDP) in DeFi and GIX

updated on 13 July 2024

Collateralized Debt Positions (CDPs) are popular in Decentralized Finance (DeFi), especially in lending protocols. However, few understand their meaning or use. We’ll explore key concepts and how we use this technology to issue tokens linked to real-world assets (RWAs), specifically the GIX token — an ERC-20 token tracking gas prices in Ethereum & Base.

Overcollateralization in DeFi

Lending protocols like AAVE and Spark allow users to borrow assets by depositing other coins as collateral. This collateral typically needs a higher USD value than the borrowed assets, a practice called overcollateralization. For example, you might deposit $150 worth of Ethereum to borrow $100 worth of another cryptocurrency. In DeFi, without courts or judges to settle disputes, smart contracts must ensure users repay debts and protect lenders’ assets.

In real life, when someone buys a house, the house itself becomes collateral. For other loans, items like cars, jewelry, or stocks can serve as collateral. Credit cards allow borrowing without specific collateral, but failure to repay can lead to asset seizure or legal action. This system works because legal mechanisms exist to recover debts.

DeFi lacks middlemen, operating via smart contracts on blockchains. To protect liquidity providers and ensure debt repayment, most protocols use overcollateralization. Users must deposit more value than they borrow. Parameters like health rate monitor positions and trigger liquidation if debts become undercollateralized.

The health rate is crucial in DeFi lending, calculated as the ratio of collateral value to borrowed value, adjusted for liquidation thresholds. For example, with a minimum health rate of 1.5, your collateral must always be at least 150% of your borrowed amount. If this ratio falls below 1.5, your position becomes eligible for liquidation.

The computation of health rates and risk parameters is a separate topic. For now we’ll now explain we will focus on how the concepts we learned so far applies to the GIX token

Collateralized Debt Positions

In DeFi lending protocols, users deposit selected cryptocurrencies (e.g., USDC, ETH) to borrow assets. Deposit and borrow options are chosen based on risk models and asset liquidity. Highly volatile or illiquid assets may be excluded or have strict collateral requirements. Positive interest rates apply to liquidity providers, while borrowers face negative rates. These rates depend on supply, demand, and protocol governance decisions.

Let’s illustrate the process with an example:

Alice and Bob aim to earn yield by providing liquidity on AAVE. They see USDC offers 3.4% APY, while ETH offers 4.5%, indicating higher demand for ETH among borrowers. Alice, being conservative, provides USDC. Bob provides ETH.

Later, Bob borrows USDC to use in other DeFi protocols while earning yield on his ETH. This strategy assumes ETH’s price will increase, taking a LONG position to avoid short-term liquidation as his collateral value grows.

When Bob borrows USDC, he may be using assets provided by Alice. This poses a risk to Alice if Bob can’t repay. However, since Bob’s debt is overcollateralized, if its value exceeds his ETH collateral, any user can liquidate his position. They pay his debt and receive an incentive from his collateral. The protocol recovers by swapping part of the ETH collateral for USDC, safeguarding Alice’s lent assets.

Then, in a liquidation event the following occurs:

  1. Bob’s position becomes undercollateralized (e.g., ETH price drops significantly).
  2. A liquidator triggers the liquidation function in the smart contract.
  3. The smart contract automatically sells some of Bob’s ETH to cover his USDC debt.
  4. The liquidator receives a fee, typically a percentage of the liquidated amount.
  5. Any remaining collateral after debt repayment and fees returns to Bob.

This mechanism protects lenders like Alice and maintains system solvency during market volatility.

In this example, Bob creates a CDP by borrowing USDC against ETH, while Alice simply provides liquidity to support the ecosystem. To exit the protocol, Bob must first repay the USDC debt, and then withdraw the ETH collateral.

Using the CDP model for GIX

GasStation simplifies this process. As we’re not a lending protocol, we optimize for user experience. When Bob buys GIX tokens to hedge transaction costs, or speculate, he simply uses ETH. Our smart contracts handle the background operations:

  1. Use ETH as collateral
  2. Compute corresponding GIX value
  3. Mint and send GIX tokens to Bob’s wallet

The ETH is deposited in the GIX smart contract, then into a main pool where GIX contracts become liquidity providers, earning yield. The protocol charges users for holding GIX tokens, with interest payments contributing to liquidity providers’ APY.

Alice, being conservative, deposits directly into the main pool, earning APY on her ETH.

This system resembles a lending protocol, but with key differences:

  1. No liquidations
  2. Users selling GIX tokens receive ETH at the current gas price

For Bob, selling GIX combines repaying debt and withdrawing collateral in one step. For Alice, it’s simply depositing or withdrawing collateral.

We simplify the process for both users, who needn’t understand the complex background mechanics. Unlike you, the reader, who now grasps these behind-the-scenes operations.

Interest rates for GIX holders and liquidity providers (Alice / GIX smart contract) are calculated using a parametric insurance model, to be detailed in a future article. We chose this approach because gas prices’ high volatility would cause extreme liquidations in traditional lending protocols. The parametric insurance model more aggressively protects liquidity providers while adapting to the protocol’s health.

To illustrate: Gas prices on Ethereum can spike during high network congestion. In a traditional CDP model, these spikes could trigger mass liquidations as borrowed GIX value (tracking gas prices) suddenly increases relative to ETH collateral. Our parametric insurance model adjusts for these spikes, creating a more stable system that withstands gas price volatility without constant liquidations.

Screenshot-2024-07-05-at-14.29.11-xc6xv

This approach enables GIX to hedge against gas price fluctuations while offering a smoother, user-friendly experience than traditional DeFi lending protocols. Users can focus on managing transaction costs or speculating on gas prices without concern for the complex mechanics of CDPs and liquidations.

Do you share our mission or have feedback? Follow us on X.com and join our discussions on Telegram, we are constantly looking for input and would love to hear yours!

Read more

Built on Unicorn Platform