Add USD supply cap for Euler v2 (#2917)
* Add USD supply cap for Euler v2 * Fix Euler v2 cap handling: frozen vaults and unbounded supplyCapUsd The vault lens resolves Euler's packed AmountCap to a raw token amount, where an unset cap resolves to type(uint256).max and the packed 1..64 values governance uses to freeze a vault for wind-down all resolve to 0. The previous `cap > 0 && cap < 64` test matched neither: across all 2252 vaults on the 10 configured chains, none has a resolved cap in that band. Two consequences, both fixed here: - 16 frozen wind-down vaults were published as depositable pools, holding $147.8M of totalSupplyUsd, six advertising apyBase above 10% and up to 90% (they sit pinned at 100% utilisation, which is what drives the rate that high). maxDeposit() and maxWithdraw() both return 0 on all of them. Compare the resolved cap against 0 instead. - supplyCapUsd was emitted for uncapped vaults, publishing ~1.16e71 on 49 of 171 rows. Skip it when the cap is at or above Euler's MAX_SANE_AMOUNT (type(uint112).max), which can never bind. The borrowCap leg of the inclusion filter is dropped: a resolved borrow cap of 0 disables borrowing but not deposits, so it should not exclude a lend vault. That leg was inert under the old threshold, so this adds no rows. Verified against live state for all 2252 vaults: standard rows 187 -> 171 (16 removed, 0 added), supplyCapUsd rows 171 -> 122 with 0 values above 1e30 and a new maximum of $300M. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: kr3p <123127490+0xkr3p@users.noreply.github.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
V
Vukašin Manojlović committed
b30f0cc575250ae882391b1c28688024036d01c5
Parent: 06268cd
Committed by GitHub <noreply@github.com>
on 8/14/2026, 4:36:39 PM