vike-polymarket-resolutions
Both commands read the on-chain resolution, keyed by the market's condition_id (0x + 64 hex), never an outcome token id. Find ids with vike-polymarket-find-market.
Call it
Use the first of these that is available:
- MCP:
polymarket_settlement(condition_id);polymarket_settlements_bulk(optionalfrom_ms,to_ms,slug_prefix,cursor,limit). - CLI:
vike-data polymarket settlement 0xa5ca27858ef5676943b3961ab3e14d9cd7c614fe33591c14e0f6023c7a9391c8 --json vike-data polymarket settlements --from-ms 1796083200000 --to-ms 1796169600000 --limit 5000 --json # every market resolved on 2026-12-01 vike-data polymarket settlements --slug-prefix btc-updown-5m- --from-ms 1796083200000 --to-ms 1796169600000 --limit 5000 --json vike-data pm settlements --slug-prefix btc-updown-5m- --cursor "<next_cursor>" --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/settlements/0xa5ca27858ef5676943b3961ab3e14d9cd7c614fe33591c14e0f6023c7a9391c8" -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"
settlements: --from-ms inclusive, --to-ms exclusive, both on the RESOLUTION time (epoch ms); --slug-prefix lowercase letters, digits and -, up to 100 characters; --limit default 100 on the CLI and MCP and 5000 on REST, at most 5000. Page while has_more is true with --cursor <next_cursor>; each page is one request, so ask for full pages.
Output
settlement: [], or one row. settlements: {settlements, has_more, next_cursor}, oldest resolution first, the same rows:
condition_id, slug, question, outcomes (labels), token_ids (same order), winning_index, winning_outcome, winning_token_id, payouts (per outcome, e.g. [0, 1]), resolved_block, resolved_ts_ms (epoch ms), market_known.
Reading
[]means the chain has not resolved it, not that the market is open. A market can sit past its end date unresolved for days or weeks, and a cancelled or voided market may never get an on-chain resolution. Read the market's own status withvike-polymarket-market-detail.- When:
resolved_ts_msis the on-chain time. The up/down markets resolve seconds after their window ends (2026-12-01: a BTC 5-minute market ending 19:00:00 UTC resolved at 19:00:16). winning_index-1 (a void or a tie) leaveswinning_outcomeandwinning_token_idempty;payoutsthen shows the split.market_known: false= a resolution with no market row:slug,question,outcomesand token ids are empty while the on-chain fields are exact, and such a market never matches--slug-prefix.- A series:
--slug-prefixwith the series' stem. Up/down markets are<asset>-updown-<5m|15m|1h|4h|1d>-<window start, epoch seconds>(hourly and daily ones since 2026-11-18; before that they werebitcoin-up-or-down-<month>-<day>-<year>-<hour>-etandbitcoin-up-or-down-on-<month>-<day>-<year>). Countwinning_outcomeover the rows for "how often did Up win"; one day of a 5-minute series is 288 markets. settlementis live;settlementspages are rebuilt every 5 minutes, so a market resolved in the last 5 minutes may be missing there.- To join to trades or the archive, use
token_idsandwinning_token_id.
Errors
condition_id is the market's 0x... hex id; an outcome token id matches nothing here(exit 1).settlements/bulk requires to_ms > from_ms;invalid slug_prefix: lowercase letters, digits and '-', up to 100 characters;invalid cursor: pass back a previous page's next_cursor verbatim.- REST: errors are 400
{"error": "..."}, and an unknown parameter is refused. Bulk filters sent to/settlements/{condition_id}are refused with a pointer to/settlements/bulk; a bare/v1/polymarket/settlementsis a 404 on purpose. - Exit code 3: the anonymous token's daily limit; tell the user to run
vike-data login, do not retry.
Anti-patterns
- Don't report a market as "still open" from
[], or as "resolved" from an end date in the past. - Don't fetch markets one by one for a backtest: one
settlementspage holds 5,000. - Don't take the resolution time from the market's
end_date.
Pairs well with
vike-polymarket-updown- the Chainlink price an up/down market resolved onvike-pm-l2-archive- the order books and trades to join these outcomes tovike-polymarket-trader- a wallet's realized P&L, which counts only resolved markets
