# Interest can be significantly lower if addInterest isn't called frequently enough 

Fraxlend's addInterest multiplies rate by full elapsed time linearly, so infrequent calls under-accrue interest versus frequent compounding, shorting lenders.

- Payout: Contest reward
- Severity: medium
- Program: Frax Finance
- Credited: 0xA5DF
- Disclosed: 2023-01-13
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2022-08-frax-findings/issues/145
- Library page: https://bugbountylibrary.com/r/c4%3A2022-08-frax%3AM-02
- Tags: domain:web3 impact:funds-loss kind:contest platform:code4rena sev:medium tech:evm tech:solidity vuln:accounting-error

**Target:** FraxlendPair addInterest / interest accrual math
**Root cause:** Interest is computed as ratePerSec * deltaTime * totalBorrow in a single linear step rather than compounding over sub-periods, so long deltas between addInterest calls yield less than frequent compounding.
**Steps:**
1. Deploy custom pair with linear rate min=vertex=max=12864358183 (~50% annual).
2. Borrow, then warp 3 days x100 calling addInterest each time; record borrower debt.
3. Deploy identical pair (different salt), borrow, warp 3 days x100 without calling addInterest, then call addInterest once; record debt.
4. Compare: 2000166246155040000000 vs 2092489655740553483735 (~4.5% shortfall).
**How found:** Noticed addInterest multiplies rate by full time delta linearly, then reasoned that call frequency changes the effective rate; built a JS model of compounding vs linear accrual and a forge test comparing frequent vs single accrual.
**Insight:** In lending protocols, check whether interest accrual is linear-in-deltaTime; if so, low-activity pairs with high rates and infrequent addInterest calls systematically under-accrue, and the gap grows superlinearly with rate and delta.
