Blockchain Stories
Published in

Blockchain Stories

DeFi: Lending and Borrowing

By Sumi Maria Abraham, Research and Development Engineer Kerala Blockchain Academy.

Today many organizations have started experimenting with Blockchain potential, and many sectors are constantly urging the need to build blockchain-based solutions for their in-house operations. The high degree adapters are the financial sector that they thumb Blockchain to cover almost all the financial services from online payments to cryptocurrency trading and storage. It is widely believed that Blockchain is set to transform the finance system. With the emergence of Defi (Decentralized Finance), Blockchain has made the statement more substantial and more visible.

Let us get underneath the concept.

Lending and borrowing are the basic facilities provided by any financial service. DeFi borrowing and lending is one of the earliest and most extensive DeFi applications. Some of the significant companies are MakerDAO, AAVE and Compound.

However, before getting into the topic, let us understand some terms that in and out envelops the subject.

Loan: It refers to lending an amount of money(principal) to a party. The borrower should repay the loan by paying back the principal and interest. The lender may also include additional charges, usually expressed as a percentage of the original amount, called interest.

Collateral: It refers to an asset that the borrower submits as a security deposit to the lender. If the borrower fails to repay the loan, the lender can seize the collateral and sell it for compensation. Collateral is used as a risk reduction mechanism for lenders by guaranteeing that the borrower will repay the loan. For example, when obtaining a mortgage for a house, the house is the collateral. If the borrower fails to repay the loan as agreed, the house can be sold to pay off the mortgage. In an over collateralized loan, the value of the collateral asset should be larger than the value of the loan. In an under collateralized loan, the value of a collateral asset can be lesser than the loan’s value.

Liquidation: It is selling off the collateral assets to pay the loan. If the value of collateral decreases and falls below a threshold value or if the value of the loan increases, then the collateral will be “liquidated” to incur the economic loss.

Lending and Borrowing in Traditional Finance

Lending and borrowing in DeFi are facilitated through various protocols termed protocols for loanable funds (PLFs). In peer-to-peer lending, funds are transferred between the users. But in DeFi lending, tokens are pooled together in a smart contract, and the user borrows the tokens against the smart contract reserve. In short, smart contracts act as trustless intermediaries, dealing with the borrowers on behalf of the lenders.


Crypto asset holders can deposit them in the lending pool (smart contract). In return, they will receive specific tokens representing their share in the total value of the lending pool. Can redeem at any time for the original deposit and accrued interest.

The interest rate of the lending pool keeps changing. It depends on the amount of assets in the pool and the amount that has been borrowed (utilization rate). If the utilization rate increases, the interest rate will also increase to attract more deposits and discourage borrowing. Conversely, if the utilization rate decreases, the interest rate will also drop to prevent deposits and improve borrowing.


Due to the volatile nature of crypto assets, loans are usually over collateralized to avoid financial losses, which may occur when borrowers cannot pay the loan. A user must deposit collateral whose value is more than the loan value to take a loan. Even if the collateral value relative to the debt falls considerably, there would still be sufficient collateral to cover the debt.

Lending and Borrowing in DeFi

The interest on the loan amount depends on the underlying interest rate model of the service. Out of the interest received, a fraction will be allocated to a pool of reserves, which is saved to cope with market illiquidity (a situation when one cannot sell assets for cash). The amount remaining will be paid back to the lenders who have supplied the funds. Usually, loans can be for any amount (based on collateral value), with no specific duration, and generally be repaid.

If the user does not repay the debt, he can liquidate the collateral to pay it off. The borrower should ensure that the value of the locked collateral always remains above a liquidation threshold. If the value of the collateral decreases or the value of the borrowed assets increases by a considerable amount, the borrower might be at risk of liquidation. It should be avoided by depositing more collateral or repaying the loan in part or whole. If it falls below the limit, liquidators will be allowed to purchase the locked collateral at a discount and clear the borrower’s loan.

Flash loans

Flash loans allow users to borrow instantly without requiring any collateral. But it requires that the loan is repaid at the end of the same transaction (which may contain a series of actions). Here the loan is secured by the atomicity property offered by smart contracts because if the loan is not repaid with interest, the whole transaction is reversed.



The lenders who deposit tokens to AAVE provide liquidity to Aave’s token pools, triggering the automatic minting of aTokens. aTokens are ERC-20 tokens (An Ethereum token standard) pegged 1:1 to the value of the underlying asset. They are a claim to the liquidity provided by a lender. The interest will be earned real-time and varies based on borrowing demand and liquidity supply. It is built on Ethereum.


Compound is a protocol on the Ethereum blockchain that establishes money markets, pools of assets with algorithmically derived interest rates, based on the supply and demand for the asset [6]. Each money market is unique to an Ethereum asset and the interest earned is represented in the same token that is lent. Assets supplied to a market are represented by an ERC-20 token balance (“cToken”), which entitles the owner to an increasing quantity of the underlying asset[6].

What are the benefits of on-chain lending & borrowing ?

Instead of depositing with a central authority, the assets are locked up in a smart contract. The smart contract automatically computes the interest rates for lenders and borrowers. They refer to price oracles for determining the real-time value of assets. Oracles are data feeds that allow information from sources off the Blockchain, such as the real-time price of an asset or fiat currency.

Since loans are secured with assets held by smart contracts, there is no need for credit checks on borrowers before sanctioning a loan. The loans are generally overcollateralized to deal with price fluctuations. The borrower can use, sell, or re-lend the borrowed tokens, meaning the loans are typically used for trading or accessing new assets.

The assets are constantly under user control. Usually, there is no minimum or maximum limit for the assets involved. The lenders can redeem their assets anytime, and borrowers can repay their loans anytime.


[1] Werner, Sam & Perez, Daniel & Gudgeon, Lewis & Klages-Mundt, Ariah & Harz, Dominik & Knottenbelt, William. (2021). “SoK: Decentralized Finance (DeFi).”

[2] Lewis Gudgeon, Sam Werner, Daniel Perez, and William J. Knottenbelt. 2020. DeFi Protocols for Loanable Funds: Interest Rates, Liquidity, and Market Efficiency. In Proceedings of the 2nd ACM Conference on Advances in Financial Technologies Association for Computing Machinery, New York, NY, USA, 92–112. DOI:

[3] Perez, Daniel & Werner, Sam & Xu, Jiahua & Livshits, Benjamin. (2021). Liquidations: DeFi on a Knife-edge.

[4] DeFi MOOC

[5]. AAVE

[6] Compound Finance White Paper



The ultimate guide to master blockchain basics and understand intricate terminologies.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Kerala Blockchain Academy

One-stop solution for quality blockchain education and research. Offers best in class blockchain certification programs in multiple blockchain domains.