project screenshot 1
project screenshot 2
project screenshot 3

liquidation guard

Using limit order with post interaction to protect users against getting liquidated on aave

liquidation guard

Created At

Unite Defi

Project Description

This project sets out to solve one problem - it is getting liquidated on lending markets through the use of limit order protocol. The idea is simple, as soon as your collateral value drops below a certain price or the borrowed asset rises in price leading to higher risk of liquidation, the limit order with post interaction kicks in to protect the user from inevitable liquidation. The order is set to exchange the borrowed assets and redeposit on the lending protocol. For this project, the only available protocol is AAVE on base mainnet but it can easily be extended to all the lending markets out there.

How it's Made

The submission has 3 main components:

  • UI, the ui serves two purposes in one by design for the hackathon: for makers(borrowers) it allows them to set the limit orders at a specific price and for takers(market makers) it allows to fill the suitable orders(ie fillable orders). If this project ever went beyond the hackathon, the takers' functionality would be taken off the UI and out into a standalone app or some other solution would be implemented.
  • Smart contract, this contracts implements ``````IPostInteraction interface to delegate call into a MulticallV3'saggregate3Value` . The encoding of the underlying calls is done in the UI, currently does three things: token allowance for the aave pool, token transfers to the post interaction implementation and finally supplying on aave.
  • Resolver API, purpose of this API is to: - store submitted orders - poll spot price endpoint from 1inch and find fillable orders - let takers fill the orders the reason this API was built was due to the fact that I couldn't submit custom orders to the 1inch API. The API stores submitted orders in memory which 100% needs to be changed if the project ever went live. But for the purposes of the hackathon it is good enough.
background image mobile

Join the mailing list

Get the latest news and updates