Skip to content

Prediction market template using Chainlink Data Streams#49

Open
ejacquier wants to merge 3 commits into
mainfrom
prediction-market-data-streams
Open

Prediction market template using Chainlink Data Streams#49
ejacquier wants to merge 3 commits into
mainfrom
prediction-market-data-streams

Conversation

@ejacquier
Copy link
Copy Markdown
Contributor

Summary

New starter template: prediction-market-data-streams-ts, a mirror of the existing prediction-market-ts template, but using the Chainlink Data Streams REST API (off-chain, HMAC-authenticated) instead of on-chain Data Feeds for price
resolution.

Same three-workflow lifecycle, byte-identical shared PredictionMarket.sol contract, same pre-deployed Sepolia address — only the price source changes.

What's different from prediction-market-ts

Aspect Data Feeds (existing) Data Streams (this PR)
Price source On-chain PriceFeedAggregator contract Off-chain Data Streams REST API
Price read priceFeed.latestAnswer(runtime) + priceFeed.decimals(runtime) HTTP GET + HMAC-SHA256 auth + ABI decode (v3 Crypto Advanced report)
Decimals Read from the feed (8 for BTC/USD) 18 from report → scaled down to 8
Capabilities cron, log-trigger, chain-read, chain-write + http
Secrets None used by workflows DATA_STREAMS_API_KEY, DATA_STREAMS_API_SECRET

@ejacquier ejacquier requested review from a team as code owners April 24, 2026 19:07
@ejacquier ejacquier self-assigned this Apr 24, 2026
@github-actions
Copy link
Copy Markdown

👋 ejacquier, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@ejacquier ejacquier removed their assignment Apr 24, 2026
@dz235
Copy link
Copy Markdown

dz235 commented May 1, 2026

Suggestion:

  • Consider changing market definition from "Will BTC be above $100,000 by {expirationDate}?" to "Will BTC be above $100,000 on {expirationDate}?" See: https://polymarket.com/event/bitcoin-above-on-may-2

  • The current dispute workflow fetches the latest Data Streams price at the time the dispute workflow runs, then uses that fresh price to re-resolve the market. This means the dispute is not verifying the price used during the original resolution, nor the price at the market’s intended expiration/resolution time. For this template, the simplest fix is to document the current behavior explicitly.

Reviewed under the assumption that this is a template and not intended for product design advise.

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.

2 participants