Skip to content

Implement subscription smart contract oracle integration for price feeds #189

@Smartdevs17

Description

@Smartdevs17

Implement subscription smart contract oracle integration for price feeds

Description

Context: Subscription prices in crypto need accurate price feeds for proper charging amounts in stablecoin equivalent.

Current Limitation: No oracle integration for price feeds; uses static or mock prices.

Expected Outcome: Implement oracle integration for real-time price feeds enabling accurate USD-equivalent charging.

Acceptance Criteria

  • Integrate with price oracle (e.g., Chainlink, Band Protocol)
  • Implement price caching with TTL
  • Add fallback oracle support for redundancy
  • Implement circuit breaker for oracle failures
  • Add price staleness detection
  • Support multiple quote currencies
  • Implement price deviation thresholds for alerts
  • Write tests for oracle integration

Technical Scope

Files Likely Affected:

  • contracts/oracle/src/lib.rs - New oracle module
  • contracts/oracle/src/price.rs - Price fetching
  • app/services/priceService.ts - Price service

APIs/Contracts Involved:

  • get_price(token: TokenId) -> Price
  • get_price_with_cache(token: TokenId, ttl: u64) -> Price
  • get_historical_price(token: TokenId, timestamp: Timestamp) -> Price

Edge Cases to Consider:

  • Oracle downtime
  • Price manipulation
  • Stale prices
  • Network latency

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave programenhancementNew feature or requestsmart-contractsRust/Soroban smart contract work

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions