# Market rate never used due to decimal discrepancy

Decimal mismatch between 18dp marketRate and 6dp redeemRate in Pool.sol makes the marketRate<redeemRate check always false, so redemptions ignore market price.

- Payout: Audit contest
- Severity: medium
- Program: Plaza Finance
- Found by: 0x52
- Disclosed: 2024-12-16
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2024-12-plaza-finance-judging/issues/561
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-12-plaza-finance%3AM-9
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:medium tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:oracle-manipulation

**Target:** Pool.sol simulateRedeem / getRedeemAmount redemption pricing
**Root cause:** marketRate is normalized to oracleDecimals (18dp from BalancerOracleAdapter) while redeemRate uses PRECISION=1e6 (6dp); comparing them directly makes marketRate<redeemRate always false.
**Steps:**
1. Register a Chainlink feed for bondToken in OracleFeeds so marketRate path executes.
2. Call redeem; simulateRedeem computes marketRate normalized to 18dp via getOracleDecimals.
3. redeemRate computed at 6dp (BOND_TARGET_PRICE*PRECISION=100e6).
4. Condition `marketRate < redeemRate` evaluates false due to magnitude difference.
5. getRedeemAmount uses redeemRate, ignoring true market rate.
**How found:** Code reading of simulateRedeem: noticed redeemRate implicitly 6dp while marketRate normalized to oracleDecimals; traced BalancerOracleAdapter to confirm 18dp normalization, concluding comparison always false.
**Exploitation:** Any redeemer benefits: when true market rate is below redeemRate, the check fails to trigger and users receive more reserve tokens than the market rate would allow, draining value from the pool.
**Insight:** When comparing two oracle-derived rates, verify both are normalized to the same decimals; a rate normalized to feed decimals (often 18) compared against a PRECISION-scaled constant (1e6) silently disables the guard.

