# CurveTricryptoOracle incorrectly assumes that WETH is always the last token in the pool which leads to bad LP pricing

CurveTricryptoOracle hardcodes WETH as tokens[2] in tricrypto pools, mispricing LP tokens for pools where WETH isn't last, enabling overborrowing.

- Payout: Contest reward
- Severity: high
- Program: Blueberry
- Credited: 0x52
- Disclosed: 2023-07-12
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2023-07-blueberry-judging/issues/98
- Library page: https://bugbountylibrary.com/r/sherlock%3A2023-07-blueberry%3AH-2
- Tags: domain:web3 impact:funds-loss kind:contest platform:sherlock sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:oracle-manipulation

**Target:** CurveTricryptoOracle LP price oracle
**Root cause:** getPrice assumes tokens[2] is always WETH and uses its price as the ETH price in lpPrice, but many tricrypto pools have a different asset at index 2.
**Steps:**
1. Read CurveTricryptoOracle.sol#L53-L63: when tokens.length==3, ethPrice = base.getPrice(tokens[2]) and lpPrice is computed with that as ETH price.
2. Enumerate mainnet tricrypto pools; note 0x4ebdf703... (CRV), 0x54261787... (INV), 0x2889302a... (wstETH) have non-WETH at tokens[2].
3. For such a pool, getPrice(tokens[2]) returns the price of CRV/INV/wstETH instead of ETH, distorting the lpPrice formula.
4. Resulting LP price is massively inflated relative to true value.
**How found:** Manual code review of the oracle's token-index assumption, cross-checked against actual deployed tricrypto pool token orderings on mainnet.
**Exploitation:** Attacker supplies the mispriced LP as collateral; oracle overvalues it, allowing overborrowing beyond true collateral value, risking protocol insolvency.
**Insight:** When an oracle hardcodes a token position (e.g. 'tokens[2] is WETH'), verify against every deployed pool instance—Curve tricrypto pools vary in token ordering, so index assumptions silently misprice collateral.
