yearn / yearn/monitoring

Epic: Pegged-asset & oracle monitoring (Chainlink + Redstone, 3 layers)

Open
#304 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
13
Forks
13
Avg merge
1d 9h
Merged PRs (30d)
19

Description

Tracking issue for revamped pegged-asset & oracle monitoring. Extends the original sketch in #196.

Goal

Better monitoring for pegged assets — BTC pegs (cbBTC, LBTC) and USD pegs (siUSD, cUSD, USDe, USDC, USDT, USDS + the stables already in protocols/stables/main.py) — covering not just market price but the on-chain oracles our lending markets liquidate on (Chainlink) and fundamental/rate oracles (Redstone LBTC, exchange-rate oracles).

Decisions

  • Oracle depth: Chainlink market feeds + fundamental/rate oracles.
  • Coverage: the named peg list (not the whole utils/assets.py registry).
  • Events: extend the Envio indexer for real-time AnswerUpdated (not polling-only).

Architecture — one shared PeggedAsset registry, three layers

  • L1 market depeg — refine stables/main.py (BTC pegs via live BTC/USD target, dual bounds, dataclass), 10-min cadence.
  • L2 oracle health — new stables/oracles.py, hourly: Chainlink staleness / round-monotonicity / peg-deviation / oracle↔market divergence + rate-oracle checks.
  • L3 event-driven — Envio indexer indexes Chainlink AnswerUpdated → GraphQL; Python consumer alerts hourly (no rounds missed between polls).

Component issues

  • #299 — Foundation: utils/chainlink.py, common-abi/ChainlinkAggregator.json, PeggedAsset registry
  • #300 — L1: refine stables/main.py market depeg (BTC pegs, dual bounds, dataclass)
  • #301 — L2: stables/oracles.py Chainlink + rate-oracle health (hourly)
  • chain-events/yearn-indexing-test#31 — L3 indexer: index Chainlink AnswerUpdated
  • #302 — L3 consumer: GraphQL oracle-events alert script
  • #303 — Cleanup (optional): refactor USTB onto utils/chainlink.py

Suggested order

#299 → #300 / #301 (parallel) → indexer#31 → #302 → #303.

Open items to resolve during implementation

  • Confirm siUSD and cUSD issuers/oracles (cUSD looks like Cap's — half-wired + commented out in stables/main.py as "very volatile").
  • Resolve per-feed Chainlink heartbeat / deviation params and aggregator addresses (for the indexer) on-chain.
  • Decide whether to rename protocols/stablesprotocols/prices (per #196) as part of L1.
  • For each fundamental oracle, confirm whether an existing Tenderly alert already covers it; document gaps.

Key technical note: Chainlink AnswerUpdated is emitted by the underlying aggregator (rotates on phase upgrades); indexed params are current / roundId, not address → can't event-filter by feed. Statically list resolved aggregator addresses (see indexer#31).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the completed component issues #299–#301 and the existing protocols/stables/main.py, then review the remaining indexer#31 and #302 work. Check the open items for issuer, oracle, heartbeat, deviation, and aggregator details. Done means the named pegged assets are covered across market, oracle-health, and event-driven monitoring with documented gaps.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.