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 {
|
interface AaveAddressProvider {
|
||||||
function getLendingPool() external view returns (address);
|
function getLendingPool() external view returns (address);
|
||||||
function getPriceOracle() external view returns (address);
|
function getPriceOracle() external view returns (address);
|
||||||
|
@ -208,6 +212,7 @@ contract AaveHelpers is DSMath {
|
||||||
bool stableBorrowEnabled;
|
bool stableBorrowEnabled;
|
||||||
bool isActive;
|
bool isActive;
|
||||||
bool isFrozen;
|
bool isFrozen;
|
||||||
|
uint totalSupply;
|
||||||
uint availableLiquidity;
|
uint availableLiquidity;
|
||||||
uint totalStableDebt;
|
uint totalStableDebt;
|
||||||
uint totalVariableDebt;
|
uint totalVariableDebt;
|
||||||
|
@ -263,6 +268,7 @@ contract AaveHelpers is DSMath {
|
||||||
aaveTokenData.collateralEmission = _data.emissionPerSecond;
|
aaveTokenData.collateralEmission = _data.emissionPerSecond;
|
||||||
_data = incentives.assets(debtToken);
|
_data = incentives.assets(debtToken);
|
||||||
aaveTokenData.debtEmission = _data.emissionPerSecond;
|
aaveTokenData.debtEmission = _data.emissionPerSecond;
|
||||||
|
aaveTokenData.totalSupply = TokenInterface(aToken).totalSupply();
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTokenData(
|
function getTokenData(
|
||||||
|
|
|
@ -10,6 +10,7 @@ interface CTokenInterface {
|
||||||
|
|
||||||
function underlying() external view returns (address);
|
function underlying() external view returns (address);
|
||||||
function balanceOf(address) external view returns (uint);
|
function balanceOf(address) external view returns (uint);
|
||||||
|
function getCash() external view returns (uint);
|
||||||
}
|
}
|
||||||
|
|
||||||
interface TokenInterface {
|
interface TokenInterface {
|
||||||
|
@ -30,6 +31,7 @@ interface ComptrollerLensInterface {
|
||||||
function borrowCaps(address) external view returns (uint);
|
function borrowCaps(address) external view returns (uint);
|
||||||
function borrowGuardianPaused(address) external view returns (bool);
|
function borrowGuardianPaused(address) external view returns (bool);
|
||||||
function oracle() external view returns (address);
|
function oracle() external view returns (address);
|
||||||
|
function compSpeeds(address) external view returns (uint);
|
||||||
}
|
}
|
||||||
|
|
||||||
interface CompReadInterface {
|
interface CompReadInterface {
|
||||||
|
@ -117,10 +119,12 @@ contract Helpers is DSMath {
|
||||||
uint balanceOfUser;
|
uint balanceOfUser;
|
||||||
uint borrowBalanceStoredUser;
|
uint borrowBalanceStoredUser;
|
||||||
uint totalBorrows;
|
uint totalBorrows;
|
||||||
|
uint totalSupplied;
|
||||||
uint borrowCap;
|
uint borrowCap;
|
||||||
uint supplyRatePerBlock;
|
uint supplyRatePerBlock;
|
||||||
uint borrowRatePerBlock;
|
uint borrowRatePerBlock;
|
||||||
uint collateralFactor;
|
uint collateralFactor;
|
||||||
|
uint compSpeed;
|
||||||
bool isComped;
|
bool isComped;
|
||||||
bool isBorrowPaused;
|
bool isBorrowPaused;
|
||||||
}
|
}
|
||||||
|
@ -144,17 +148,20 @@ contract Resolver is Helpers {
|
||||||
CTokenInterface cToken = CTokenInterface(cAddress[i]);
|
CTokenInterface cToken = CTokenInterface(cAddress[i]);
|
||||||
(uint priceInETH, uint priceInUSD) = getPriceInEth(cToken);
|
(uint priceInETH, uint priceInUSD) = getPriceInEth(cToken);
|
||||||
(,uint collateralFactor, bool isComped) = troller.markets(address(cToken));
|
(,uint collateralFactor, bool isComped) = troller.markets(address(cToken));
|
||||||
|
uint _totalBorrowed = cToken.totalBorrows();
|
||||||
tokensData[i] = CompData(
|
tokensData[i] = CompData(
|
||||||
priceInETH,
|
priceInETH,
|
||||||
priceInUSD,
|
priceInUSD,
|
||||||
cToken.exchangeRateStored(),
|
cToken.exchangeRateStored(),
|
||||||
cToken.balanceOf(owner),
|
cToken.balanceOf(owner),
|
||||||
cToken.borrowBalanceStored(owner),
|
cToken.borrowBalanceStored(owner),
|
||||||
cToken.totalBorrows(),
|
_totalBorrowed,
|
||||||
|
add(_totalBorrowed, cToken.getCash()),
|
||||||
troller.borrowCaps(cAddress[i]),
|
troller.borrowCaps(cAddress[i]),
|
||||||
cToken.supplyRatePerBlock(),
|
cToken.supplyRatePerBlock(),
|
||||||
cToken.borrowRatePerBlock(),
|
cToken.borrowRatePerBlock(),
|
||||||
collateralFactor,
|
collateralFactor,
|
||||||
|
troller.compSpeeds(cAddress[i]),
|
||||||
isComped,
|
isComped,
|
||||||
troller.borrowGuardianPaused(cAddress[i])
|
troller.borrowGuardianPaused(cAddress[i])
|
||||||
);
|
);
|
||||||
|
|
|
@ -58,6 +58,10 @@ interface AaveLendingPool {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface TokenInterface {
|
||||||
|
function totalSupply() external view returns (uint);
|
||||||
|
}
|
||||||
|
|
||||||
interface AaveAddressProvider {
|
interface AaveAddressProvider {
|
||||||
function getLendingPool() external view returns (address);
|
function getLendingPool() external view returns (address);
|
||||||
function getPriceOracle() external view returns (address);
|
function getPriceOracle() external view returns (address);
|
||||||
|
@ -204,6 +208,7 @@ contract AaveHelpers is DSMath {
|
||||||
bool stableBorrowEnabled;
|
bool stableBorrowEnabled;
|
||||||
bool isActive;
|
bool isActive;
|
||||||
bool isFrozen;
|
bool isFrozen;
|
||||||
|
uint totalSupply;
|
||||||
uint availableLiquidity;
|
uint availableLiquidity;
|
||||||
uint totalStableDebt;
|
uint totalStableDebt;
|
||||||
uint totalVariableDebt;
|
uint totalVariableDebt;
|
||||||
|
@ -259,6 +264,7 @@ contract AaveHelpers is DSMath {
|
||||||
aaveTokenData.collateralEmission = _data.emissionPerSecond;
|
aaveTokenData.collateralEmission = _data.emissionPerSecond;
|
||||||
_data = incentives.assets(debtToken);
|
_data = incentives.assets(debtToken);
|
||||||
aaveTokenData.debtEmission = _data.emissionPerSecond;
|
aaveTokenData.debtEmission = _data.emissionPerSecond;
|
||||||
|
aaveTokenData.totalSupply = TokenInterface(aToken).totalSupply();
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTokenData(
|
function getTokenData(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user