Skip to content

[codex] Add relayer-backed oracle sources and Hype price feed#368

Draft
ByteYue wants to merge 8 commits into
mainfrom
codex/sports-score-oracle-poc
Draft

[codex] Add relayer-backed oracle sources and Hype price feed#368
ByteYue wants to merge 8 commits into
mainfrom
codex/sports-score-oracle-poc

Conversation

@ByteYue

@ByteYue ByteYue commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR extends the relayer-backed oracle PoC for Gravity:

  • Adds sports score, price feed, and Polymarket settlement source handling.
  • Adds canonical payload validation so consensus signs deterministic bytes.
  • Wires relayer-backed oracle sources into the existing JWK consensus transport path.
  • Adds a Hype/HIP-3-style price feed adapter for stock-like symbols such as xyz:NVDA and xyz:GOOGL.

Hype price feed design

The on-chain URI declares the public task shape, for example provider, coin, dex, round, decimals, weights, and stale bounds. The validator-local relayer config supplies the RPC endpoint, so the chain does not store secret-bearing URLs.

The new adapter supports:

  • deterministic static observations for local tests;
  • provider=hype mode backed by a validator-local info endpoint;
  • asset matching with optional dex, including forms like NVDA and xyz:NVDA;
  • fixed-point parsing of decimal price strings;
  • contract-side aggregation via MultiSourceOracleResolver.

This is intentionally a price observation rail. If a Gravity PerpDex needs BBO, local mid, TWAP, or risk-specific transforms, that policy should live in the PerpDex/order-book contract or a separately versioned resolver policy, not inside the validator fetch adapter.

Polygon / Polymarket path

The Polymarket settlement source can follow finalized Polygon logs through a configured RPC endpoint such as POLYGON_QUICKNONE_HTTP_URL, then canonicalize the settlement payload for the JWK bytes path. This is meant for direct-fit finalized CTF conditions first, not arbitrary Polymarket UI replication.

Validation

Relayer price-feed tests were run:

cargo test -p reth-pipe-exec-layer-relayer price_feed_source -- --nocapture

Result: 10 tests passed, including Hype URL derivation and xyz:NVDA / xyz:GOOGL response parsing.

Previously run broader relayer and exec-layer checks:

cargo test -p reth-pipe-exec-layer-relayer -- --nocapture
cargo test -p reth-pipe-exec-layer-ext-v2 --lib -- --nocapture

A live Hype smoke was also run with validator-local env configuration. It did not print or commit any RPC URL, and confirmed xyz:NVDA and xyz:GOOGL return oraclePx, markPx, and midPx from the metaAndAssetCtxs info endpoint. Those values are time-sensitive and are not used as deterministic test fixtures.

The SDK PR runs the hype_price_feed E2E suite against this reth commit with provider=hype URIs and a local deterministic /info mock. It observed:

Mock Hype /info server running at http://127.0.0.1:18547/info
Hype price feed resolved: feedId=1001 roundId=1 price=19538000000
Hype price feed resolved: feedId=1002 roundId=1 price=35364400000
PASSED
Suite hype_price_feed PASSED
All suites passed!

Follow-up work

  • Add the deterministic dynamic request watcher for intra-epoch one-off requests.
  • Add production provider allowlists and typed failure handling for Pending / Unknown / Expired responses.
  • Add more Polymarket condition shapes after the metadata/rules registry exists.

@github-actions

Copy link
Copy Markdown
Contributor

Your PR title doesn't follow the Conventional Commit guidelines.

Example of valid titles:

  • feat: add new user login
  • fix: correct button size
  • docs: update README

Usage:

  • feat: Introduces a new feature
  • fix: Patches a bug
  • chore: General maintenance tasks or updates
  • test: Adding new tests or modifying existing tests
  • bench: Adding new benchmarks or modifying existing benchmarks
  • perf: Performance improvements
  • refactor: Changes to improve code structure
  • docs: Documentation updates
  • ci: Changes to CI/CD configurations
  • revert: Reverts a previously merged PR
  • deps: Updates dependencies

Breaking Changes

Breaking changes are noted by using an exclamation mark. For example:

  • feat!: changed the API
  • chore(node)!: Removed unused public function

Help

For more information, follow the guidelines here: https://www.conventionalcommits.org/en/v1.0.0/

@ByteYue ByteYue changed the title [codex] Mirror Polymarket settlements through oracle consensus [codex] Add relayer-backed oracle sources and Hype price feed Jun 30, 2026
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