Aave v2
Web3 Sheets Demo: Aave v2
Example Explanation
This demonstration features the calling of custom functions to determine multiple tokens on with AAVE ERC-20 tokens. Using various CALLINT functions with custom functions such as; getReserveConfigurationData(address), seen in rows H-N. The custom above functions are used to calculate different actions like available tokens, the price in Ethereum, the liquidation threshold, and more.
Key functions as featured in this sheet:
=CALLADDRESS("","0xFFC97d72E13E01096502Cb8Eb52dEe56f74DAD7B","UNDERLYING_ASSET_ADDRESS()")
- to get the underlying asset address of the aToken.=CALLINT("",COPS("0xa50ba011c48153de246e5192c8f9258a2ba79ca9",$D$41),"getAssetPrice(address)",$B2)*10^-18
- to determine token pricing.=CALLINT("1","0x057835Ad21a177dbdd3090bB1CAE03EaCF78Fc6d","getReserveConfigurationData(address)",$B2)/10000
- to determine loan to value ratio.=CALLINT("3","0x057835Ad21a177dbdd3090bB1CAE03EaCF78Fc6d","getReserveData(address)","0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48")*10^-27
- to calculate the variable borrow rate.