You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Double Debond Fee Application in _calculateBasePerPTkn()
Summary
The debond fee is applied twice when calculating _spTknBasePrice18 in the spTknMinimalOracle contract. This causes mispricing of spTkn which is used as collateral in the fraxlend pairs, causing unfair liquidations.
Root Cause
in the spTknMinimalOracle, when getPrices() is called, the _calculateBasePerPTkn function makes two adjustements if BASE_IS_POD. One for the pod CBR, and one for the unwrap fee:
Delightful Syrup Scorpion
High
Double Debond Fee Application in
_calculateBasePerPTkn()
Summary
The debond fee is applied twice when calculating
_spTknBasePrice18
in thespTknMinimalOracle
contract. This causes mispricing ofspTkn
which is used as collateral in the fraxlend pairs, causing unfair liquidations.Root Cause
in the
spTknMinimalOracle
, whengetPrices()
is called, the _calculateBasePerPTkn function makes two adjustements ifBASE_IS_POD
. One for the pod CBR, and one for the unwrap fee:https://github.com/sherlock-audit/2025-01-peapods-finance/blob/d28eb19f4b39d3db7997477460f9f9c76839cb0c/contracts/contracts/oracle/spTKNMinimalOracle.sol#L213-L216
But when accounting for the CBR, it uses .convertToAssets() on the pod, which already accounts for the unwrap/debond fee:
https://github.com/sherlock-audit/2025-01-peapods-finance/blob/d28eb19f4b39d3db7997477460f9f9c76839cb0c/contracts/contracts/WeightedIndex.sol#L128
So the debond fee is incorrectly applied twice when pricing the spTkn in the oracle.
Internal Pre-conditions
Base token is a pod token
External Pre-conditions
None
Attack Path
None
Impact
spTkn token price is undervalued
Since it is used as collateral in lending pairs, borrowers in the FraxLend pair will be unfairly liquidated.
PoC
No response
Mitigation
Dont apply the debond fee twice
The text was updated successfully, but these errors were encountered: