Recipe 16 of 30
Do Up and Down shares ever cost less than $1 together on 5-minute BTC markets?
Yes, in most markets, but for milliseconds and a few dozen shares; download a day of BTC 5-minute top-of-book quotes from the archive and, with DuckDB, add the Up ask to the Down ask standing at every moment.
One Up share plus one Down share pays exactly $1 at resolution, so a moment when the two asks add up to less than $1 is a profit locked in before fees. GET /v1/polymarket/archive/url says where the day's top-of-book file for the 5-minute BTC family is, in one call. That l1_quotes file records every top-of-book change of both tokens, and DuckDB pairs each token's ask with the other token's standing ask. The full parameter list is on Archive file URL.
Quick answer
Ask where one day of 5-minute BTC top-of-book quotes is.
# where one day of top-of-book quotes for every 5-minute BTC market is, with its size
curl -H "X-API-Key: $VIKE_API_KEY" \
"https://data.vike.io/v1/polymarket/archive/url?date=2026-10-23&stream=l1_quotes&asset=btc&tenor=5m"Example response
Captured from the live API on 2026-10-24 at 17:22 UTC. One UTC day of 5-minute BTC markets is 185.6 MB and 19,263,916 quote rows. Each row is one change of one token's best bid, ask and their sizes, stamped with the venue time ts and the receive time local_ts, in epoch milliseconds.
{
"asset": "btc",
"bytes": 185618367,
"date": "2026-10-23",
"layout": "family",
"rows": 19263916,
"stream": "l1_quotes",
"tenor": "5m",
"url": "https://data.vike.io/archive/venue=polymarket/asset=btc/tenor=5m/date=2026-10-23/l1_quotes.parquet",
"venue": "polymarket"
}Variations
Download the file. redirect=true answers with the file's address, and -L follows it with the same key.
# save the day's quotes locally; DuckDB reads the local copy
curl -s -L -H "X-API-Key: $VIKE_API_KEY" \
"https://data.vike.io/v1/polymarket/archive/url?date=2026-10-23&stream=l1_quotes&asset=btc&tenor=5m&redirect=true" \
-o btc-5m-l1_quotes-2026-10-23.parquetAdd the two asks in DuckDB. Keep the last quote of each token in each millisecond, pair it with the other token's standing ask, and measure how long each pair price lasted.
WITH raw AS (
SELECT condition_id, token_id, local_ts, CAST(ask AS DOUBLE) AS ask, CAST(ask_size AS DOUBLE) AS ask_size,
file_row_number AS n
FROM read_parquet('btc-5m-l1_quotes-2026-10-23.parquet', file_row_number = true) WHERE ask > 0
),
q AS ( -- the quote standing at the end of each millisecond: the last row written for it
SELECT condition_id, token_id, local_ts, arg_max(ask, n) AS ask, arg_max(ask_size, n) AS ask_size
FROM raw GROUP BY ALL
),
pairs AS (
SELECT condition_id, min(token_id) AS t1, max(token_id) AS t2
FROM q GROUP BY condition_id HAVING count(DISTINCT token_id) = 2
),
a AS (
SELECT q.*, CASE WHEN q.token_id = p.t1 THEN p.t2 ELSE p.t1 END AS other
FROM q JOIN pairs p USING (condition_id)
),
s AS (
SELECT a.condition_id, a.local_ts, a.ask + b.ask AS pair_ask, least(a.ask_size, b.ask_size) AS shares
FROM a ASOF JOIN q b ON a.other = b.token_id AND a.local_ts >= b.local_ts
),
d AS (
SELECT *, lead(local_ts) OVER (PARTITION BY condition_id ORDER BY local_ts) - local_ts AS lasted_ms FROM s
)
SELECT condition_id, count(*) AS moments,
count(*) FILTER (WHERE pair_ask < 1) AS under_1,
min(pair_ask) AS cheapest_pair,
sum(lasted_ms) FILTER (WHERE pair_ask < 1) AS ms_under_1,
max(lasted_ms) FILTER (WHERE pair_ask < 1) AS longest_ms
FROM d GROUP BY condition_id ORDER BY ms_under_1 DESC NULLS LAST;On 2026-10-23 it finds a pair under $1 in 259 of the day's 289 markets: 54,346 of 14.5 million moments, 5.7 minutes in all across the day. The median such pair cost 0.98 for 46.5 shares, and only 4 moments lasted a second or more, the longest 2.9 seconds.
Other days. The index lists every day the family has, newest first.
# the newest days of 5-minute BTC quote files, with sizes
curl -H "X-API-Key: $VIKE_API_KEY" \
"https://data.vike.io/v1/polymarket/archive/datasets?asset=btc&tenor=5m&stream=l1_quotes&limit=3"Before you rely on it
Most sums under $1 are one message half applied
One change on the venue often moves both tokens, and the quote rows for it share a millisecond. Pairing raw rows
counts the half-applied state in between: on btc-updown-5m-1792765500 (14:25 UTC), raw rows gave close to 50 sums
under $1 where the end of each millisecond gave 9. What is left lasts milliseconds, shares caps what was there to
take, and the archive carries no fees, so treat a hit as a measurement, not an executable trade.
Ask your agent
Connected to the Vike MCP server (https://vike.io/mcp) in Claude, ChatGPT or Cursor, ask it in plain words. The polymarket_archive tool answers with the link, at 1 credit a call. The download and the DuckDB step are yours.
Give me the download link for the 5-minute BTC top-of-book quotes of 2026-10-23 on PolymarketRelated
- Polymarket bid-ask spread and depth history
- What does Polymarket liquidity look like in the final seconds before a market closes?
- Compare the order book of Polymarket's 5-minute and 15-minute crypto Up/Down markets, coin by coin
- Backtest a Polymarket strategy on the real historical book (fills, fees, lookahead)