Reproduce an Aave v3 supply-cap rejection in the correct units

The reference Aave v3 configuration stores a supply cap in whole tokens. A risk dashboard comparing that field directly with base-unit balances can report a cap breach many orders of magnitude too early.

Scale the cap before testing capacity

Read the reserve configuration, underlying decimals and transaction-state supply inputs. Multiply a nonzero configured cap by 10 raised to the reserve decimals. In the reference validation path the candidate total includes scaled supply and accrued-to-treasury units converted by the next liquidity index, then the new supply amount.

configured supply cap = 1000 whole tokens
underlying decimals = 6
cap in raw units = 1000000000

If the applicable total before deposit is 999,900,000 raw units, a supply of 150,000 takes it above the illustrated cap by 50,000. A calculation based only on wallet balances can miss the part accrued to the treasury.

Check the exact deployed validation path

A zero cap disables this particular limit in the reference implementation. Pausing, freezing and asset-specific checks can independently reject a supply. Reproduce the pre-transaction state and use the code version behind the pool proxy. github.com ValidationLogic.sol