Skip to content

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

Description

@spalen0

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

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 Depeg #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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions