# spTKNMinimalOracle `_calculateSpTknPerBase()` does not calculate correct price for podded or fraxlend pair pairedLpTKNs.

Peapods oracle misprices spTKN for podded/fraxlend pairedLpTKN by ignoring asset/share ratio, skewing Fraxlend borrow valuations.

- Payout: Audit contest
- Severity: high
- Program: Peapods Finance
- Found by: bretzel
- Disclosed: 2025-01-08
- Write-up quality: 7/10
- Original: https://github.com/sherlock-audit/2025-01-peapods-finance-judging/issues/445
- Library page: https://bugbountylibrary.com/r/sherlock%3A2025-01-peapods-finance%3AH-5
- 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:** spTKNMinimalOracle._calculateSpTknPerBase() price oracle
**Root cause:** The fair-LP formula assumes pairedLpTKN/baseTKN is 1:1 and applies the pod/fraxlend asset/share ratio after inverting the price instead of before, so the ratio is applied in the wrong direction and omitted from the sqrt term.
**Steps:**
1. Deploy a pod whose pairedLpTKN is a podded token (e.g. pOHM) or a fraxlend pair token (e.g. fUSDC), so BASE_IS_POD or BASE_IS_FRAX_PAIR is true.
2. Call `_calculateSpTknPerBase(_price18)`; observe `_avgBaseAssetInLp18 = sqrt((_priceBasePerPTkn18 * _k) / _kDec)` omits the asset/share ratio `cbr`.
3. Observe `_spTknBasePrice18 = 1e36 / _basePerSpTkn18` is computed before `convertToAssets`/pod config is applied, inverting the ratio's effect.
4. Compare against correct formula: divide sqrt term by `cbr`, then multiply `_basePerSpTkn18` by `cbr` before inversion.
**How found:** Code-reading of the fair Uniswap V2 LP pricing formula against the implementation; noticed the asset/share ratio for podded/fraxlend pairedLpTKN was neither in the sqrt term nor applied in the correct order relative to the price inversion.
**Exploitation:** No direct attack path given; the mispriced oracle feeds Fraxlend borrow-asset valuation, so a borrower could over-borrow against an overestimated collateral or be unfairly liquidated when underestimated.
**Insight:** When adapting fair-LP pricing to LP tokens whose paired asset is itself a share/asset wrapper, the wrapper ratio must enter inside the sqrt and be applied before any price inversion; check both placement and direction.

