diff --git a/contracts/misc/UiPoolDataProviderV2V3.sol b/contracts/misc/UiPoolDataProviderV2V3.sol index a11c9572..31e3b556 100644 --- a/contracts/misc/UiPoolDataProviderV2V3.sol +++ b/contracts/misc/UiPoolDataProviderV2V3.sol @@ -43,6 +43,7 @@ contract UiPoolDataProviderV2V3 is IUiPoolDataProviderV3 { uint256, uint256, uint256, + uint256, uint256 ) { @@ -50,7 +51,8 @@ contract UiPoolDataProviderV2V3 is IUiPoolDataProviderV3 { interestRateStrategy.variableRateSlope1(), interestRateStrategy.variableRateSlope2(), interestRateStrategy.stableRateSlope1(), - interestRateStrategy.stableRateSlope2() + interestRateStrategy.stableRateSlope2(), + interestRateStrategy.OPTIMAL_UTILIZATION_RATE() ); } @@ -96,6 +98,7 @@ contract UiPoolDataProviderV2V3 is IUiPoolDataProviderV3 { reserveData.priceInMarketReferenceCurrency = oracle.getAssetPrice( reserveData.underlyingAsset ); + reserveData.priceOracle = oracle.getSourceOfAsset(reserveData.underlyingAsset); reserveData.availableLiquidity = IERC20Detailed(reserveData.underlyingAsset).balanceOf( reserveData.aTokenAddress @@ -134,7 +137,8 @@ contract UiPoolDataProviderV2V3 is IUiPoolDataProviderV3 { reserveData.variableRateSlope1, reserveData.variableRateSlope2, reserveData.stableRateSlope1, - reserveData.stableRateSlope2 + reserveData.stableRateSlope2, + reserveData.optimalUsageRatio ) = getInterestRateStrategySlopes( DefaultReserveInterestRateStrategy(reserveData.interestRateStrategyAddress) ); diff --git a/contracts/misc/interfaces/IAaveOracle.sol b/contracts/misc/interfaces/IAaveOracle.sol index 3ecc82b6..7a1b7554 100644 --- a/contracts/misc/interfaces/IAaveOracle.sol +++ b/contracts/misc/interfaces/IAaveOracle.sol @@ -14,4 +14,11 @@ interface IAaveOracle { @dev returns the asset price in ETH */ function getAssetPrice(address asset) external view returns (uint256); + + /** + * @notice Returns the address of the source for an asset address + * @param asset The address of the asset + * @return The address of the source + */ + function getSourceOfAsset(address asset) external view returns (address); } \ No newline at end of file diff --git a/contracts/misc/interfaces/IUiPoolDataProviderV3.sol b/contracts/misc/interfaces/IUiPoolDataProviderV3.sol index 6153a526..55144b86 100644 --- a/contracts/misc/interfaces/IUiPoolDataProviderV3.sol +++ b/contracts/misc/interfaces/IUiPoolDataProviderV3.sol @@ -37,10 +37,12 @@ interface IUiPoolDataProviderV3 { uint256 stableDebtLastUpdateTimestamp; uint256 totalScaledVariableDebt; uint256 priceInMarketReferenceCurrency; + address priceOracle; uint256 variableRateSlope1; uint256 variableRateSlope2; uint256 stableRateSlope1; uint256 stableRateSlope2; + uint256 optimalUsageRatio; // v3 bool isPaused; uint128 accruedToTreasury;