Conversation
Add monitoring for yvUSD vault covering: - APY inversion detection (unlocked > locked for extended periods) - Negative strategy APR alerts - CCTP cross-chain strategy staleness detection - Flashloan liquidity checks for Morpho looper unwinding - Large LockedyvUSD cooldown request detection Closes #193 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move yvusd monitoring into yearn/ to match project conventions: - yearn/yvusd.py (was yvusd/main.py) - yearn/abi/ for contract ABIs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
spalen0
commented
Apr 22, 2026
spalen0
commented
Apr 22, 2026
spalen0
commented
Apr 22, 2026
… kwargs - Remote cross-chain "vaults" (0x78b7…, 0xBCf0…) are V3 tokenized strategies and revert on strategies(); switch to direct lastReport() / totalAssets() calls and surface a MEDIUM alert on lookup failure instead of silently disabling the CCTP health check. - Flashloan liquidity check now picks up cross-chain wrappers whose remote_vault_type is a looper (borrower = remote_vault on the remote chain) and runs per-chain via LOOPER_CHAIN_CONFIG (mainnet + Arbitrum). - events.CooldownStarted.get_logs now uses snake_case from_block / to_block for web3 7.x; camelCase raised TypeError and silently returned. - Add morpho/abi/morpho_blue.json — the previous shared-abi refactor pointed ABI_MORPHO at the MetaMorpho vault ABI, which lacks market()/position() and would have raised ABIFunctionNotFound. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…on cooldown RPC failure
- Skip CCTP staleness + cross-chain flashloan checks when PROVIDER_URL_{CHAIN}
is not set (one-shot MEDIUM alert per chain via dedup flag) so the live
Katana yvUSDC Compounder ($2.22M) doesn't trip "Remote Lookup Failed"
every hourly run when no Katana RPC is configured.
- Surface MEDIUM alert when CooldownStarted get_logs fails so an extended
RPC outage doesn't silently mute large-cooldown monitoring; flag clears
automatically on next successful fetch.
- Debounce negative-APR and flashloan-liquidity alerts per-strategy /
per-(chain, borrower) to stop alert spam while a condition persists;
flags clear on recovery so a re-occurrence will alert again.
- Rename cache file from generic cache-id.txt to cache-yvusd.txt.
- Use local_chain.network_name in CCTP alert summary instead of literal
"Mainnet" for consistency with the remote-side line.
Tests cover: RPC-gap one-shot alert + dedup, cooldown failure alert +
dedup, negative-APR alert/dedup/recovery, flashloan alert/dedup. 17 tests,
all pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
lastReporttimestamps, alerts if stale (>48h)CooldownStartedevents on LockedyvUSD, alerts on >$100K requestsStrategy discovery
Looper and cross-chain strategies are discovered dynamically from the yvUSD APR API, so no hardcoded strategy list to maintain.
Contract ABIs
Minimal ABIs for:
strategies(),totalAssets())market(),position())CooldownStartedevent,getCooldownStatus(),totalSupply())lastReport(),totalAssets()— used for remote-side CCTP health checks)Test plan
yvusd-api.yearn.fi/api/aprslastReport()/totalAssets()calls succeed on Arbitrum (0x78b7…,0xBCf0…)get_logssnake-case kwargs work on web3 7.xtest_does_not_advance_cache_when_log_fetch_fails)🤖 Generated with Claude Code