360 Secure SkillHub
360 安全技能中心

vike-polymarket-updown

通过 MCP、vike-data CLI 或 REST 查询 Polymarket 加密币 5 分钟至日线涨跌市场的 Chainlink 起始/结束价格、市场信息与结算结果,并可按 slug 前缀统计一段时间的 Up/Down 胜负,用于判断单窗涨跌和回测系列表现。

分类:数据
vikeio
vikeio
热度 38.28
最近更新 2026-12-02 09:59:07

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add vikeio/vike-polymarket-updown
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
vike-polymarket-updown
description
Polymarket's short crypto up/down markets (BTC, ETH, SOL, XRP, DOGE, BNB, HYPE, ZEC over 5 minutes, 15 minutes, an hour, 4 hours or a day) - the exact Chainlink price each window resolves on at its start and its end (the "price to beat"), which side won, and how a whole series resolved over a day or a week, with the slug and time rules that find the market of any window. Use when the user asks "what was the BTC price to beat in the 5-minute market at 14:00" / "did the ETH 15-minute market go up or down" / "how often did Up win on BTC 5m today" / "which Chainlink price did Polymarket use" / "backtest the up/down markets".
allowed-tools
Bash(vike-data:*)

vike-polymarket-updown

An up/down market asks whether a coin's Chainlink price at the END of a window is higher than at its START. Three reads answer everything about one: the prices (chainlink-prices), the market (markets --view search) and the outcome (settlement / settlements).

The window rules

  • Slug = <asset>-updown-<tenor>-<start>: tenor is 5m, 15m, 1h, 4h or 1d, start the window start in epoch SECONDS; the end is start + the tenor, which is the market's end_date. Example: btc-updown-5m-1796151300 is "Bitcoin Up or Down - December 1, 1:55PM-2:00PM ET", 18:55 to 19:00 UTC. Hourly and daily markets use this form since 2026-11-18; before that they were bitcoin-up-or-down-november-17-2026-5pm-et and bitcoin-up-or-down-on-november-18-2026.
  • Questions are in US Eastern time; the API is UTC epoch ms. 5-minute, 15-minute and hourly windows sit on the UTC grid. 4-hour and daily windows do not: a 4-hour window starts on Eastern 4-hour marks (4PM ET = 21:00 UTC in winter) and a daily one at noon ET (17:00 UTC in winter).
  • Outcomes are Up, Down, in that order, in outcomes and token_ids.

Call it

Use the first of these that is available:

  1. MCP: polymarket_chainlink_prices (symbol, optional series, interval, from_ms, to_ms, cursor, limit); polymarket_markets (view: "search", query); polymarket_settlement (condition_id); polymarket_settlements_bulk (slug_prefix, from_ms, to_ms, cursor, limit).
  2. CLI:
    # 5m / 15m / 1h: interval = the tenor, from = start, to = end + 1 -> two rows, start and end price
    vike-data polymarket chainlink-prices btc --interval 5m --from-ms 1796151300000 --to-ms 1796151600001 --json
    # 4h / 1d (Eastern time, off the UTC buckets): one 1m row at the start, one at the end
    vike-data polymarket chainlink-prices btc --interval 1m --from-ms 1796072400000 --to-ms 1796072460000 --json
    vike-data polymarket chainlink-prices btc --interval 1m --from-ms 1796086800000 --to-ms 1796086860000 --json
    # the market of a window, and how it resolved
    vike-data polymarket markets --view search --query btc-updown-5m-1796151300 --json
    vike-data polymarket settlement <condition_id> --json
    # a whole series: every BTC 5-minute result of 2026-12-01
    vike-data polymarket settlements --slug-prefix btc-updown-5m- --from-ms 1796083200000 --to-ms 1796169600000 --limit 5000 --json
    
  3. curl: the credential is VIKE_API_KEY, else api_key or anon_token from ~/.vike/config.json (Windows %USERPROFILE%\.vike\config.json); with none, get a free anonymous token with curl -s -X POST https://data.vike.io/v1/anon -H 'Content-Type: application/json' -d '{"source":"skill-curl"}' and save its token there as "anon_token" (see vike-core).
    curl -s "https://data.vike.io/v1/polymarket/chainlink_prices?symbol=eth&interval=15m&from_ms=1796151600000&to_ms=1796152500001" -H "X-API-KEY: $TOKEN"
    curl -s "https://data.vike.io/v1/polymarket/settlements/bulk?slug_prefix=eth-updown-15m-&from_ms=1796151600000&to_ms=1796155200000" -H "X-API-KEY: $TOKEN"
    

