feat(morpho): group V2 pending alerts and improve cap formatting#322
Merged
Conversation
Group all newly-submitted timelocked operations for the same V2 vault into a single Telegram message instead of one per operation (a batched multicall submit previously produced N separate alerts). Improve cap-setter rendering: - Link collateral tokens by resolved symbol, e.g. [weETH](katanascan/...) via a new assetByAddress fetch, falling back to the bare address link. - Render relative caps (increaseRelativeCap) as percentages (WAD ratio, 1e18 = 100%) instead of a misleading token amount, for both the collateral-token and market id paths. Absolute caps keep token-amount formatting. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
spalen0
marked this pull request as ready for review
July 24, 2026 15:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two improvements to the Morpho VaultV2 governance monitor, driven by these example alerts:
1. Group per-vault pending alerts into one message
A batched multicall submit previously fired one Telegram message per operation.
_diff_pendingnow collects all newly-submitted timelocked operations for a vault and sends a single grouped alert. When every op shares the same execution time and tx (the multicall case), those are shown once in the footer; otherwise they render per-op. Single-op alerts keep their original format.2. Better cap-setter rendering
collateral token [weETH](https://katanascan.com/address/0x9893…19a7), via a newassetByAddressfetch in_shared.py, falling back to the bare-address link when the symbol can't be resolved.increaseRelativeCapvalues are WAD ratios (1e18= 100%), not token amounts. Both example alerts are actually1e18= 100%; the market one was mis-rendered as1000.00B vbUSDC. Now both the collateral-token and market paths showcap 100.0000%. Absolute caps keep token-amount formatting.Result:
Notes
fetch_asset_metadatais an uncached GraphQL call per collateral-token cap during rendering — consistent with the existingfetch_market_metadatapattern.Testing
uv run pytest tests/→ 671 passed, 4 skipped.ruff check/formatclean.🤖 Generated with Claude Code