# Insufficient Decimal

Yieldoor lending pool truncates accrued interest to zero for low-decimal assets like WBTC when indexes update frequently, causing depositors to lose yield.

- Payout: Audit contest
- Severity: medium
- Program: Yieldoor
- Found by: future2_22
- Disclosed: 2025-02-21
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2025-02-yieldoor-judging/issues/190
- Library page: https://bugbountylibrary.com/r/sherlock%3A2025-02-yieldoor%3AM-8
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:medium tech:evm tech:solidity vuln:accounting-error vuln:precision-loss

**Target:** LendingPool ReserveLogic interest index update
**Root cause:** newTotalBorrows = newBorrowingIndex * totalBorrows / borrowingIndex truncates; for WBTC (8 decimals) per-block accrued interest is below 1 wei so totalBorrows never increases.
**Steps:**
1. Set LendingPool asset = WBTC, totalLiquidityAndBorrows=0.25 WBTC, totalBorrows=0.126144 WBTC, utilization ~50.46%
2. Compute ratePerSecond=4e18, exp=15 (one 15s block)
3. CompoundedInterest = 1e27 + 60e18 + 3360e9 + 29120 < 1e27+60.1e18
4. latestBorrowingIndex scales by <1+60.1e-9
5. newTotalBorrows = index*totalBorrows/borrowingIndex truncates to reserve.totalBorrows (delta <1 wei)
6. Repeat `_updateIndexes` each block (or attacker deposits 1001 wei WBTC and redeems type(uint256).max) to keep interest unaccounted
**How found:** Code reading of ReserveLogic L156 truncation combined with manual arithmetic showing per-block interest for 8-decimal WBTC falls below 1 wei.
**Exploitation:** Attacker or frequent users trigger _updateIndexes every block so accrued interest rounds to zero; depositors earn no interest. At 100-block intervals ~1% precision loss on small WBTC pools.
**Insight:** For lending/interest accrual math, check whether per-second or per-block interest on the lowest-decimal asset (WBTC, 8 decimals) exceeds 1 wei at realistic pool sizes; frequent index updates can silently zero out yield.

