Gelato-Aave: Automated Health Factor Maintenance


Automated Health Factor Maintenance

(meme credits: @gitpusha)

Main Implementors


Members of the Gelato community, notably Luis and Matthieu, have recently been in touch with members of the Aave Community, to discuss the need and possible solutions for protecting Aave users from liquidations by using Gelato Network for Automated Health Factor Maintenance.

Gelato Network is a smart contract protocol that coordinates an autonomous marketplace to match the demand for automation from protocols like Aave with suppliers of the required bot infrastructure. As such Gelato is for example being leveraged by InstaDapp Actions, to automate what they call a Debt Bridge. Here gelato network bots automatically refinance InstaDapp ETH-A users’ debt from Maker to Aave, if their ETH-A vaults become unsafe during an ETH price dump, in order to make use of the lower collateral requirements on Aave. At best this avoids costly liquidations for users, and at worst this buys the users some more time to adjust their positions on Aave, should the price dump far enough to also reach liquidation threshold on there. The feature has been live on Ethereum mainnet since early February and already approx. 200 Million $ worth of InstaDapp users’ ETH-A collateral is being protected with this automation thanks to gelato. More recently gelato is also being used by InstaDapp to automate part of their L1 Aave debt position migration to Polygon.

Since May 2021 we discussed with members of the Aave community, how Gelato Network technology could be used to significantly improve the welfare of Aave users by automatically rebalancing their debt positions to constantly maintain a safe Health Factor and thus to avoid costly liquidations for them without needing their manual intervention. Below is a brief outline of the project we’re working on. Please also check the accompanying medium article.

Project Outline

The goal of this project is to develop and ship a system that allows Aave users to enable Automated Health Factor Maintenance for their debt positions. This should result in a huge improvement in UX and financial success for Aave users, who will avoid costly liquidations, without having to manually rebalance just in time.

To deliver such a system to Aave users the following components have to be developed, tested and shipped:

  • smart contracts
  • bot software
  • UI library
  • UI

The implementation will consist of smart contracts that provide a trustless interface between Gelato, Aave and Paraswap or other Polygon DEXs such as Quickswap. Furthermore it will require a software package to be written for gelato bots to be able to serve this use case. The idea is that gelato bots will run software that constantly monitors participating Aave users’ Health Factors. If a user’s Health Factor drops below her defined minimum threshold, gelato bots will be able to sell some of the user’s collateral on her behalf on paraswap, to repay some of her debt and get the Health Factor back up to her specified target. This mechanism shall be implemented such that the bots can only execute this rebalance as per the user’s specification - i.e. it should be trustless. The bots shall be compensated for executing successful user protections with a constant fee of 0.1% from the user’s collateral that was used during the refinancing.

Here is a diagram of said implementation architecture:

The first iteration of the Automated Health Factor Maintenance is planned to launch for Aave on Polygon at the end of July 2021. Possible future iterations could include shipping a similar system for Aave users on Ethereum mainnet.