# utilization for _getInterestRate() does not factor in interest

SGLCommon._getInterestRate computes utilization before accruing interest into _totalBorrow.elastic, understating utilization and mispricing the interest rate.

- Payout: Contest reward
- Severity: high
- Program: Tapioca DAO
- Credited: ItsNio
- Disclosed: 2023-11-16
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2023-07-tapioca-findings/issues/1057
- Library page: https://bugbountylibrary.com/r/c4%3A2023-07-tapioca%3AH-30
- Tags: domain:web3 impact:integrity kind:contest platform:code4rena sev:high tech:solidity technique:source-review vuln:accounting-error

**Target:** SGLCommon.sol interest rate / utilization calculation
**Root cause:** utilization is computed from _totalBorrow.elastic before the accrued interest is added to it, so the new interestPerSecond is derived from a stale, understated utilization.
**Steps:**
1. Read `_getInterestRate()` in SGLCommon.sol lines 61-64: utilization = _totalBorrow.elastic * UTILIZATION_PRECISION / fullAssetAmount.
2. Note interest accrual on line 99 adds extraAmount to _totalBorrow.elastic after utilization is computed.
3. Observe utilization used to set new interestPerSecond (line 111) excludes accrued interest.
4. Compare against corrected ordering: accrue first, then recompute fullAssetAmount and utilization.
**How found:** Code reading of the interest accrual flow: noticed utilization was computed before the accrual mutation of _totalBorrow.elastic, making the rate update use stale state.
**Insight:** In lending markets, check ordering of accrual vs. utilization/rate computation; any read of _totalBorrow.elastic before the accrue step yields a stale utilization and mispriced rates.
