Skip to content

Index Chainlink AnswerUpdated oracle events (Yearn peg monitoring L3) #31

Description

@spalen0

Context

Layer 3 (indexer side) of Yearn pegged-asset & oracle monitoring. Real-time capture of Chainlink oracle updates so no round is missed between polls. The alert consumer lives in yearn/monitoring (separate issue). Tracked by the peg-monitoring epic in yearn/monitoring.

Scope

  • Add a ChainlinkAggregator contract per chain in apps/indexer/config.yaml with event:
    AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 updatedAt).
  • Add an AnswerUpdated entity to schema.graphql (aggregator/feed address, roundId, answer, updatedAt, block, tx).
  • Add a handler in src/EventHandlers.ts (same shape as the existing event handlers).
  • Address sourcing (important): AnswerUpdated is emitted by the underlying aggregator, which rotates on phase upgrades, and its indexed params are current / roundIdnot the address — so Envio eventFilters cannot scope it by feed. Statically list the current aggregator addresses resolved from each feed proxy's aggregator(). Document the resolution step and a refresh procedure for phase upgrades (a phase change is itself a risk signal — it surfaces as staleness in L2).
  • Feeds to cover: the Chainlink feeds behind the monitored peg set — cbBTC/USD, BTC/USD, USDC/USD, USDT/USD, USDS/USD, USDe/USD, LBTC/BTC, …

Acceptance criteria

  • Indexer codegens and syncs; AnswerUpdated rows are queryable via GraphQL.

References

  • Precedent: existing TimelockController indexing in this repo.
  • Envio 3.0.1 contractRegister / wildcard docs.
  • Consumer + alerting issue: in yearn/monitoring.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions