Skip to content

feat: add validator price consensus Venus example - #21

Open
sanjeebdas1979 wants to merge 1 commit into
SubzeroLabs:mainfrom
sanjeebdas1979:feat/price-consensus-example
Open

feat: add validator price consensus Venus example #21
sanjeebdas1979 wants to merge 1 commit into
SubzeroLabs:mainfrom
sanjeebdas1979:feat/price-consensus-example

Conversation

@sanjeebdas1979

Copy link
Copy Markdown

Summary

Adds a new price-consensus Venus example that demonstrates how to aggregate multiple Rialo REX validator responses from a single HTTP price request and derive a deterministic median price.

What this example demonstrates

  • Fetches live price data through Rialo REX validators
  • Processes multiple validator responses from a RexReport
  • Rejects failed, malformed, empty, or invalid responses
  • Parses string-encoded prices into numeric values
  • Normalizes prices into integer cents
  • Computes min, max, and median consensus values
  • Stores consensus statistics in persistent workflow state
  • Includes a deployable PolkaVM artifact crate
  • Includes generated WIT and Venus manifest files
  • Adds the new example to the workspace

Workflow

  1. initialize stores the price feed URL and symbol
  2. check_price issues the asynchronous HTTP request
  3. REX validators independently fetch the external endpoint
  4. handle_price_report receives the aggregated validator report
  5. Valid prices are collected and sorted
  6. The median is stored as the consensus price

Validation

Tested end-to-end on Rialo Devnet using the Binance US BTC/USDT ticker endpoint.

Observed result:

  • Validator responses: 4
  • Valid responses: 4
  • Rejected responses: 0
  • Median consensus successfully calculated

Checks

  • cargo check -p rialo-price-consensus
  • cargo build --manifest-path venus/price-consensus/artifact/Cargo.toml
  • git diff --cached --check

@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

@sanjeebdas1979 is attempting to deploy a commit to the Subzero Labs Team on Vercel.

A member of the Team first needs to authorize it.

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