Skip to content

refactor: centralize stablecoin depeg monitoring into stables/main.py#195

Merged
spalen0 merged 5 commits intomainfrom
feat/stablecoin-price-monitoring-v2
Mar 29, 2026
Merged

refactor: centralize stablecoin depeg monitoring into stables/main.py#195
spalen0 merged 5 commits intomainfrom
feat/stablecoin-price-monitoring-v2

Conversation

@spalen0
Copy link
Copy Markdown
Collaborator

@spalen0 spalen0 commented Mar 29, 2026

Summary

  • Extract stablecoin price checks from 4 protocol scripts (ethena, infinifi, maple, cap) into a single stables/main.py
  • Run on the multisig-checker workflow (every 10 min) instead of varying cadences (hourly/daily)
  • Alerts still route to each protocol's own Telegram channel
  • Depeg threshold set to $0.97 for all tokens

Changes

  • New: stables/main.py — single script that fetches all stablecoin prices in one DeFiLlama call, grouped by protocol
  • Removed: STABLECOIN_TOKENS and check_stablecoin_prices() calls from ethena/ethena.py, infinifi/main.py, maple/main.py, cap/liquidity.py
  • Updated: multisig-checker.yml to include stables/main.py
  • Updated: maple/README.md to reference centralized script

Test plan

  • Verify stables/main.py runs successfully and fetches prices for all 6 tokens
  • Confirm alerts route to correct protocol Telegram channels
  • Verify protocol scripts still work without stablecoin price checks

🤖 Generated with Claude Code

spalen0 and others added 5 commits March 29, 2026 21:07
…n.py

Move all stablecoin depeg monitoring into a single script that runs on
the multisig-checker workflow (every 10 min) instead of being embedded
in each protocol's main script at varying cadences.

Alerts are still routed per protocol's Telegram channel.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extract fetch_prices() from check_stablecoin_prices() so stables/main.py
can fetch all 6 tokens in one call and pass pre-fetched prices for
per-protocol depeg checks.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…n.py

No need for a wrapper function — stables/main.py fetches once and checks
prices directly, sending per-protocol alerts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove duplicate _defillama_fetch_prices and _dl_client from
yearn/alert_large_flows.py in favor of the shared utility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@spalen0 spalen0 merged commit d97de0b into main Mar 29, 2026
2 checks passed
@spalen0 spalen0 deleted the feat/stablecoin-price-monitoring-v2 branch March 29, 2026 19:17
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.

1 participant