Update Aave v2 resolver to include liquidity params

This commit is contained in:
Mubaris NK 2021-01-19 17:34:17 +05:30
parent e0ba523772
commit 7a6a0bfd9c
No known key found for this signature in database
GPG Key ID: 1F132294E8700320

View File

@ -176,6 +176,9 @@ contract AaveHelpers is DSMath {
bool stableBorrowEnabled;
bool isActive;
bool isFrozen;
uint availableLiquidity;
uint totalStableDebt;
uint totalVariableDebt;
}
struct TokenPrice {
@ -221,6 +224,8 @@ contract AaveHelpers is DSMath {
uint tokenPriceInEth,
uint tokenPriceInUsd
) internal view returns(AaveUserTokenData memory tokenData) {
AaveTokenData memory aaveTokenData = collateralData(aaveData, token);
(
tokenData.supplyBalance,
tokenData.stableBorrowBalance,
@ -230,15 +235,15 @@ contract AaveHelpers is DSMath {
) = aaveData.getUserReserveData(token, user);
(
,,,
aaveTokenData.availableLiquidity,
aaveTokenData.totalStableDebt,
aaveTokenData.totalVariableDebt,
tokenData.supplyRate,
tokenData.variableBorrowRate,
tokenData.stableBorrowRate,
,,,
) = aaveData.getReserveData(token);
AaveTokenData memory aaveTokenData = collateralData(aaveData, token);
tokenData.tokenPriceInEth = tokenPriceInEth;
tokenData.tokenPriceInUsd = tokenPriceInUsd;
tokenData.aaveTokenData = aaveTokenData;