# `spTKNMinimalOracle.sol` counts debond fee twice, which will make the end price (spTKN per base) higher than it should be

spTKNMinimalOracle double-counts the debond fee when pricing pTKN, inflating spTKN/base price and letting Fraxlend liquidators receive excess collateral.

- Payout: Audit contest
- Severity: medium
- Program: Peapods Finance
- Found by: 0xSpearmint1
- Disclosed: 2025-01-08
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2025-01-peapods-finance-judging/issues/386
- Library page: https://bugbountylibrary.com/r/sherlock%3A2025-01-peapods-finance%3AM-18
- 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:liquidation vuln:oracle-manipulation

**Target:** spTKNMinimalOracle / aspTKNMinimalOracle price feed used by Fraxlend pair
**Root cause:** _accountForCBRInPrice calls WeightedIndex.convertToAssets which already subtracts the debond fee, then _accountForUnwrapFeeInPrice subtracts the debond fee again, double-counting it.
**Steps:**
1. Note _calculateBasePerPTkn converts Tkn->pTkn via _accountForCBRInPrice (WeightedIndex.convertToAssets, which already deducts debond fee)
2. Then _accountForUnwrapFeeInPrice subtracts debond fee a second time
3. Resulting base-per-pTKN is too low, so inverted spTKN-per-base is too high
4. Same double-count occurs via _checkAndHandleBaseTokenPodConfig when BASE_IS_POD
5. Feed inflated aspTKN price into Fraxlend solvency and liquidation collateral math
**How found:** Code-reading of the oracle price path: noticed convertToAssets already applies debond fee, then observed _accountForUnwrapFeeInPrice applying it again in the same conversion chain.
**Exploitation:** When DEBOND_FEE is non-zero (or base is a pod with debond fee), the inflated spTKN price is consumed by aspTKNMinimalOracle in a Fraxlend pair; a liquidator liquidating a position is credited more collateral than deserved due to the overstated price.
**Insight:** When an oracle composes multiple price-adjustment helpers, verify each helper's underlying library call doesn't already bake in the same fee/discount—double-application silently skews derived prices used in liquidation math.

