Skip to content

Instantly share code, notes, and snippets.

@gitpusha
Last active June 16, 2021 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gitpusha/bd1e369c74f551277ad79fea279ac70c to your computer and use it in GitHub Desktop.
Save gitpusha/bd1e369c74f551277ad79fea279ac70c to your computer and use it in GitHub Desktop.
Gelato's rapid grant application to the Aave Grants Program for Automated Health Factor Maintenance

gelato-aave

Automated Health Factor Maintenance - Rapid Grant Application

Main Applicants

Background

Members of the Gelato community, notably Luis and Matthieu, have recently been in touch with members of the Aave Community, notably Mark and Ajit, 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.

On a recent panel Luis from Gelato met Mark from Aave when they discussed amongst other things the recent launches of Aave and Gelato on Polygon. We followed up in another call to discuss 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. This grant application outlines the milestones and budget that members of the Gelato community require to be able to deliver this promising solution to Aave.

Project Outline

The goal of this project grant 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
  • Minimal Test UI
  • (optional advanced UI, see Scope-B)

The implementation will consist of smart contracts that provide a trustless interface between Gelato, Aave and Paraswap. 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 their services in proportion to the transaction gas fee they incur on behalf of the user.

Here is a diagram of said implementation architecture:

This rapid grant application is for the first iteration of the Automated Health Factor Maintenance for Aave on Polygon. Possible future iterations could include shipping a similar system for Aave on Ethereum mainnet.

Milestones, Timeline, and Budget

There are two scopes of work and budget plans that can be applied to this project. We will call the smaller Scope-A and the larger one Scope-B. This rapid grant application can thus be divided into two sub applications along the two defined Scopes, both within the <$100k budget range, of which only one is meant to be granted.

Scope-A

Goal

Ship the Automated Health Factor Maintenance smart contracts, backend and a developer friendly frontend library, so that the Aave UI and third party UIs can feature the system.

Milestones

  • develop, test and deploy smart contracts to Polygon that enable trustless interface between Gelato Network, Aave, and Paraswap.

  • develop gelato bot software component for Automated Health Factor Maintenance use case

  • develop a UI library that exposes the functionality necessary for users to interact with the system

  • build a minimum viable UI for testing and demos

Timeline: mid-May 2021 until mid-June 2021

Budget: $20k

Scope-B

Goal

Ship the Automated Health Factor Maintenance backend and smart contracts, a developer friendly frontend library and a public UI, so that the system is featured on a ready-made UI and later can also be integrated on Aave's UI and other third party UIs.

Milestones

Same as Scope-A plus a major additional milestone:

  • develop, test, ship, and host a UI on which Aave users can use Automated Health Factor Maintenance

Timeline: mid-May 2021 until end-July 2021

Budget: $50k

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment