# Oracle Price miss matched when E-mode uses single oracle

Index's AaveLeverageStrategyExtension used its own Chainlink feeds, so when Aave V3 E-mode enables a single oracle, collateral/borrow values diverge, mis-sizing rebalances and risking liquidation.

- Payout: Contest reward
- Severity: medium
- Program: Index
- Credited: 0x52
- Disclosed: 2023-05-11
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2023-05-Index-judging/issues/323
- Library page: https://bugbountylibrary.com/r/sherlock%3A2023-05-Index%3AM-9
- Tags: domain:web3 impact:funds-loss kind:contest platform:sherlock sev:medium tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:liquidation vuln:oracle-manipulation

**Target:** AaveLeverageStrategyExtension rebalance logic (Solidity contract)
**Root cause:** _getAndValidateLeverageInfo computes collateralValue/borrowValue from Index's own Chainlink oracles, ignoring that Aave V3 E-mode may value both assets via a single oracle feed, so the two systems price assets differently.
**Steps:**
1. Note Aave V3 E-mode category can enable single-oracle mode at any time, making both assets use one feed (e.g. feed1).
2. Index still prices X via feed1 and Y via feed2.
3. Call _calculateMaxBorrowCollateral: netBorrowLimit = collateralValue * maxLtv * (1 - unutilizedLeveragePercentage) - borrowValue, divided by collateralPrice.
4. If feeds diverge, netBorrowLimit/netRepayLimit are wrong, so lever/dislever amounts deviate from the intended safety parameter.
**How found:** Researcher read Aave V3 E-mode single-oracle feature and compared it to Index's independent oracle usage in _getAndValidateLeverageInfo, realizing the two valuations can diverge.
**Exploitation:** No direct attacker path; the flaw is triggered when Aave enables single-oracle E-mode and feeds de-peg, causing Index to over-borrow (overriding unutilizedLeveragePercentage) or under-delever, raising liquidation risk and breaking ripcord()/disengage().
**Insight:** When a protocol integrates an external lending market, check whether that market's oracle configuration (e.g. E-mode single oracle) can change independently of your own price feeds; any divergence silently corrupts LTV-based sizing math.
