DeFi Bascis #5 | Lending / Borrowing in DeFi :

Naveen Kumar
6 min readJan 7, 2024

--

I am writing a series of posts on DeFi basics from the past several months(sorry for my inconsistency). In this post, I will be delving deep into DeFi Lending and it’s details. Check the previous article here.

Let’s get up-to speed with some basic jargon and their definitions before we delve deep.

Lender: A lender is an actor within a financial system who holds surplus capital and seeks to gain returns on it by providing loans to borrowers.

Borrower: Borrowers deposit collateral to secure loans from lenders, typically offering more collateral value than the loan amount. While traditional loans often involve Know Your Customer (KYC) checks, DeFi often operates without them, relying on overcollateralization for risk mitigation.

Platforms like Aave, Compound allow not only borrowing but also lending out the deposited collateral, creating a system where borrowers indirectly act as lenders to other borrowers.

Loan/Debt: In DeFi lending and borrowing, a borrower secures a temporary loan from a lender by depositing collateral. This collateral serves as insurance for the lender, protecting them against potential losses in case the borrower defaults on the loan.

Interest rate: In DeFi lending, borrowers repay loans by returning the original amount plus a periodic percentage called the interest rate. This rate can be dynamically influenced by the supply and demand of assets within the lending smart contract. When asset availability is scarce, interest rates may rise due to increased demand. Conversely, a surplus of available assets can lead to lower interest rates for borrowers.

Collateral : Assets that serves as a security deposit for the lender. Typically have some value associated with it.

Over Collateralization: Borrower provides a collateral whose value is higher than the value of the loan.

Over collateralised Borrowing:

The drawback in over-collateralised borrowing is that the leverage that the borrower can take always remain below the collateral.

Maker Dao model:

  • Step1: Borrower provides ETH as collateral and opens a debt position(the so called collateral debt position aka CDP).
  • Step2: The smart contract would mint DAI and the borrower can withdraw DAI to use.
  • Step3: To close the debt(CDP) position, the DAI should be repaid to the contract and the contract would unlock ETH.

Under collateralised Borrowing: Borrower provides a collateral whose value is lesser/inferior than the value of the loan.

The value of debt can exceed the value of collateral in under-collateralised borrowing. Debt and borrowing has limits defined in predesigned smart contracts in the lending platform.

Debt Position: In DeFi lending and borrowing, the term “position” refers to the combined collateral and debts held by a user within a lending protocol. It’s like a snapshot of your financial standing within a specific DeFi platform.

Key components of a position:

  • Collateral: The assets you deposit as security for your loans. These assets act as a safety net for lenders in case you default on your debt.
  • Debts: The borrowed assets you have outstanding within the protocol.

Liquidation: In DeFi lending, a borrower’s position can be liquidated if the value of their collateral falls below a certain threshold relative to their outstanding debt due to a negative price fluctuation. This essentially means your collateral isn’t worth enough to safely secure your loan anymore.

If value of the collateral ≤ threshold of debt(say ≤ 150% of debt’s value), position gets liquidated..!!

Liquidation Threshold (LT): It’s a percentage value set by a DeFi lending protocol that determines when a borrower’s position becomes eligible for liquidation. It acts as a safety net for lenders, ensuring they get their funds back even if the borrower’s collateral value declines. Liquidation threshold is also called as collateral factor. This is also called Debt to collateral.

LT = 80%: If a borrower’s debt is worth $400 and their collateral is worth $500, then 80%, is the LT(collateral factor).

Collateralisation Ratio (CR): It’s a measure of how much collateral a borrower has deposited relative to their outstanding debt. It’s calculated by dividing the total value of collateral by the total value of debt. It reflects the level of security backing a loan, indicating the potential buffer available to lenders in case of asset price fluctuations.

Equation for collateralisation ratio:

CR = ∑ Value of Collateral / ∑ Value of Debt

Loan to Value (LTV) : The loan to value is the current value of the loan as a percentage of the collateral value. For example, the required collateral factor may be 80%, but the value of the assets and collateral may fluctuate such that the ratio of the asset value to the collateral value becomes 70%.

Liquidation Spread (LS): It’s a percentage bonus or discount that a liquidator receives as an incentive for promptly repaying a borrower’s debt when their position becomes eligible for liquidation. It encourages swift liquidations, ensuring timely debt repayment and protecting lenders from potential losses.

Liquidation factor / Health factor: If the loan to value(LTV) gets too close to 100%, there is a risk that the amount of money borrowed will exceed the value of the collateral causing the lender to lose out. When the collateral is worth less than the loan, the LTV exceeds 100% and we have bad debt and the protocol risks becoming insolvent (unable to pay back the lenders).

Liquidation factor factor = Total borrowing capacity* / Total debt

*Borrowing Capacity = ∑︁ Value of collateral X Liquidation Threshold(LT)

**Check above for the definitions of Loan to value and Liquidation threshold

When Liquidation factor becomes <1, a borrowing position becomes liquidatable.

Liquidation spread: Bonus or discount, that a liquidator can collect when liquidating collateral.

Close Factor : The maximum proportion of debt that is allowed to be repaid in a single fixed spread liquidation.

Value of Debt to Repay < Close Factor X Total value of Debts

Value of Collateral to claim = Value of debt to repay X (1 + LS)

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — That’s it folks. In the following article, I will deep dive into various liquidation mechanisms in DeFi. These are an important aspect to protect the money markets and keep them stable.

Sources I learnt from :

https://youtube.com/watch?v=dKk9rGWDoTI&t=1104s… — DeFi MOOC Lecture

https://youtube.com/watch?v=aTp9er6S73M… — Lending and borrowing
Finematics
https://youtube.com/watch?v=WwE3lUq51gQ… — Finematics AAVE

https://youtube.com/watch?v=YiF6x193fRk… — Flash loan

https://youtube.com/watch?v=muKxvZ1SxdM… — Under collateralised loans coingecko

--

--

Naveen Kumar

Optimistic nihilist, Another Atom, in the universe of atoms :)