feat: added new fields needed for client calculations

This commit is contained in:
sendra 2022-02-03 12:49:06 +01:00
parent d998c2f4c7
commit 049c84e436
3 changed files with 15 additions and 2 deletions

View File

@ -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)
);

View File

@ -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);
}

View File

@ -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;