Skip to content

Commit 049c84e

Browse files
committed
feat: added new fields needed for client calculations
1 parent d998c2f commit 049c84e

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

contracts/misc/UiPoolDataProviderV2V3.sol

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,16 @@ contract UiPoolDataProviderV2V3 is IUiPoolDataProviderV3 {
4343
uint256,
4444
uint256,
4545
uint256,
46+
uint256,
4647
uint256
4748
)
4849
{
4950
return (
5051
interestRateStrategy.variableRateSlope1(),
5152
interestRateStrategy.variableRateSlope2(),
5253
interestRateStrategy.stableRateSlope1(),
53-
interestRateStrategy.stableRateSlope2()
54+
interestRateStrategy.stableRateSlope2(),
55+
interestRateStrategy.OPTIMAL_UTILIZATION_RATE()
5456
);
5557
}
5658

@@ -96,6 +98,7 @@ contract UiPoolDataProviderV2V3 is IUiPoolDataProviderV3 {
9698
reserveData.priceInMarketReferenceCurrency = oracle.getAssetPrice(
9799
reserveData.underlyingAsset
98100
);
101+
reserveData.priceOracle = oracle.getSourceOfAsset(reserveData.underlyingAsset);
99102

100103
reserveData.availableLiquidity = IERC20Detailed(reserveData.underlyingAsset).balanceOf(
101104
reserveData.aTokenAddress
@@ -134,7 +137,8 @@ contract UiPoolDataProviderV2V3 is IUiPoolDataProviderV3 {
134137
reserveData.variableRateSlope1,
135138
reserveData.variableRateSlope2,
136139
reserveData.stableRateSlope1,
137-
reserveData.stableRateSlope2
140+
reserveData.stableRateSlope2,
141+
reserveData.optimalUsageRatio
138142
) = getInterestRateStrategySlopes(
139143
DefaultReserveInterestRateStrategy(reserveData.interestRateStrategyAddress)
140144
);

contracts/misc/interfaces/IAaveOracle.sol

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,11 @@ interface IAaveOracle {
1414
@dev returns the asset price in ETH
1515
*/
1616
function getAssetPrice(address asset) external view returns (uint256);
17+
18+
/**
19+
* @notice Returns the address of the source for an asset address
20+
* @param asset The address of the asset
21+
* @return The address of the source
22+
*/
23+
function getSourceOfAsset(address asset) external view returns (address);
1724
}

contracts/misc/interfaces/IUiPoolDataProviderV3.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@ interface IUiPoolDataProviderV3 {
3737
uint256 stableDebtLastUpdateTimestamp;
3838
uint256 totalScaledVariableDebt;
3939
uint256 priceInMarketReferenceCurrency;
40+
address priceOracle;
4041
uint256 variableRateSlope1;
4142
uint256 variableRateSlope2;
4243
uint256 stableRateSlope1;
4344
uint256 stableRateSlope2;
45+
uint256 optimalUsageRatio;
4446
// v3
4547
bool isPaused;
4648
uint128 accruedToTreasury;

0 commit comments

Comments
 (0)