Skip to content

Artiizan/AAVE_Account_Health_Factor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AAVE Account Health Factor Check

Repeatable solution to find the current Health Factor of a specified AAVE Wallet Address. Also returns the current block for fact checking. This work was done as a project for Wintermute Trading.

Solution Requirements

Environment Variables

  • userAddress: This is the wallet address of the user you would like to check the Health Factor of.
  • contractAddress: The address on the network of the AAVE LendingPool Smart Contract.
    The current values that you can use for the mainnets (please check the above link as these may be outdated):
    • Ethereum Mainmarket: 0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9
    • Polygon (Matic) Mainmarket: 0x8dff5e27ea6b7ac08ebfdf9eb090f32ee9a30fcf
  • infuraProjectUrl: This project connects to the blockchains using the infura nodes. As they offer both ethereum and polygon nodes for free. Get your own url from the Infura Website

Formatting

Health Factor

The health factor can be calculated manually using the AAVE formula. In this project however we are querying the AAVE LendingPool smart contract directly and making use of it's ability to return a health factor for a given account.

The health factor is shown in the console in 3 formats:

  • hex: This is the format of the health factor returned by the smart contract.
  • decimal: This is the hex formatted using the Javascript BigInt() method
  • as ether: The health factor in the AAVE UI is shown as "a percent". However, it is just the above decimal formatted using a fromWeiToEther Command (Also known as moving the decimal place 18 places).

Author

Brandon Grant
Email
Project Github

About

Repeatable solution to find the current Health Factor of a specified AAVE Wallet Address. Also returns the current block for fact checking.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published