Skip to content

feat: implement oracle data staleness and confidence interval validation #311

@greatest0fallt1me

Description

@greatest0fallt1me

Description:

Validate oracle data freshness (staleness) and, where applicable, confidence intervals (e.g., Pyth) before accepting a result for resolution.

Requirements and Context:

  • Must be secure, tested, and documented
  • Should reject oracle result if data is older than configured max age (e.g., 60 seconds)
  • Should for Pyth (or similar) validate confidence interval within threshold (e.g., 5%)
  • Should allow admin to configure max staleness and confidence threshold per event or globally
  • Should emit events when validation fails
  • Must integrate with existing oracle resolution path

Suggested Execution:

  1. Fork the repo and create a branch

    git checkout -b feature/oracle-staleness-confidence
  2. Implement changes

    • Write contract: validation in oracle resolution path
    • Update oracles module: src/oracles.rs (staleness and confidence checks)
    • Update types and storage; add documentation and NatSpec-style comments
  3. Test and commit

    • Run tests; cover stale data rejected, confidence too wide rejected
    • Include test output and security notes

Example Commit Message:

feat: implement oracle data staleness and confidence interval validation

Guidelines:

  • Minimum 95 percent test coverage
  • Clear documentation
  • Timeframe: 72 hours

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions