# fund loss because calculated Interest would be 0 in getCurrentState() due to division error

Interest accrual in Surge Pool.getCurrentState() truncates to zero for low-decimal tokens like USDC over short intervals, letting borrowers pay no interest.

- Payout: Contest reward
- Severity: medium
- Program: Surge
- Credited: Ace-30
- Disclosed: 2023-02-18
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2023-02-surge-judging/issues/225
- Library page: https://bugbountylibrary.com/r/sherlock%3A2023-02-surge%3AM-9
- Tags: domain:web3 impact:funds-loss kind:contest platform:sherlock sev:medium tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:precision-loss

**Target:** Solidity lending pool interest accrual (Pool.sol getCurrentState)
**Root cause:** Interest formula `_totalDebt * _borrowRate * _timeDelta / (365 days * 1e18)` divides by 1e18 while debt is in token decimals; for 6-decimal tokens and short timeDelta the result truncates to 0, yet lastAccrueInterestTime is still updated.
**Steps:**
1. Deploy pool with USDC (6 decimals) as debt token, MIN_RATE=5% (2e16), borrow rate ~5e16.
2. Borrow 100M USDC so _totalDebt = 100e6.
3. Wait 2 seconds so _timeDelta = 2.
4. Call getCurrentState(): interest = 100e6 * 5e16 * 2 / (31e6 * 1e18) = 0.
5. State updates lastAccrueInterestTime, so accrued interest is permanently lost each interaction.
**How found:** Code review of the interest formula, noticing the 1e18 divisor assumes 18-decimal debt tokens; reasoned about USDC 6-decimal debt with short timeDelta and computed the truncation to zero.
**Exploitation:** Borrower repeatedly interacts with the pool at short intervals; each accrual computes zero interest and resets lastAccrueInterestTime, so no interest is ever charged and lenders lose yield.
**Insight:** When auditing interest/rate math, check whether the fixed-point divisor matches the token's actual decimals; low-decimal tokens (USDC/USDT) plus short accrual windows silently truncate to zero, and updating the accrual timestamp makes the loss permanent.
