mirror of
https://github.com/Instadapp/dsa-resolvers-deprecated.git
synced 2024-07-29 22:38:16 +00:00
Add COMP Speed and total supply in Aave
This commit is contained in:
parent
c7fda67f38
commit
263d4570e6
|
@ -58,6 +58,10 @@ interface AaveLendingPool {
|
|||
);
|
||||
}
|
||||
|
||||
interface TokenInterface {
|
||||
function totalSupply() external view returns (uint);
|
||||
}
|
||||
|
||||
interface AaveAddressProvider {
|
||||
function getLendingPool() external view returns (address);
|
||||
function getPriceOracle() external view returns (address);
|
||||
|
@ -208,6 +212,7 @@ contract AaveHelpers is DSMath {
|
|||
bool stableBorrowEnabled;
|
||||
bool isActive;
|
||||
bool isFrozen;
|
||||
uint totalSupply;
|
||||
uint availableLiquidity;
|
||||
uint totalStableDebt;
|
||||
uint totalVariableDebt;
|
||||
|
@ -263,6 +268,7 @@ contract AaveHelpers is DSMath {
|
|||
aaveTokenData.collateralEmission = _data.emissionPerSecond;
|
||||
_data = incentives.assets(debtToken);
|
||||
aaveTokenData.debtEmission = _data.emissionPerSecond;
|
||||
aaveTokenData.totalSupply = TokenInterface(aToken).totalSupply();
|
||||
}
|
||||
|
||||
function getTokenData(
|
||||
|
|
|
@ -10,6 +10,7 @@ interface CTokenInterface {
|
|||
|
||||
function underlying() external view returns (address);
|
||||
function balanceOf(address) external view returns (uint);
|
||||
function getCash() external view returns (uint);
|
||||
}
|
||||
|
||||
interface TokenInterface {
|
||||
|
@ -30,6 +31,7 @@ interface ComptrollerLensInterface {
|
|||
function borrowCaps(address) external view returns (uint);
|
||||
function borrowGuardianPaused(address) external view returns (bool);
|
||||
function oracle() external view returns (address);
|
||||
function compSpeeds(address) external view returns (uint);
|
||||
}
|
||||
|
||||
interface CompReadInterface {
|
||||
|
@ -117,10 +119,12 @@ contract Helpers is DSMath {
|
|||
uint balanceOfUser;
|
||||
uint borrowBalanceStoredUser;
|
||||
uint totalBorrows;
|
||||
uint totalSupplied;
|
||||
uint borrowCap;
|
||||
uint supplyRatePerBlock;
|
||||
uint borrowRatePerBlock;
|
||||
uint collateralFactor;
|
||||
uint compSpeed;
|
||||
bool isComped;
|
||||
bool isBorrowPaused;
|
||||
}
|
||||
|
@ -144,17 +148,20 @@ contract Resolver is Helpers {
|
|||
CTokenInterface cToken = CTokenInterface(cAddress[i]);
|
||||
(uint priceInETH, uint priceInUSD) = getPriceInEth(cToken);
|
||||
(,uint collateralFactor, bool isComped) = troller.markets(address(cToken));
|
||||
uint _totalBorrowed = cToken.totalBorrows();
|
||||
tokensData[i] = CompData(
|
||||
priceInETH,
|
||||
priceInUSD,
|
||||
cToken.exchangeRateStored(),
|
||||
cToken.balanceOf(owner),
|
||||
cToken.borrowBalanceStored(owner),
|
||||
cToken.totalBorrows(),
|
||||
_totalBorrowed,
|
||||
add(_totalBorrowed, cToken.getCash()),
|
||||
troller.borrowCaps(cAddress[i]),
|
||||
cToken.supplyRatePerBlock(),
|
||||
cToken.borrowRatePerBlock(),
|
||||
collateralFactor,
|
||||
troller.compSpeeds(cAddress[i]),
|
||||
isComped,
|
||||
troller.borrowGuardianPaused(cAddress[i])
|
||||
);
|
||||
|
|
|
@ -58,6 +58,10 @@ interface AaveLendingPool {
|
|||
);
|
||||
}
|
||||
|
||||
interface TokenInterface {
|
||||
function totalSupply() external view returns (uint);
|
||||
}
|
||||
|
||||
interface AaveAddressProvider {
|
||||
function getLendingPool() external view returns (address);
|
||||
function getPriceOracle() external view returns (address);
|
||||
|
@ -204,6 +208,7 @@ contract AaveHelpers is DSMath {
|
|||
bool stableBorrowEnabled;
|
||||
bool isActive;
|
||||
bool isFrozen;
|
||||
uint totalSupply;
|
||||
uint availableLiquidity;
|
||||
uint totalStableDebt;
|
||||
uint totalVariableDebt;
|
||||
|
@ -259,6 +264,7 @@ contract AaveHelpers is DSMath {
|
|||
aaveTokenData.collateralEmission = _data.emissionPerSecond;
|
||||
_data = incentives.assets(debtToken);
|
||||
aaveTokenData.debtEmission = _data.emissionPerSecond;
|
||||
aaveTokenData.totalSupply = TokenInterface(aToken).totalSupply();
|
||||
}
|
||||
|
||||
function getTokenData(
|
||||
|
|
Loading…
Reference in New Issue
Block a user