The Decentralized Finance (DeFi) ecosystem is the most promising application of Blockchain. Aave protocol existed in 2017 as ETHlend, which was a peer to peer lending and borrowing strategy, i.e. a direct relation between lenders and borrowers. Then, a parent company of ETHLend was introduced. This parent company uses the pool-based strategy.
The word “aave” is Finnish, which means “ghost”. In fact, it represents Aave’s intention of creating a transparent and open DeFi infrastructure.
Aave DeFi Protocol
Aave falls in the lending category of DeFi. Hence, it is the protocol that enables the user to earn interest on their deposits and/or to borrow assets.
Lenders deposit cryptocurrencies into a pool contract to provide liquidity. Simultaneously, in the same contract, users can place collateral and borrow pool funds. Loan amounts rely on the pool’s funds, the amount borrowed, and their collateral.
Every Aave pool holds as much as 20 cryptocurrencies. The total liquidity is equivalent to the total amount of these cryptocurrencies but in terms of Ethers. The depositors lend their assets to the protocol. Then the protocol mints ERC-20 compliant aTokens in a 1:1 ratio for those assets. So, anyone depositing assets in the Aave protocol receives Aave-interest-bearing tokens(aTokens). If a user deposits 100 DAI, he will receive 100 aTokens. The aTokens allow the depositors to earn interest, which is accrued by the second and can be viewed in real-time.
The borrowers can borrow these assets by locking collateral greater than the requested amount.
Furthermore, every pool sets aside reserves to shield against volatility, in simpler words, the protocol separates the reserve assets from total assets, these reserves ensure that lenders can withdraw their assets anytime they are ready to exit the protocol.
According to the smart contract, the deposit action is the simplest one. When the user deposits assets
- Update Borrow and/or liquidity indexes.
- Total Liquidity increases.
- Update Interest rates.
- Supplied asset’s equivalent aTokens are minted.
- Finally, Underlying assets are transferred to reserves.
The redeem action enables the users to exchange aTokens with underlying assets. It follows the following sequence of actions.
- Check the user’s aToken balance.
- If the balance is not enough, revert the transaction, else calculate the amount underlying to redeem.
- If the reserve available liquidity is enough, update the borrow or liquidity index. Otherwise, revert the transaction.
- Burn the requested tokens.
- For each loan, the risk factors enable the calculation of health factors. If this health factor is below 1, revert the transaction. Otherwise, decrease total liquidity.
- Then, Update the interest rates.
- End the transaction by transferring underlying assets to the user.
Users lock the collateral amount in exchange for underlying assets. The flow of action is as below:
- If there is enough liquidity the borrow mode is valid, then the contact checks whether the user collateral balance is enough and the health factor is greater than one. If any condition fails the transaction reverts. Otherwise, the borrow assets amount and liquidity indexes.
- Adds the accrued interest to the current borrower balance.
- Adds the new borrow amount to the current borrow balance.
- Updates reserve total borrows by rate.
- Sets user interest rate mode.
- Increase the total reserve liquidity by accrued interest (if any).
- Update the interest rate.
- Calculates and sets the user liquidation rate.
- Lastly, transfer the underlying assets to the user.
What Gives Aave The Edge?
Although all DeFi projects share similar characteristics. Aave distinguishes itself because of the following features:
As long as users allow more liquidity than taken, flash loans allow users to borrow from reserves for a single transaction. Flash loan transfers the funds, temporarily, to a smart contract which implements the “IFlashLoanReceiver.sol”.
The flash loans follow the following flow:
- Firstly, the contract checks whether the reserves have enough liquidity or not.
- If there is enough liquidity, it transfers funds to the action contract temporarily. Otherwise, the transaction reverts.
- After the action, the contract performs the specified tasks. The contract then checks if the borrowed amount plus interest is returned. If not the transaction reverts.
- If the correct amount is returned update borrow and liquidity indexes.
- Then, concludes the transaction by accruing the fee to reserves.
Flash Loan Fee:
The interest amount the user pays on the flash loan is the flash loan fee. The figure shows the manner of utilizing the flash loan fee.
Lending protocols usually restrict users to either use variable rate or stable rate. Once chosen it can’t be changed. Aave however, allows its user to switch between the two choices to ensure that they get the best interest rate. This gives Aave an upper hand on other lending protocols.
Aave offers a wide range of DeFi collateral types to choose from. As of writing this article, the 20 cryptocurrencies available are DAI, USDC, TUSD, USDT, sUSD, BUSD, ETH, LEND, YFI, BAT, REN, ENJ, KNC, LINK, MANA, MKR, REP, SNX, WBTC and ZRX
The native token of Aave is LEND, with a total supply of 1,300,000,000. LEND was originally the utility token for ETHLend, the former version of Aave. LEND tokens are used for fee reductions. The 80% of the platform fee collected from the Aave platform is used to burn LEND tokens. In case of malicious attract which can affect the liquidity, LEND owners can offer their tokens to protect Aave, in return, they will earn protocol fees.
Afterward, Aave intends to use LEND tokens for governance. LEND holders can vote for Aave Improvement Proposals, currently in the test network, to save large payment of gas.
Aave app offers two markets, The Aave market, and the Uniswap market. Users can switch between markets to get better lending and borrowing rates. Adding the Uniswap market enabled the liquidity providers to leverage their LP tokens as collateral to borrow funds.
To offer high liquidity Aave protocol relies on a lending pool model. Collateral backs the loan and aTokens represent it. With the Aave watch, you can keep track of Aave. As of 13th November 2020, 2.6 Million worth of Ethers, equivalent to $1.19 Billion USD, are locked in Aave. Aave ranks 5th on the DeFi Pulse Board.
Xord is a Blockchain development company providing Blockchain solutions to your business processes. Connect with us for your projects and free Blockchain consultation at https://xord.one/contact/