KingSparta69 GitHub avatar

chainlink-twap-research

KingSparta69

A TypeScript research toolkit for exploring Polymarket Chainlink TWAP prices, including decoding signed V2 reports, streaming from Chainlink Data Streams and Polymarket RTDS, and comparing spot vs TWAP feeds.

Stars

38

7-day growth

No data

Forks

73

Open issues

0

License

No data

Last updated

2026-07-31

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It addresses the gap between Polymarket's spot oracle and the upcoming Chainlink TWAP relay by providing exact E18 decimal handling, feed ID mapping, and CLI commands for live comparison and recording.

Who it is for

  • Developers integrating Polymarket crypto market resolutions
  • Researchers studying Chainlink TWAP vs spot price behavior
  • Traders or analysts using Polymarket close-price data
  • Backend engineers working with Chainlink Data Streams signed reports

Use cases

  • Comparing spot and 30s/60s TWAP prices near market close
  • Streaming and recording signed Chainlink TWAP reports for analysis
  • Mapping feed IDs to asset/window pairs for report decoding
  • Preparing for Polymarket RTDS TWAP relay availability in 2026

Strengths

  • Uses exact decimal strings for E18 fixed-point values instead of lossy JavaScript numbers
  • Supports both Chainlink Data Streams direct access and Polymarket RTDS relay paths
  • Provides practical CLI commands like selfcheck, watch, compare, and analyze
  • Clearly documents timestamps and schema V2 report fields for freshness validation

Considerations

  • RTDS TWAP streams are not live until August 4, 2026, so production relay testing is limited now
  • Direct Chainlink access requires credentials and a backend environment; no browser usage
  • The parser does not verify DON signatures, and testnet feed IDs are temporary until mainnet IDs are published

README quick start

Chainlink TWAP Research

TypeScript tooling to explore Polymarket Chainlink TWAP prices: Chainlink-computed 30-second and 60-second time-weighted average prices (TWAPs) for crypto assets used in Polymarket resolution.


What is Chainlink TWAP?

Polymarket crypto markets (e.g. BTC Up/Down 5m) resolve against Chainlink, not Binance or Coinbase spot. Today most tooling streams the spot oracle (crypto_prices_chainlink on RTDS) — a point-in-time Chainlink price tick. TWAP is a different product: a time-weighted average over a fixed lookback window, computed and signed by Chainlink’s Data Streams DON.

Spot oracle (crypto_prices_chainlink)Chainlink TWAP
What it isLatest Chainlink observationAverage price over the last 30s or 60s
Who computes itRelayed via Polymarket RTDSChainlink Data Streams (signed report)
Typical useLive charts, near-close momentumSettlement-style averaging, smoother reference
Available nowYes (RTDS)Testnet via credentials; RTDS relay Aug 4, 2026
Value formatJS number or decimal stringSigned E18 fixed-point (bigint / exact decimal string)

Lookback window ≠ update frequency

The 30 and 60 refer to the lookback window in seconds, not how often reports arrive. Chainlink computes the TWAP over that window and signs a report; update cadence is independent. Do not infer the window from message spacing — use observationsTimestamp (Chainlink observation time) for freshness.

Two windows, two feeds per asset

Each asset has separate feed IDs for 30s and 60s TWAP. Reports do not include symbol or window labels in the payload — you must map report.feedID yourself (see src/feeds.ts).

Example BTC/USD testnet:

WindowFeed ID
30s0x00027603752fe85a4c86c3adcc71abcb5ed826831d8afd4fd746a11c10cee188
60s0x0002e64f0b0166fa748cc05cd510a11442be16279873574f98c8cfa06b42b3dd

Supported testnet symbols: BTC, ETH, SOL, XRP, DOGE, LINK, BNB, TRX, ZEC, HYPE — each with 30s + 60s feeds (full table in docs).

Signed reports (schema V2)

Chainlink TWAP f

Description

chainlink twap research engine with 30-sec and 60-sec windows

Related repositories

Similar projects matched by category, topics, and programming language.

makecindy
Featured
makecindy GitHub avatar

cindy

Cindy is an open-source AI agent that runs locally on your machine, integrates multiple AI harnesses and models, and provides memory, skills, and automation to perform real work in your projects and apps.

AI & Machine LearningLarge Language Models
958
mereyabdenbekuly-ctrl
Featured
mereyabdenbekuly-ctrl GitHub avatar

clodex-ide

Clodex is an open-source, local-first agentic IDE that combines persistent AI tasks, code, terminal, browser, Git, models, memory, and governed execution in one Electron workspace, currently in technical preview.

AI & Machine LearningAI Agents
859
RongleCat
Featured
RongleCat GitHub avatar

grok-app

Grok App is a desktop command center built with Tauri 2 that wraps the local Grok Build CLI into a graphical workbench for managing sessions, projects, media, automations, and accounts.

Developer ToolsCLI & Terminal
356