Skip to content

Feat: oracle consumer#54

Merged
Ceejaytech25 merged 3 commits intoceejaylaboratory:mainfrom
Agbasimere:feat-oracle-consumer
Mar 28, 2026
Merged

Feat: oracle consumer#54
Ceejaytech25 merged 3 commits intoceejaylaboratory:mainfrom
Agbasimere:feat-oracle-consumer

Conversation

@Agbasimere
Copy link
Copy Markdown
Contributor

Closes: #23

Description

This PR implements the OracleConsumer module, enabling Soroban smart contracts to securely consume and cache data from external price oracles.

Features

  • Data Standardization: Provides a common structure for asset pricing data (PriceData with price and timestamp).
  • Staleness Logic: Built-in protection against outdated price feeds using configurable max_age checks.
  • On-Demand Updates: update_price method pulls fresh data from a configurable external oracle address.
  • Administrative Security: Authorized mechanisms to update the source oracle as needed.
  • Event-Driven: Automated event emission for all price updates for downstream monitoring.

Integration

Located in src/oracle_consumer:

  • Import as a crate via anchorpoint-oracle-consumer = { path = "../oracle_consumer" }.
  • Initialize with an admin and an oracle address, then call update_price(asset) as needed before critical financial logic.

Commands

  • Build/Check: cargo check -p anchorpoint-oracle-consumer
  • Unit Tests: cargo test -p anchorpoint-oracle-consumer

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Mar 27, 2026

@Agbasimere Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Ceejaytech25
Copy link
Copy Markdown
Contributor

@Agbasimere , lgtm!

@Ceejaytech25 Ceejaytech25 merged commit 918170e into ceejaylaboratory:main Mar 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Smart Contract: Soroban Price Oracle Consumer

2 participants