Skip to content

Add Switchboard oracle#13

Open
mgild wants to merge 3 commits intohylo-so:mainfrom
mgild:mgild/switchboard-uprev
Open

Add Switchboard oracle#13
mgild wants to merge 3 commits intohylo-so:mainfrom
mgild:mgild/switchboard-uprev

Conversation

@mgild
Copy link

@mgild mgild commented Nov 11, 2025

This pull request adds initial support for integrating Switchboard oracles into the codebase, enabling price data retrieval and validation from Switchboard feeds alongside existing Pyth support. The main changes introduce a new module for Switchboard, update dependencies, and expand error handling for Switchboard-specific scenarios.

Switchboard Oracle Integration:

  • Added the switchboard-on-demand crate as a dependency and included it in the workspace and core library modules. [1] [2] [3]
  • Introduced the new switchboard.rs module in hylo-core, which provides functions to fetch, convert, and validate price data from Switchboard oracles, including staleness checks and decimal-to-fixed-point conversions. The module also includes comprehensive unit tests.

Error Handling Improvements:

  • Expanded the CoreError enum to include specific error variants for Switchboard oracle failures, such as stale feeds, insufficient samples, invalid values, excessive standard deviation, and price range calculation overflow.

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.

1 participant