Merge pull request #11 from InstaDApp/aave-liquidity

Update Aave v1 Resolver
This commit is contained in:
Thrilok kumar 2021-01-21 19:19:30 +05:30 committed by GitHub
commit 14c0e0c02f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,6 +57,7 @@ interface AavePriceInterface {
interface AaveCoreInterface { interface AaveCoreInterface {
function getReserveCurrentLiquidityRate(address _reserve) external view returns (uint256); function getReserveCurrentLiquidityRate(address _reserve) external view returns (uint256);
function getReserveCurrentVariableBorrowRate(address _reserve) external view returns (uint256); function getReserveCurrentVariableBorrowRate(address _reserve) external view returns (uint256);
function getReserveAvailableLiquidity(address _reserve) external view returns (uint256);
} }
interface ChainLinkInterface { interface ChainLinkInterface {
@ -148,6 +149,7 @@ contract AaveHelpers is DSMath {
bool borrowEnabled; bool borrowEnabled;
bool stableBorrowEnabled; bool stableBorrowEnabled;
bool isActive; bool isActive;
uint availableLiquidity;
} }
struct TokenPrice { struct TokenPrice {
@ -181,6 +183,7 @@ contract AaveHelpers is DSMath {
aaveTokenData.stableBorrowEnabled, aaveTokenData.stableBorrowEnabled,
aaveTokenData.isActive aaveTokenData.isActive
) = aave.getReserveConfigurationData(token); ) = aave.getReserveConfigurationData(token);
return aaveTokenData; return aaveTokenData;
} }
@ -207,6 +210,7 @@ contract AaveHelpers is DSMath {
uint supplyRate = aaveCore.getReserveCurrentLiquidityRate(token); uint supplyRate = aaveCore.getReserveCurrentLiquidityRate(token);
uint borrowRate = aaveCore.getReserveCurrentVariableBorrowRate(token); uint borrowRate = aaveCore.getReserveCurrentVariableBorrowRate(token);
AaveTokenData memory aaveTokenData = collateralData(aave, token); AaveTokenData memory aaveTokenData = collateralData(aave, token);
aaveTokenData.availableLiquidity = aaveCore.getReserveAvailableLiquidity(token);
tokenData = AaveUserTokenData( tokenData = AaveUserTokenData(
priceInEth, priceInEth,
@ -265,5 +269,5 @@ contract Resolver is AaveHelpers {
} }
contract InstaAaveResolver is Resolver { contract InstaAaveResolver is Resolver {
string public constant name = "Aave-Resolver-v1.2"; string public constant name = "Aave-Resolver-v1.3";
} }