chainlink-prices <symbol>: btc, eth, sol, xrp, doge, bnb, hype, zec (btcusd, BTC-USD work too). --series price (default, what the markets resolve on) or twap60 (its 60-second time-weighted average). --interval 1s (default, every tick), 1m, 5m, 15m, 1h, 4h, 1d. --from-ms inclusive, --to-ms EXCLUSIVE, both on the bucket start. --limit default 100 on the CLI and MCP, 1000 on REST, at most 10,000.

Output

  • chainlink-prices: {rows, has_more, next_cursor}, oldest first. Each row: ts_ms (the bucket start), price_ts_ms (the tick's own time), price (USD). Above 1s a row is the FIRST tick at or after the bucket start: the price the window compares.
  • markets --view search row: condition_id, slug, end_date (epoch ms), token_ids (Up, Down), active / closed.
  • settlement(s) rows: winning_outcome (Up / Down), winning_token_id, payouts, resolved_ts_ms, question, slug.

Reading

  • A higher end price is Up, a lower one Down (a tie follows Polymarket's own rules: read settlement). Checked 2026-12-01: btc-updown-5m-1796151300 started at 60,820.66 and ended at 60,708.84, and settlement says Down; the 4-hour window btc-updown-4h-1796072400 went 58,250.77 to 59,451.10, Up. settlement is the answer of record; the prices explain it.
  • price_ts_ms later than ts_ms means the bucket's first seconds had no tick, so the row is a later price. About 1.6 % of seconds have none (most gaps are single seconds; about 85 a day last 6 to 30 seconds, every coin at once); nothing is filled in.
  • Prices start 2026-11-06 09:24:15 UTC. Earlier windows have no rows here; their results are still in settlements.
  • Near now: rows are stored once a minute, so the last minute may be missing. A page can be shorter than --limit with has_more true: keep paging. Empty with has_more false near now = caught up; ask again later from the last ts_ms + 1.
  • Find a window's market from a time the user gives: convert it to UTC, take the window start in epoch seconds, search the WHOLE slug (btc-updown-5m-<start>): a bare 5m also matches 15m slugs.
  • Series stats ("how often did Up win", streaks): settlements --slug-prefix <asset>-updown-<tenor>- over the period, then count winning_outcome. A day is 288 five-minute, 96 fifteen-minute, 24 hourly, 6 four-hour markets.
  • Other up/down series (gold, silver, oil, stocks) also have slugs and settlements, but no prices here: chainlink-prices covers only the eight coins above.
  • The window's book and trades: vike-polymarket-order-book and vike-polymarket-tape with its token ids; whole days of a series as Parquet: vike-pm-l2-archive (--asset btc --tenor 5m).

Errors

  • chainlink_prices requires symbol: one of btc, eth, ... or invalid symbol: one of btc, eth, ... (exit 1).
  • invalid interval: one of 1s, 1m, 5m, 15m, 1h, 4h, 1d; invalid series: one of price, twap60; chainlink_prices requires to_ms > from_ms.
  • Two rows expected, one returned: --to-ms was the end itself (exclusive). Pass end + 1.
  • settlement []: not resolved on chain (yet); the prices still tell which side is ahead.
  • REST: errors are 400 {"error": "..."}, and an unknown parameter is refused (?start= gets did you mean 'from_ms').
  • Exit code 3: the anonymous token's daily limit; tell the user to run vike-data login, do not retry.

Anti-patterns

  • Don't use --interval 4h or 1d for a 4-hour or daily market: those buckets are UTC, the windows are Eastern.
  • Don't quote an exchange's price (Binance, Coinbase) as the price to beat: these markets resolve on the Chainlink stream served here.
  • Don't call a 5-minute result a signal: a single window is noise; count a series.

Pairs well with

  • vike-polymarket-resolutions - settlements of any market, not only up/down
  • vike-polymarket-find-market - slug search and ids
  • vike-candles - the probability path of Up or Down inside a window