# BondOracleAdapter will cause massive loss of funds for a large number of bond tokens

BondOracleAdapter returns DEX pool price directly and hardcodes oracle decimals to bondToken, mispricing any bond token not sorted as tokenB, causing redeemers to lose funds.

- Payout: Audit contest
- Severity: high
- Program: Plaza Finance
- Found by: 0x52
- Disclosed: 2024-12-16
- Write-up quality: 7/10
- Original: https://github.com/sherlock-audit/2024-12-plaza-finance-judging/issues/440
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-12-plaza-finance%3AH-4
- Tags: area:web3 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:** BondOracleAdapter / Slipstream CL pool oracle
**Root cause:** Adapter returns the pool's raw price without accounting for token ordering, while hardcoding oracle decimals to bondToken.decimals(); if bondToken is tokenA (not tokenB), the price is denominated in the wrong token/decimals.
**Steps:**
1. Note CLFactory populates getPool in both token orders, so retrieved pool may have bondToken as tokenA or tokenB.
2. BondOracleAdapter.initialize pulls pool from getPool without verifying token order.
3. Adapter hardcodes decimals to bondToken.decimals() and returns getPriceX96FromSqrtPriceX96 directly.
4. If address(bondToken) > address(liquidityToken), bondToken is tokenA and returned price is in liquidity token units, not bond token units.
5. Pool.redeem uses marketRate if lower than redeemRate, so mispriced low marketRate reduces redemption payout, draining value from bond holders.
**How found:** Code reading: noticed getPool mapping is populated in both directions (deliberate to avoid address comparison), so pool token ordering is not guaranteed; combined with adapter returning raw pool price and hardcoding decimals to bondToken, deduced mispricing for tokens not sorted as tokenB.
**Insight:** When integrating a DEX oracle, verify which token is token0/token1 in the pool and scale price accordingly; mappings populated in both directions hide ordering assumptions that break decimal math.

