Skip to content

feat(yvusd): add yvUSD vault monitoring#194

Open
spalen0 wants to merge 5 commits intomainfrom
yvusd
Open

feat(yvusd): add yvUSD vault monitoring#194
spalen0 wants to merge 5 commits intomainfrom
yvusd

Conversation

@spalen0
Copy link
Copy Markdown
Collaborator

@spalen0 spalen0 commented Mar 29, 2026

Summary

  • Add monitoring script for yvUSD vault (closes Yvusd monitoring #193)
  • APY anomaly detection: alerts when unlocked APY > locked APY for >6 hours (incentive misalignment), and when any strategy has negative APR
  • CCTP bridging delays: checks cross-chain strategy lastReport timestamps, alerts if stale (>48h)
  • Flashloan liquidity: checks Morpho borrow positions vs available liquidity (Balancer vault + Morpho market) for looper strategy unwinding
  • Large cooldown requests: scans CooldownStarted events on LockedyvUSD, alerts on >$100K requests

Strategy 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:

  • Yearn V3 Vault (strategies(), totalAssets())
  • Morpho Blue (market(), position())
  • LockedyvUSD (CooldownStarted event, getCooldownStatus(), totalSupply())

Test plan

  • Verify API fetch works against yvusd-api.yearn.fi/api/aprs
  • Verify on-chain calls succeed with a mainnet RPC
  • Test cache persistence for APY inversion tracking
  • Confirm CooldownStarted event signature matches LockedyvUSD contract
  • Add to hourly GitHub Actions workflow

🤖 Generated with Claude Code

spalen0 and others added 4 commits March 29, 2026 11:20
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 spalen0 marked this pull request as ready for review March 29, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Yvusd monitoring

1 participant