Skip to content

Feature: Add Oracle provider failover with priority ordering #79

@Smartdevs17

Description

@Smartdevs17

Problem

When a price provider fails, the Oracle aggregator treats all providers equally. There's no way to prioritize certain providers over others for failover.

Context

Some providers (e.g., Binance) may be more reliable or have lower latency. Prioritization ensures the best data source is used when available.

Proposed Solution

Add priority-based failover:

interface ProviderConfig {
  priority: number; // 1 = highest
  name: string;
  enabled: boolean;
  // ...
}

Providers tried in priority order; lower-priority providers used only when higher-priority ones fail.

Acceptance Criteria

  • Providers ordered by priority
  • Higher-priority provider preferred when available
  • Automatic failover to lower priority on failure
  • Recovery: switch back to higher priority when it recovers
  • Tests for failover and recovery

Technical Notes

  • Files: oracle/src/services/price-aggregator.ts, oracle/src/config.ts

Constraints

  • Must not increase latency when primary provider is healthy

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave programenhancementNew feature or requestmediumDifficulty: MediumoracleOracle price feed service

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions