mirror of
https://github.com/Instadapp/dsa-resolvers-deprecated.git
synced 2024-07-29 22:38:16 +00:00
Add emission details
This commit is contained in:
parent
237090f566
commit
c7fda67f38
|
@ -71,10 +71,20 @@ interface AavePriceOracle {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface AaveIncentivesInterface {
|
interface AaveIncentivesInterface {
|
||||||
|
struct AssetData {
|
||||||
|
uint128 emissionPerSecond;
|
||||||
|
uint128 lastUpdateTimestamp;
|
||||||
|
uint256 index;
|
||||||
|
}
|
||||||
|
|
||||||
function getRewardsBalance(
|
function getRewardsBalance(
|
||||||
address[] calldata assets,
|
address[] calldata assets,
|
||||||
address user
|
address user
|
||||||
) external view returns (uint256);
|
) external view returns (uint256);
|
||||||
|
|
||||||
|
function assets(
|
||||||
|
address asset
|
||||||
|
) external view returns (AssetData memory);
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ChainLinkInterface {
|
interface ChainLinkInterface {
|
||||||
|
@ -201,6 +211,8 @@ contract AaveHelpers is DSMath {
|
||||||
uint availableLiquidity;
|
uint availableLiquidity;
|
||||||
uint totalStableDebt;
|
uint totalStableDebt;
|
||||||
uint totalVariableDebt;
|
uint totalVariableDebt;
|
||||||
|
uint collateralEmission;
|
||||||
|
uint debtEmission;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct TokenPrice {
|
struct TokenPrice {
|
||||||
|
@ -237,6 +249,20 @@ contract AaveHelpers is DSMath {
|
||||||
aaveTokenData.isActive,
|
aaveTokenData.isActive,
|
||||||
aaveTokenData.isFrozen
|
aaveTokenData.isFrozen
|
||||||
) = aaveData.getReserveConfigurationData(token);
|
) = aaveData.getReserveConfigurationData(token);
|
||||||
|
|
||||||
|
(
|
||||||
|
address aToken,
|
||||||
|
,
|
||||||
|
address debtToken
|
||||||
|
) = aaveData.getReserveTokensAddresses(token);
|
||||||
|
|
||||||
|
AaveIncentivesInterface.AssetData memory _data;
|
||||||
|
AaveIncentivesInterface incentives = AaveIncentivesInterface(getAaveIncentivesAddress());
|
||||||
|
|
||||||
|
_data = incentives.assets(aToken);
|
||||||
|
aaveTokenData.collateralEmission = _data.emissionPerSecond;
|
||||||
|
_data = incentives.assets(debtToken);
|
||||||
|
aaveTokenData.debtEmission = _data.emissionPerSecond;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTokenData(
|
function getTokenData(
|
||||||
|
@ -337,5 +363,5 @@ contract Resolver is AaveHelpers {
|
||||||
}
|
}
|
||||||
|
|
||||||
contract InstaAaveV2Resolver is Resolver {
|
contract InstaAaveV2Resolver is Resolver {
|
||||||
string public constant name = "AaveV2-Resolver-v1.5";
|
string public constant name = "AaveV2-Resolver-v1.6";
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,10 +71,20 @@ interface AavePriceOracle {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface AaveIncentivesInterface {
|
interface AaveIncentivesInterface {
|
||||||
|
struct AssetData {
|
||||||
|
uint128 emissionPerSecond;
|
||||||
|
uint128 lastUpdateTimestamp;
|
||||||
|
uint256 index;
|
||||||
|
}
|
||||||
|
|
||||||
function getRewardsBalance(
|
function getRewardsBalance(
|
||||||
address[] calldata assets,
|
address[] calldata assets,
|
||||||
address user
|
address user
|
||||||
) external view returns (uint256);
|
) external view returns (uint256);
|
||||||
|
|
||||||
|
function assets(
|
||||||
|
address asset
|
||||||
|
) external view returns (AssetData memory);
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ChainLinkInterface {
|
interface ChainLinkInterface {
|
||||||
|
@ -197,6 +207,8 @@ contract AaveHelpers is DSMath {
|
||||||
uint availableLiquidity;
|
uint availableLiquidity;
|
||||||
uint totalStableDebt;
|
uint totalStableDebt;
|
||||||
uint totalVariableDebt;
|
uint totalVariableDebt;
|
||||||
|
uint collateralEmission;
|
||||||
|
uint debtEmission;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct TokenPrice {
|
struct TokenPrice {
|
||||||
|
@ -233,6 +245,20 @@ contract AaveHelpers is DSMath {
|
||||||
aaveTokenData.isActive,
|
aaveTokenData.isActive,
|
||||||
aaveTokenData.isFrozen
|
aaveTokenData.isFrozen
|
||||||
) = aaveData.getReserveConfigurationData(token);
|
) = aaveData.getReserveConfigurationData(token);
|
||||||
|
|
||||||
|
(
|
||||||
|
address aToken,
|
||||||
|
,
|
||||||
|
address debtToken
|
||||||
|
) = aaveData.getReserveTokensAddresses(token);
|
||||||
|
|
||||||
|
AaveIncentivesInterface.AssetData memory _data;
|
||||||
|
AaveIncentivesInterface incentives = AaveIncentivesInterface(getAaveIncentivesAddress());
|
||||||
|
|
||||||
|
_data = incentives.assets(aToken);
|
||||||
|
aaveTokenData.collateralEmission = _data.emissionPerSecond;
|
||||||
|
_data = incentives.assets(debtToken);
|
||||||
|
aaveTokenData.debtEmission = _data.emissionPerSecond;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTokenData(
|
function getTokenData(
|
||||||
|
@ -333,5 +359,5 @@ contract Resolver is AaveHelpers {
|
||||||
}
|
}
|
||||||
|
|
||||||
contract InstaAaveV2Resolver is Resolver {
|
contract InstaAaveV2Resolver is Resolver {
|
||||||
string public constant name = "AaveV2-Resolver-v1.5";
|
string public constant name = "AaveV2-Resolver-v1.6";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user