feat(stables): add stablecoin depeg price monitoring#185
Open
feat(stables): add stablecoin depeg price monitoring#185
Conversation
Monitor stablecoin prices via DeFiLlama and send critical Telegram alerts when any token drops below $0.995. Tracks DAI, USDS, USDe, sUSDe, syrupUSDC, syrupUSDT, USDT, USDC, FRAX, crvUSD, GHO, PYUSD, and USD0. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add shared DeFiLlama price check utility (utils/defillama.py) and integrate per-protocol stablecoin price monitoring: - Maple: syrupUSDC, syrupUSDT - Ethena: USDe, sUSDe Alerts via Telegram when any token drops below $0.995. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ical alerts Alerts route through each protocol's existing Telegram channel (maple, ethena) — no separate stables channel needed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…-monitoring # Conflicts: # ethena/ethena.py
Add shared DeFiLlama price check utility (utils/defillama.py) using the Alert system with CRITICAL severity for depeg alerts. Per-protocol stablecoin price monitoring: - Maple: syrupUSDC, syrupUSDT - Ethena: USDe, sUSDe - Infinifi: iUSD Alerts fire when any token drops below $0.995. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
tapired
reviewed
Mar 23, 2026
utils/defillama.py
Outdated
|
|
||
| logger = get_logger("defillama") | ||
|
|
||
| DEPEG_THRESHOLD = Decimal("0.995") |
Collaborator
There was a problem hiding this comment.
this is too high imo. This should be 0.98 even 0.97.
…o remaining protocols - Auto-register dispatch_emergency_withdrawal in utils/alert.py on import, removing manual register_alert_hook calls from 5 protocol files - Add try/except ImportError guard on lazy import for resilience - Add "maple" to DISPATCHABLE_PROTOCOLS - Add stablecoin price monitoring to cap/liquidity.py with relaxed threshold (0.93) for DeFiLlama's unreliable cUSD pricing - Clean up now-redundant dispatch imports Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (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
stables/main.pythat monitors stablecoin prices via DeFiLlama APICloses #184
Setup required
TELEGRAM_BOT_TOKEN_STABLESandTELEGRAM_CHAT_ID_STABLESsecrets to the repo (or it will fall back toTELEGRAM_BOT_TOKEN_DEFAULT)Test plan
🤖 Generated with Claude Code