# Treasury rebalance will fail due to interest accrual

Notional's treasury rebalance reverts when Compound's interest rate model changed, since getExchangeRateView skips interest accrual, making the before/after delta exceed the rebalancing threshold.

- Payout: Contest reward
- Severity: medium
- Program: Notional
- Credited: xiaoming90 + 0xleastwood
- Disclosed: 2023-03-09
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2023-03-notional-judging/issues/189
- Library page: https://bugbountylibrary.com/r/sherlock%3A2023-03-notional%3AM-11
- Tags: domain:web3 impact:dos kind:contest platform:sherlock sev:medium tech:solidity technique:source-review vuln:accounting-error vuln:dos

**Target:** TreasuryAction._executeRebalance / cTokenAggregator.getExchangeRateView
**Root cause:** getExchangeRateView returns cToken.exchangeRateStored() (no accrual) when the interest rate model differs from the stored one, so totalUnderlyingValueBefore excludes accrued interest while the after-value includes it.
**Steps:**
1. Compound updates its interest rate model for the cToken.
2. Treasury manager calls _executeRebalance(currencyId).
3. calculateRebalance runs; getTotalUnderlyingValueStateful() reads exchangeRateStored() without accrual -> totalUnderlyingValueBefore.
4. Redemptions and deposits execute, accruing interest.
5. Second getTotalUnderlyingValueStateful() includes accrued interest -> totalUnderlyingValueAfter.
6. underlyingDelta.abs() >= Constants.REBALANCING_UNDERLYING_DELTA -> require reverts.
**How found:** Code reading of cTokenAggregator.getExchangeRateView branch: noticed the interest-rate-model-changed path uses exchangeRateStored() which does not accrue, then traced how _executeRebalance compares before/after values and would trip the delta require.
**Insight:** When a view function has a fallback branch (e.g. stored vs computed exchange rate), check whether callers compare its output before and after state-mutating calls; a non-accruing branch creates a phantom delta that trips invariant checks.
