# `addInterest` will not update the interest acurately which would enable users to claim rewards for time that they weren't staked inside `LendingAssetVault`

LendingAssetVault's addInterest skips accrual when utilization rate barely changes, letting depositors claim interest earned before they staked.

- Payout: Audit contest
- Severity: medium
- Program: Peapods Finance
- Found by: JohnTPark24
- Disclosed: 2025-01-08
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2025-01-peapods-finance-judging/issues/171
- Library page: https://bugbountylibrary.com/r/sherlock%3A2025-01-peapods-finance%3AM-4
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:medium tech:evm tech:solidity technique:incomplete-fix technique:source-review vuln:accounting-error vuln:business-logic

**Target:** LendingAssetVault / FraxlendPair addInterest accounting
**Root cause:** addInterest gates accrual on utilization-rate change (0.1% threshold) using stale totalAsset/totalBorrow values that only update on interactions, so interest isn't accrued when rate is stable.
**Steps:**
1. Wait until no deposit/withdraw/borrow on fraxlend pair for hours/days so totalAsset/totalBorrow are stale
2. Call `LendingAssetVault.deposit(assets, receiver)` which invokes `_updateInterestAndMdInAllVaults`
3. Observe `addInterest(false)` emits `SkipAddingInterest` because `_rateChange < _currentUtilizationRate * minURChangeForExternalAddInterest / UTIL_PREC`
4. Deposit a small amount again or withdraw to trigger interest update, raising share value
5. Withdraw to capture interest accrued for the pre-deposit period
**How found:** Compared Peapods' modified addInterest against original Fraxlend code, noticing interest is conditionally skipped based on rate change rather than share value, and that totalAsset/totalBorrow are stale between interactions.
**Exploitation:** MEV bots deposit just before an interest-accruing interaction and withdraw after, capturing interest for time not staked; amounts range from dust to modest MEV profit.
**Insight:** When a fork adds a rate-change gate to interest accrual, check whether the inputs to that gate (totalAsset/totalBorrow) are refreshed independently of the gate—stale inputs make the gate skip legitimate accrual and open deposit-timing arbitrage.

