Conversation
Add centralized depeg monitoring using Redstone fundamental oracles where available (LBTC, cUSD) and DefiLlama market pricing as fallback for weETH, ezETH, rsETH, pufETH, osETH, rswETH, mETH and stablecoins. Oracle-based assets alert on any depeg (below 0.998). DefiLlama-based assets alert on 2%+ depeg (below 0.98). LRT alerts route to a single "lrt" channel with token symbol. Closes #196 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Review summary from local validation: Main findings are in the inline comments, but there are a few non-diff gaps that still block calling the test plan complete:
What I validated locally on 2026-04-22:
So the code path executes, but the monitor is still missing workflow wiring, secret plumbing, and the correctness fixes called out inline before I’d treat the PR as ready. |
|
Pushed cUSD threshold — fixed. LRT ratio vs flat 1 ETH — fixed. deUSD silent skip — fixed. Missing DefiLlama prices now fire one MEDIUM alert per channel ( Workflow wiring — fixed. Added Telegram env vars — fixed with one pushback:
Extra call-out not in review: USD0++ is a ~4-year locked bond that legitimately trades at a discount; a flat 0.98 threshold would have alerted constantly (your dry-run caught it at 0.9561). Gave it a per-asset Automated tests — not added in this pass; the monitor is mostly declarative config + a DefiLlama/RPC call. Happy to add a small unit test covering the deviation math + missing-price alert if you'd like a follow-up. |
Address PR review feedback: - Oracle threshold is now per-asset; cUSD uses 0.9998 to match the documented Tenderly alert (was 0.998, so cUSD=0.99975 slipped through). - DefiLlamaAsset now carries fair_value and threshold so accruing LRTs are checked against their accrued ETH rate instead of a flat 1:1 peg. USD0++ gets a looser 0.90 floor because it's a 4-year bond that legitimately trades at a discount. - Missing DefiLlama prices now raise a MEDIUM alert (e.g. deUSD on the dry-run date) so coverage failures are visible. - Wire prices/main.py into the hourly workflow and add TELEGRAM_BOT_TOKEN_LRT/STABLES plus TELEGRAM_CHAT_ID_STABLES to _run-monitoring.yml; update .env.example accordingly. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ests - Drop local DefiLlama client + getcontext() mutation; use shared utils.defillama.fetch_prices. - Merge LRT and stables lists into a single DEFILLAMA_ASSETS; route alerts per asset.protocol (lrt / cap / stables) via grouped dict instead of hardcoded branches. - Drop OracleAsset.threshold default and unused chain field; cUSD oracle now routes to cap channel. - Narrow oracle parse except to (IndexError, TypeError); fetch-failure alerts fan out to every affected protocol; missing-ETH-price no longer aborts USD-side stable checks. - README: warn that accruing-LRT fair_value floors need quarterly bumps; add Channel column; note USDe overlap with stables/main.py. - tests/test_prices.py: 6 tests covering fair-value normalization, missing-price MEDIUM alert, and per-protocol fetch-failure fan-out. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
prices/module for depeg monitoring of LRTs and stablecoinslrtprotocol channel with token symbol identificationOracle Research Findings
0xb415...bc810x9a5a...434aCloses #196
Test plan
prices/main.pyto appropriate GitHub Actions workflowTELEGRAM_BOT_TOKEN_LRT/TELEGRAM_CHAT_ID_LRTandTELEGRAM_BOT_TOKEN_STABLES/TELEGRAM_CHAT_ID_STABLESsecrets🤖 Generated with Claude Code