How to compute how a withdrawal or borrowing of assets will affect our health factor?

Expert

Is there anyway to compute how a withdrawal or borrowing of assets will affect our health factor before making the actual smart contract call?

Answers 1

You can compute the new health factor by looping through all supplied and borrowed reserves in Aave Protocol to compute the new collateral balances, borrow balances, and LTV then convert this to HF with this function