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 { | ||||
|     struct AssetData { | ||||
|         uint128 emissionPerSecond; | ||||
|         uint128 lastUpdateTimestamp; | ||||
|         uint256 index; | ||||
|     } | ||||
| 
 | ||||
|     function getRewardsBalance( | ||||
|         address[] calldata assets, | ||||
|         address user | ||||
|     ) external view returns (uint256); | ||||
| 
 | ||||
|     function assets( | ||||
|         address asset | ||||
|     ) external view returns (AssetData memory); | ||||
| } | ||||
| 
 | ||||
| interface ChainLinkInterface { | ||||
|  | @ -201,6 +211,8 @@ contract AaveHelpers is DSMath { | |||
|         uint availableLiquidity; | ||||
|         uint totalStableDebt; | ||||
|         uint totalVariableDebt; | ||||
|         uint collateralEmission; | ||||
|         uint debtEmission; | ||||
|     } | ||||
| 
 | ||||
|      struct TokenPrice { | ||||
|  | @ -237,6 +249,20 @@ contract AaveHelpers is DSMath { | |||
|             aaveTokenData.isActive, | ||||
|             aaveTokenData.isFrozen | ||||
|         ) = 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( | ||||
|  | @ -337,5 +363,5 @@ contract Resolver is AaveHelpers { | |||
| } | ||||
| 
 | ||||
| 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 { | ||||
|     struct AssetData { | ||||
|         uint128 emissionPerSecond; | ||||
|         uint128 lastUpdateTimestamp; | ||||
|         uint256 index; | ||||
|     } | ||||
| 
 | ||||
|     function getRewardsBalance( | ||||
|         address[] calldata assets, | ||||
|         address user | ||||
|     ) external view returns (uint256); | ||||
| 
 | ||||
|     function assets( | ||||
|         address asset | ||||
|     ) external view returns (AssetData memory); | ||||
| } | ||||
| 
 | ||||
| interface ChainLinkInterface { | ||||
|  | @ -197,6 +207,8 @@ contract AaveHelpers is DSMath { | |||
|         uint availableLiquidity; | ||||
|         uint totalStableDebt; | ||||
|         uint totalVariableDebt; | ||||
|         uint collateralEmission; | ||||
|         uint debtEmission; | ||||
|     } | ||||
| 
 | ||||
|      struct TokenPrice { | ||||
|  | @ -233,6 +245,20 @@ contract AaveHelpers is DSMath { | |||
|             aaveTokenData.isActive, | ||||
|             aaveTokenData.isFrozen | ||||
|         ) = 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( | ||||
|  | @ -333,5 +359,5 @@ contract Resolver is AaveHelpers { | |||
| } | ||||
| 
 | ||||
| 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
	 Mubaris NK
						Mubaris NK