AAVE Health Factor Alert

Worried about Liquidations? Sleep easy.

Do you check your phone regularly to find out if you're going to get liquidated on AAVE? That sucks. We know. This alert will give you peace of mind that you're going to get a push notification if your loan is at risk of liquidation before it happens.

What is Health Factor? AAVE has a much better writing team than us, I'll let them explain!

Now we know what the health factor is, how do we get it? Fortunately, AAVE also thought of this, their Pool contract has a tidy little helper function that lets us fetch the health factor for any user address. All we need now is the pool address found here and we're off to the races.

Step 1. Fire up DeNotify and click "Add New Alert"

Step 2. Configure the Trigger

  • Let's name this "AAVE Health Monitor".

  • Select "Poll Function" for the type. This is because we want DeNotify to periodically call the getUserAccountData() function and check out HealthFactor.

  • Select Network (We'll use Avalanche for this example)

  • Grab the pool address, and enter that in the Contract Address. On Avalanche the AAVE Pool address is: 0x794a61358D6845594F94dc1DB02A252b5b4814aD.

  • The ABI may be auto-generated, but at the time of writing this, fetching ABI's for Proxies isn't supported. So let's grab the ABI from snowtrace and paste that sucker in. You'll need the implementation ABI, not the proxy itself.

  • The function options will auto-populate. Select the getUserAccountData() functions.

  • A field will appear for the user argument. Paste your address here want to monitor here. (The address which has the loan on AAVE)

  • Select a poll period, 100 should be more than enough. That'll check every 3 minutes of so on Avalanche.

Configure the conditional test

We want an alert to fire when our health factor is below 1.2.

  • Select "Conditional" for the Trigger On setting because we want to trigger the alert when our health factor is below a particular value.

  • Now select the desired argument, which is "healthFactor" in our case.

  • The health factor has 18 decimals (Can be found in AAVE docs). Enter 18 for the decimals

  • Select less than for the condition '<'

  • Now the constant we want to compare against is 1.2, so pop that in.

Step 3: Configure the Notification

We're going to set up a discord notification.

  • Grad the webhook URL for the channel you wanna receive the message on, instructions found here

  • Let's name our alert "AAVE Loan Warning!"

  • Let's chuck in the AAVE ghost as the avatar: https://aave.com/icons/networks/aave.svg

  • And finally our message:

Your loan health ratio is now { arg_5 / 1e18 }
Address: { fixedArgs_0 }

arg_5 is the health factor and we're dividing by 18 to get it in human-readable units. fixedArgs_0 is the argument we entered which is our address. Can also just paste your address here. See message formatting to see what other variables are available.

Step 4: Click save and relax

There you have it. We will now receive an alert if our health ratio drops below 1.2 on AAVE!


You have a real-time Alert running 24/7!

Please submit feedback, bug reports or feature requests here, and share DeNotify with your friends!

Last updated