Skip to content

Commit

Permalink
Change to get aaveOracle address on the fly from addressProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
ckoopmann committed Aug 2, 2023
1 parent 140f09b commit 0a69def
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions contracts/adapters/AaveV3LeverageStrategyExtension.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ contract AaveV3LeverageStrategyExtension is AaveLeverageStrategyExtension {
IPoolAddressesProvider public lendingPoolAddressesProvider;
uint256 public maxOraclePriceAge;
bool public overrideNoRebalanceInProgress;
IAaveOracle public aaveOracle;

constructor(
IBaseManager _manager,
Expand All @@ -68,7 +67,6 @@ contract AaveV3LeverageStrategyExtension is AaveLeverageStrategyExtension {
{
lendingPoolAddressesProvider = _lendingPoolAddressesProvider;
maxOraclePriceAge = _maxOraclePriceAge;
aaveOracle = IAaveOracle(IPoolAddressesProvider(lendingPoolAddressesProvider).getPriceOracle());
}

/* ============ Modifiers ============ */
Expand Down Expand Up @@ -213,6 +211,7 @@ contract AaveV3LeverageStrategyExtension is AaveLeverageStrategyExtension {
}

function _getAssetPrice(address _asset, uint256 _decimalAdjustment) internal view returns (uint256) {
IAaveOracle aaveOracle = IAaveOracle(IPoolAddressesProvider(lendingPoolAddressesProvider).getPriceOracle());
uint256 rawPrice = aaveOracle.getAssetPrice(_asset);
return rawPrice.mul(10 ** _decimalAdjustment);
}
Expand Down

0 comments on commit 0a69def

Please sign in to comment.