mirror of
https://github.com/Instadapp/dsa-resolvers-deprecated.git
synced 2024-07-29 22:38:16 +00:00
Merge branch 'master' of https://github.com/InstaDApp/dsa-resolvers
This commit is contained in:
commit
40adca2f52
|
|
@ -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";
|
||||||
}
|
}
|
||||||
|
|
@ -176,6 +176,9 @@ contract AaveHelpers is DSMath {
|
||||||
bool stableBorrowEnabled;
|
bool stableBorrowEnabled;
|
||||||
bool isActive;
|
bool isActive;
|
||||||
bool isFrozen;
|
bool isFrozen;
|
||||||
|
uint availableLiquidity;
|
||||||
|
uint totalStableDebt;
|
||||||
|
uint totalVariableDebt;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct TokenPrice {
|
struct TokenPrice {
|
||||||
|
|
@ -221,6 +224,8 @@ contract AaveHelpers is DSMath {
|
||||||
uint tokenPriceInEth,
|
uint tokenPriceInEth,
|
||||||
uint tokenPriceInUsd
|
uint tokenPriceInUsd
|
||||||
) internal view returns(AaveUserTokenData memory tokenData) {
|
) internal view returns(AaveUserTokenData memory tokenData) {
|
||||||
|
AaveTokenData memory aaveTokenData = collateralData(aaveData, token);
|
||||||
|
|
||||||
(
|
(
|
||||||
tokenData.supplyBalance,
|
tokenData.supplyBalance,
|
||||||
tokenData.stableBorrowBalance,
|
tokenData.stableBorrowBalance,
|
||||||
|
|
@ -230,15 +235,15 @@ contract AaveHelpers is DSMath {
|
||||||
) = aaveData.getUserReserveData(token, user);
|
) = aaveData.getUserReserveData(token, user);
|
||||||
|
|
||||||
(
|
(
|
||||||
,,,
|
aaveTokenData.availableLiquidity,
|
||||||
|
aaveTokenData.totalStableDebt,
|
||||||
|
aaveTokenData.totalVariableDebt,
|
||||||
tokenData.supplyRate,
|
tokenData.supplyRate,
|
||||||
tokenData.variableBorrowRate,
|
tokenData.variableBorrowRate,
|
||||||
tokenData.stableBorrowRate,
|
tokenData.stableBorrowRate,
|
||||||
,,,
|
,,,
|
||||||
) = aaveData.getReserveData(token);
|
) = aaveData.getReserveData(token);
|
||||||
|
|
||||||
AaveTokenData memory aaveTokenData = collateralData(aaveData, token);
|
|
||||||
|
|
||||||
tokenData.tokenPriceInEth = tokenPriceInEth;
|
tokenData.tokenPriceInEth = tokenPriceInEth;
|
||||||
tokenData.tokenPriceInUsd = tokenPriceInUsd;
|
tokenData.tokenPriceInUsd = tokenPriceInUsd;
|
||||||
tokenData.aaveTokenData = aaveTokenData;
|
tokenData.aaveTokenData = aaveTokenData;
|
||||||
|
|
@ -295,5 +300,5 @@ contract Resolver is AaveHelpers {
|
||||||
}
|
}
|
||||||
|
|
||||||
contract InstaAaveV2Resolver is Resolver {
|
contract InstaAaveV2Resolver is Resolver {
|
||||||
string public constant name = "AaveV2-Resolver-v1.2";
|
string public constant name = "AaveV2-Resolver-v1.3";
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user