aave / aave-utilities

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Received -1 Health factor for several user accounts in aave v3 protocol

Samboy76 opened this issue · comments

Question

As per the docs https://github.com/aave/aave-utilities for computing below userReserves for a particular user account (currentAccount) through the below code snippet:

const userReserves = await poolDataProviderContract.getUserReservesHumanized({
lendingPoolAddressProvider: markets.AaveV3Arbitrum.POOL_ADDRESSES_PROVIDER,
user: currentAccount,
});

const userReservesArray = userReserves.userReserves;

const userSummary = formatUserSummary({
currentTimestamp,
marketReferencePriceInUsd: baseCurrencyData.marketReferenceCurrencyPriceInUsd,
marketReferenceCurrencyDecimals:
baseCurrencyData.marketReferenceCurrencyDecimals,
userReserves: userReservesArray,
formattedReserves: formattedPoolReserves,
userEmodeCategoryId: userReserves.userEmodeCategoryId,
});

// Access the healthFactor value directly
const healthFactor = userSummary.healthFactor;

The question is what does HF of -1 actually means in this context and whether it fulfils legimate condition of HF < 1 to trigger off liquidation process. It seems it is not a valid value and suggests it´s something wrong with the state of user account holdings or collateralised posititions held in the aave v3 protocol itself as despite receiving several user accounts of -1 HF values there are a handful which actually returned valid HF > 1 which suggests to be in healthy state therefore not requiring their user account holdings to be liquidated.

Would greatly appreciate your help and guidance and whether I should be selecting only those user accounts that returns -1 < HF < 1 to trigger off liquidateCall functions to initiate the liquidation process.

Thank you