Skip to content
Request a Demo

Liquidity protocols allow users to deposit cryptocurrencies and earn rewards as shares of the transaction fees, or additional tokens. This incentivizes users to provide and maintain the necessary liquidity required for safely operating an automated market. 

 

A prominent feature of liquidity protocols is the ability for users to withdraw overcollateralized loans with very low interest rates. However, due to accrued interest or currency fluctuations, these positions may become unhealthy. If this occurs, the user’s position becomes eligible for liquidation, meaning another user can offer to pay back part of the debt owed up to 50% (and in some cases 100%) of the loan to earn a liquidation bonus paid by the user who was liquidated. Measuring whether liquidating a user is profitable or not requires accurate and granular data to closely monitor the protocol.

Functioning as an active liquidator for modern protocols can be a safe and effective way to profit with a small amount of computing power and automation. There are many popular liquidity protocols (Aave, Compound, Uniswap, MakerDAO, etc.) which have differences in usage and underlying codebase but share the same fundamental concepts in terms of liquidity. This blog will discuss the basics of how to perform liquidations on Aave, one of the most popular and powerful DeFi lending protocols.

Liquidity Protocol Basics

The Aave DeFi protocol facilitates borrowing, lending, and earning interest on crypto assets without any intermediary parties involved in transactions. It relies on a system of smart contracts built on the Ethereum blockchain that automatically facilitates these transactions. In addition to offering a few dozen coins on their platform, Aave also issues two native tokens: aTokens and AAVE tokens. aTokens are issued to lenders and are pegged to the corresponding deposited asset. They can be traded, transferred, and stored just like regular coins.

aTokens allow lenders to earn interest on their deposits, and are immediately minted and burned upon depositing or redeeming their value. The official AAVE token offers several advantages for holders that actively participate in the Aave protocol, including higher borrowing ratios, fee discounts and waivers, early access to new loans, and platform governance.

One of Aave’s strengths is its ability to execute a flash loan, or an uncapped instantaneous loan that does not require collateral but must be paid back (plus a 0.9% fee) within the same block. Failure to pay back the flash loan within the same block results in a cancellation of the entire transaction, essentially removing any risk to the borrower or to the Aave platform. Flash loans are paramount to executing various trading strategies such as arbitrage or liquidations.

Aave Liquidations

In the Aave network, the status of user loans is monitored via a Health Factor, or a ratio of collateral to amount borrowed. A safe health factor is indicated by a ratio that is one or above, as shown by the equation below. A position with a low health factor may be liquidated to maintain solvency. The health factor is calculated by the protocol as follows:

Picture1-2

If an Aave user’s health factor drops below 1, the loan is eligible for a liquidation of 50%. In a new addition to the Aave v3 protocol, if the loan drops below a lower dynamic threshold it is eligible for a 100% liquidation.

There are three major ways that a loan can become unhealthy: the collateral asset provided could decrease in value, the borrowed debt could increase in value against the collateral provided, or the user could fail to keep up with their interest payments. Conversely, a user’s health factor can only be directly improved by either paying off part of the debt or by offering more collateral. 

In Aave Version 3 (v3), bonuses earned from liquidating a loan depends on the riskiness of the collateral asset provided, and higher risk loans give a higher percentage bonus to the liquidator. For example, the current Aave Risk Parameters are around 5% for ETH and most stablecoins. This is on the higher end of the liquidity protocol market compared to other protocols associated with specific stablecoins, such as Anchor (1% bonus), Tarot (2% bonus), and even Hubble (0.5% bonus). On the other end of the spectrum, the current highest Aave liquidation bonus is at 10% for Kyber Network Crystal (KNC).

In order to perform a profitable liquidation, the bonus received must outweigh the transaction fees associated with carrying out the liquidation. Reducing the risk of unhealthy loans helps maintain protocol integrity and traders are incentivized to find and execute liquidations as a strategy to increase their returns.

 

Liquidating a User

Provided a user fulfills the necessary liquidation requirements and the liquidator is the first to initiate, Aave liquidations require five essential inputs:

  1. The wallet address of the user with a health factor less than 1
  2. The amount of debt the liquidator wants to cover
  3. A sufficient amount of the debt asset (flash loans are essential here)
  4. The user's originally provided collateral asset
  5. The liquidator’s desired profit asset (either in aTokens or the underlying asset)

There are two important concepts that help keep track of potentially unhealthy loans: the Loan-to-Value ratio (LtV) and the liquidation threshold. The LtV ratio (usually around 50-85%) is expressed in a percentage and defines the maximum amount of assets that may be borrowed with a specific asset as collateral. For example, if the LTV = 70%, for every 1 ETH of collateral, borrowers can borrow 0.70 ETH worth of the corresponding currency. The liquidation threshold (usually no more than 10-15% above LtV) is the percentage at which a loan is defined as under-collateralized. For example, a liquidation threshold of 80% means that if the value rises above 80% of the collateral, the loan could be liquidated. If the loan reaches the liquidation threshold, Aave prevents a user from borrowing and the user must either partially close their position or provide more collateral.

Executing a liquidation takes multiple steps and can be automated through a bot. After identifying an unhealthy user, the liquidator must confirm a user’s wallet address has a low health factor. If the health factor is below 1, the account is ready to be liquidated and all of the relevant user data must be gathered. Next, the liquidator would determine if liquidating this loan is profitable, accessing data on transaction and liquidation bonus fees. Note that calculating whether a liquidation is profitable can get complex depending on the number of collateral swaps needed, as multiple swaps lead to accumulating gas costs and transaction fees. If a profitable liquidation is determined, the liquidator may request a flash loan to cover the indebted asset, execute collateral swaps associated with the liquidation, and finally call the liquidation itself.

Note that Aave provides weekly dynamic risk parameter recommendations. A currency’s overall risk factor is also given a letter grade by Aave (Figure 1) so users are aware of potential risk.

Picture11Figure 1: Risk factor grades from Aave.

Conclusion

Aave is an innovative DeFi lending protocol that incentivizes users to liquidate loans that fall below a set threshold in return for a reward dependent on the loan risk. This system helps maintain a balance of healthy transactions in Aave’s ecosystem, however identifying users who fall below the liquidation threshold requires accurate data to closely monitor the protocol. Contact Us to learn how Amberdata can provide the data infrastructure you need to succeed in DeFi and the crypto market in general.

The DeFi Primer eBook

Tag(s): Cryptocurrency , Defi

Amberdata Blog

View All Posts