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>:tenoris5m,15m,1h,4hor1d,startthe window start in epoch SECONDS; the end isstart+ the tenor, which is the market'send_date. Example:btc-updown-5m-1796151300is "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 werebitcoin-up-or-down-november-17-2026-5pm-etandbitcoin-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, inoutcomesandtoken_ids.
Call it
Use the first of these that is available:
- MCP:
polymarket_chainlink_prices(symbol, optionalseries,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). - 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 - curl: the credential is
VIKE_API_KEY, elseapi_keyoranon_tokenfrom~/.vike/config.json(Windows%USERPROFILE%\.vike\config.json); with none, get a free anonymous token withcurl -s -X POST https://data.vike.io/v1/anon -H 'Content-Type: application/json' -d '{"source":"skill-curl"}'and save itstokenthere as"anon_token"(seevike-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). Above1sa row is the FIRST tick at or after the bucket start: the price the window compares.markets --view searchrow: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-1796151300started at 60,820.66 and ended at 60,708.84, andsettlementsaysDown; the 4-hour windowbtc-updown-4h-1796072400went 58,250.77 to 59,451.10,Up.settlementis the answer of record; the prices explain it. price_ts_mslater thants_msmeans 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
--limitwithhas_moretrue: keep paging. Empty withhas_morefalse near now = caught up; ask again later from the lastts_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 bare5malso matches15mslugs. - Series stats ("how often did Up win", streaks):
settlements --slug-prefix <asset>-updown-<tenor>-over the period, then countwinning_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-pricescovers only the eight coins above. - The window's book and trades:
vike-polymarket-order-bookandvike-polymarket-tapewith 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, ...orinvalid 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-mswas 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=getsdid 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 4hor1dfor 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/downvike-polymarket-find-market- slug search and idsvike-candles- the probability path of Up or Down inside a window
