# Pre-registered specification — Does Polymarket probability add anything to a BTC trend rule?

**Status: FROZEN.** This document was written, committed and tagged BEFORE any
data was fetched. Everything below is a commitment, not a description of what
the data turned out to show. If a number here does not match what the analysis
produces, the analysis is wrong (or this document was edited — the commit sha
and tag below are the evidence).

- **Frozen on:** 2026-11-09
- **Frozen tag:** `spec-polymarket-factor-2026-11-09` — the tag points at the
  commit that added this file, and that commit's sha IS the freeze timestamp.
  (A sha cannot be written inside the file it identifies, so the tag is the
  reference; `git show spec-polymarket-factor-2026-11-09` resolves it.)
- **Published byte-identical at:** `https://totodo.icu/polymarket-factor-spec.md`
- **Analysis script:** `scripts/polymarket-factor-study.ts`
- **Readout script:** `scripts/attribution-report.ts`

---

## 1. The question

Polymarket publishes a continuously-updating probability for events like
"Will Bitcoin dip below $95,000?" Some traders believe that a probability
moving in a particular direction carries information about the underlying
asset before the price reflects it.

**This study asks one narrow question:**

> On BTC/USDT 1-hour candles, does gating a simple trend entry on a
> Polymarket probability signal produce a result that beats the same trade
> chain entered at random times?

It is deliberately a small question. The interesting question — "do
prediction markets price anything useful?" — cannot be answered by 40
overlapping markets on one price path, and this study does not pretend to
answer it.

### 1.1 What this study is NOT

- It is **not** a claim about prediction markets as a class. The cohort is a
  few dozen highly-correlated markets riding one BTC price path.
- It is **not** a claim that Polymarket probabilities have no predictive
  power. The most this study can produce is "we did not observe a difference
  larger than X, under these rules, with this much data" — and if the power
  analysis in §8 comes out insufficient, the honest conclusion is **no
  conclusion**, not "no effect".
- It is **not** a claim that TodoAI can reproduce this. TodoAI's engine
  evaluates one series (its own candles). The PM-probability arm cannot be
  expressed in the product, so it is evaluated by this study's script. What
  TodoAI *can* reproduce is the random-baseline machinery (§9).

---

## 2. Data sources

| Series | Source | Auth | Notes |
|:---|:---|:---|:---|
| BTC/USDT 1h candles | OKX public REST `/api/v5/market/candles` | none | `bar=1H`, `limit=100` per call, paged backwards |
| Market metadata | Polymarket Gamma `/markets` | none | paginated, filtered server-side where possible |
| Probability history | Polymarket CLOB `/prices-history` | none | `market=<tokenId>&startTs=&endTs=&fidelity=60` |

**Hard rules of the probability endpoint, established by measurement on
2026-11-08 and re-verified by the script:**

- `startTs` and `endTs` are **mandatory**. Omitting them returns 400 with
  *"the time component is mandatory"*. This is not a "no data" response; it is
  a malformed request.
- The window is **capped at 14 days**. A wider window is rejected with
  *"interval is too long"*. Longer series must be **stitched** from
  consecutive ≤14-day windows.
- `fidelity=60` gives hourly points. 360 → 6-hourly, 1440 → daily.
- Points are de-duplicated by timestamp, and the windows are stitched with no
  gap (a window that fails to fetch is a **gap**, recorded, and the affected
  region is not traded — see §6).

**Graceful degradation:** a single fetch may be retried up to 3 times with a
backoff. If it still fails, the gap is recorded and the analysis continues.
If the resulting gaps are large enough that the minimum span in §6 is not
met, the study reports **no conclusion** and publishes no results section.

---

## 3. Cohort (frozen)

A market is **in** the cohort if and only if all of the following hold.
This list is closed at freeze time: markets that appear later go into the
*next* edition, not this one.

| # | Criterion | Value |
|:--|:---|:---|
| C1 | Underlying asset | **BTC only** |
| C2 | Market type | **Directional price level**: "dip below $X", "reach $X", "above $X on <date>" |
| C3 | Expiry | ≥ **20 days** after the analysis run date |
| C4 | 24h volume | ≥ **US$25,000** |
| C5 | Probability history | ≥ **100 points** available in a ≤14-day window at `fidelity=60` |
| C6 | **Direction readable** | The question must say whether the event means BTC rises or BTC falls. A question that does not is excluded, not guessed at. |

**Explicitly excluded, and why:**

- **15-minute "Bitcoin Up or Down" markets.** No meaningful history, and they
  answer a different question. Measured on 2026-11-08: 0 points at 1-hour
  granularity, 1 point at daily granularity.
- **ETH markets.** Gating BTC entries with an ETH contract's probability
  change is a category error.
- **Market-structure markets** ("Will November be the best month for
  Bitcoin?"). Their probability is not a BTC direction signal — it describes
  a *relative ranking*, and a rising probability there means "less likely to
  be the best month", not "BTC is going up".
- **Questions with no readable direction.** A gate with the wrong sign still
  produces plausible-looking numbers, which is the dangerous kind of wrong.

**Cost of the exclusions:** the cohort shrinks. That is accepted deliberately —
see §8, where the sample is counted by factor family rather than by market
count for exactly this reason.

---

## 4. Frozen parameters

| Parameter | Value | Where it comes from |
|:---|:---|:---|
| Instrument | BTC/USDT | |
| Bar | 1 hour | |
| Candle source | OKX public REST | no key required |
| Initial capital | **10,000 USDT** | |
| Fee rate | **0.001** per fill | `DEFAULT_FEE_RATE` in `src/lib/config.ts` |
| Stop loss | **2%** | |
| Take profit | **4%** | |
| Entry rule | close **>** SMA(20) → open LONG | |
| Exit | SL/TP only, plus forced close at the end of the series | see §5.2 |
| Short entries | **none** | see §5.2 |
| SMA warm-up | first **20** bars are not tradable | engine convention |
| PM history fetched | **60 days** | §6 |
| Probability window | 14 days, `fidelity=60` | endpoint cap |
| Random replays | **1000** per market | |
| RNG seed | **20261109** | fixed; see §10 |

---

## 5. The two arms

Both arms trade the **same candles**, with the **same** fee, SL and TP
settings. They differ in exactly one thing: whether a Polymarket signal is
required before an entry is allowed.

### 5.1 Arm A — technical baseline

```
on bar i:
  if SMA(20) is defined at bar i and close[i] > SMA(20)[i]:
      emit OPEN_LONG
  (no other intent is ever emitted)
```

### 5.2 Arm B — technical baseline gated by the PM signal

```
on bar i:
  if SMA(20) is defined at bar i and close[i] > SMA(20)[i]:
      if pmGate[i] is true:
          emit OPEN_LONG
      else:
          emit HOLD
  (no other intent is ever emitted)
```

`pmGate[i]` is defined in §6.

**Why there is no sell rule.** The engine's intent semantics are exactly
three, and they are not the ones a reader would guess:

- `buySignal` → `OPEN_LONG`
- `sellSignal` → `OPEN_SHORT` — **a reversal, not a close**
- `CLOSE_LONG` / `CLOSE_SHORT` → **never read by the engine**

So writing "exit when close < SMA(20)" as a DSL sell rule would open a
SHORT, not close a LONG. Both arms therefore exit **only** through SL, TP or
the forced close at the end of the series. This is a property of the engine
this study runs on, and the same property applies to any reproduction.

### 5.3 Worked intent sequence (required for reproduction)

Given candles `c[0..N-1]`, SMA(20) `s[i]`, and gate `g[i]`:

```
i        s[i] defined?  close[i] > s[i]?  g[i]?   arm A intent   arm B intent
0..19    no              —                  —      HOLD           HOLD
20       yes             yes                true   OPEN_LONG      OPEN_LONG
21       yes             yes                false  OPEN_LONG      HOLD
22       yes             no                 true   HOLD           HOLD
...
last bar (N-1)          —                  —      force close any open position
```

The engine's own semantics on a bar that receives `OPEN_LONG` while a LONG
is already open: the intent is ignored (a position is not stacked). The
forced close at the last bar is the only exit other than SL/TP.

**SL/TP mechanics (identical to `src/lib/backtest-engine.ts`):** stop and
target are detected on the bar's high/low; the fill is at the close; when a
single bar touches both, **the stop wins** (conservative).

---

## 6. The PM signal and its alignment

### 6.1 The gate

**The gate is stated on the DIRECTIONAL probability — the probability that
BTC goes UP — not on the market's raw YES probability.**

For a market whose question is about BTC rising ("will Bitcoin reach $120k",
"will Bitcoin be above $100k on Dec 1"), the YES probability *is* the
directional probability. For a market whose question is about BTC falling
("will Bitcoin dip below $95k"), the YES probability is the probability of a
dip, so the directional probability is its complement.

```
d(t) = p(t)        if the event means BTC rises
d(t) = 1 - p(t)    if the event means BTC falls

pmGate[i] = ( d(t_i) - d(t_i - 14 days) ) > 0.01
```

That is: **the implied probability of BTC rising must have increased by more
than 1.0 percentage point over the trailing 14 days.**

**Why this is not a detail.** Both arms are long-only, so "d rising" has to
mean the same thing in every market. Gating a long entry on a rising dip
probability would fire the gate on the bearish side of the market — and it
would still produce plausible-looking percentiles, which is the dangerous
kind of wrong. A market whose question does not reveal its direction is
**excluded** (cohort criterion C6), not assigned a direction by guesswork.

**Why a change rate and not a level.** Over 14 days a probability often moves
only a few tenths of a percentage point; a level threshold would then be
either always-true or always-false depending on where the market started.
The change rate is scale-free with respect to the starting probability.

**Why 1.0pp.** The probability is quoted to three decimals, so 1.0pp is
100× the quoting granularity. It is also the point at which a move is
plausibly a view rather than a quote refresh. A LARGER threshold would fire
so rarely that arm B would be degenerate on most markets — and a degenerate
arm is excluded by §7, so a threshold that guaranteed degeneracy would
guarantee "no conclusion" for a reason that has nothing to do with the
market. Freezing 1.0pp is a commitment to running a test that can fail.

### 6.2 Alignment

- PM points are sampled at the **close of each BTC 1-hour bar**: take the
  **last PM point at or before** that bar's timestamp. No interpolation.
- **Missing PM regions are not tradable.** No forward-filling — filling
  would manufacture a signal out of nothing. A bar whose gate cannot be
  evaluated is `HOLD` for arm B.
- The fraction of the analysis window that is untradable because of missing
  PM data is **reported**.
- The trailing 14-day change rate needs 14 days of history, so the **first
  14 days after the first available PM point are warm-up** and are not
  traded by arm B.

### 6.3 Time span

- PM history fetched: **60 days** (stitched from consecutive ≤14-day
  windows).
- PM series starts at `T0`.
- Warm-up: `[T0, T0 + 14 days)` — not tradable.
- **Analysis window: `[T0 + 14 days, T0 + 60 days)` — 46 days.**
- Minimum tradable span: **28 days**. If the usable span (analysis window
  minus PM gaps) is shorter, the study reports **no conclusion**.

---

## 7. The degenerate-arm rule (hard precondition)

Arm B is gated, so it can fail to trade at all. If it does, the random
baseline degenerates: with zero trades the random chain is empty, every
replay is flat, the distribution is all zeros, and the percentile of arm B's
return is an artefact of a division by nothing.

That would produce a confident, wrong result — "worse than random" — out of
a market where the arm simply never fired.

**Therefore, before any market is scored:**

- Arm B must open **at least N = 5 trades** on a market for that market to
  be scored. Otherwise the market is **VOID**: excluded from the statistics,
  and **counted and reported** as void. A void market is never recorded as
  a score of 0.
- Arm B must open at least one trade on **at least M = 3 markets** for the
  study to produce a result at all. If fewer than 3 markets are non-void,
  the study reports **no conclusion**.

**A void market and a market where arm B lost are different results and must
never share a sentence.** If the article says "arm B did not beat random",
that sentence is only valid for the markets where arm B actually traded.

---

## 8. Statistics

### 8.1 Per-market statistic

For each non-void market:

1. Run arm B's trade chain through the random-entry baseline (1000 replays,
   the chain is **arm B's own** trades — not arm A's).
2. Place **arm B's return** into **arm B's own** distribution with the
   product's own `percentileOf`.
3. The resulting number is the market's **percentile**.

Using arm A's distribution for arm B's return would put arm B's result into
a distribution built from a different trade chain, and the comparison would
stop isolating the one variable it exists to isolate.

### 8.2 Main statistic and factor families

The main statistic is the **median of the per-market percentiles**.

Markets are grouped into **factor families** by question structure, and the
multiplicity correction is applied **within a family**, not across all
markets:

| Family | Markets | Direction |
|:---|:---|:---|
| F1 `dip` | "will Bitcoin dip below $X" | bearish — the directional probability is `1 - p` |
| F2 `reach` | "will Bitcoin reach $X" | bullish — the directional probability is `p` |
| F3 `above` | "will Bitcoin be above $X on \<date\>" | bullish — the directional probability is `p` |

Correction: **Holm–Bonferroni within each family**, at family-wise α = 0.05.

**Why not per-market?** The markets are not independent observations of the
same question; they are near-duplicates of one another, all priced off the
same BTC path. Correcting across 40 markets would be correcting for a
multiplicity that does not exist.

### 8.3 Independent units — the conservative count

The 46-day analysis window with 14-day overlapping change-rate windows
contains roughly `46 / 14 ≈ 3` **independent** units, not 46 observations and
not 43 markets.

**Every power calculation uses n = 3** (or the actual computed count, if
lower). Using the optimistic count would report an effect size the study
cannot detect, and the "narrow the wording" branch of §8.5 would then never
trigger.

### 8.4 Power statement (computed, not asserted)

The analysis script bootstraps the per-market percentiles by resampling
**independent units** (not markets) and reports the 95% confidence interval
of the median percentile.

**Frozen meaningful effect size: 10 percentile points.** A result is called
"meaningfully different from random" only when the CI excludes the noise
band. The noise band is the product's own: percentiles in **[45, 60)** are
"indistinguishable from random" (`BELOW_RANDOM_PERCENTILE = 45`,
`WEAK_EDGE_PERCENTILE = 52`, `MODERATE_EDGE_PERCENTILE = 60` in
`src/lib/random-baseline.ts`).

- median percentile **≥ 60** → "beats the random baseline"
- median percentile **< 45** → "worse than the random baseline"
- median percentile in **[45, 60)** → "indistinguishable from random"
- **CI overlaps [45, 60)** → the study reports **no detectable difference**,
  and says so with the CI width attached.

### 8.5 What the study is allowed to conclude

| Situation | Permitted wording |
|:---|:---|
| CI excludes [45, 60), median ≥ 60 | "beats the random baseline **in this sample, under these rules**" |
| CI excludes [45, 60), median < 45 | "worse than the random baseline **in this sample, under these rules**" |
| CI overlaps [45, 60) | "**no difference was observed** in this sample under these rules", with the CI width and the alternative explanations listed |
| Fewer than 3 non-void markets | "**no conclusion**" — no results section is published |
| Usable span < 28 days | "**no conclusion**" |

**Forbidden in all cases:** "Polymarket probabilities have no predictive
power for Bitcoin", "prediction markets do not work", or any phrasing that
generalises from this sample to the class of markets.

**Mandatory alternatives to be listed whenever the result is "no difference
observed":** sampling bias; rule selection; the favorite–longshot bias
documented for Polymarket; near-static probability levels in some markets
(very low signal-to-noise); liquidity filtering; price discovery dominated
by a small number of traders.

---

## 9. What the reader can and cannot reproduce

**In TodoAI:** the random-baseline machinery — the percentile arithmetic, the
thresholds and the verdict bands are the product's own
(`src/lib/random-baseline.ts`), and any reader can run the same check on
their own strategy. See the article *"Is your strategy better than random?"*.

**Not in TodoAI:** the PM-probability arm. The engine evaluates exactly one
series (the strategy's own candles); there is no external-series input, and
adding one is not part of this study. The reproduction path for that arm is
this study's script.

**This study is not reproducible inside TodoAI, and the article must not
claim otherwise.**

---

## 10. The reproduction boundary

The random sequence is fully determined by four inputs:

1. the exact candle series (timestamp + OHLCV),
2. `initialCapital`,
3. the trade chain it is derived from,
4. the seed.

The default seed is `hashCandles(candles) ^ initialCapital`; this study
**pins the seed to 20261109** and reports the derived seed as well.

Changing any one of the four changes the distribution. A reader who
re-fetches the candles from OKX must get the **same** candles — the API
returns the live series, so a re-run days later will not reproduce the exact
distribution unless the candle snapshot is archived. **The script archives
the candles it used alongside its output.**

---

## 11. The freezing procedure

1. Write this file. Commit it. Tag it `spec-polymarket-factor-2026-11-09`.
2. Publish the **byte-identical** file at `website/public/polymarket-factor-spec.md`.
   (The repository is private, so a GitHub permalink is not resolvable by
   readers. Publishing the same bytes is the entire point — a reader must be
   able to check that the published spec is the frozen spec.)
3. **Only then** fetch data.

The commit sha and tag are the timestamp evidence that the freeze preceded
the data. If this file is edited after freezing, the tag still points at the
original — and a diff between the tagged version and the working copy is
itself the disclosure.

---

## 12. References

Every number quoted in the accompanying article must come from this table,
and each row was checked against the original on 2026-11-08. Re-check before
publication; a row that does not verify is deleted from the article, not
softened.

| Source | Title | Verified figures |
|:---|:---|:---|
| [arXiv 2609.12878](https://arxiv.org/abs/2609.12878) | The Favorite-Longshot Bias in Prediction Markets: Evidence from Polymarket (Cardozo & Rivero-Wildemauwe, 2026-09-11) | 588M trades / 2.48M wallets, 2022-11 → 2026-03; low-priced contracts overvalued by ≈0.23pp, high-priced by ≈0.82pp; **equal-weight by sub-market vs equal-weight by parent event reverses the conclusion** (longshots lose 6.30% equal-weighted, gain 4.09% parent-weighted); crypto longshots −12.63% to −14.84% |
| [Protodex](https://protodex.io/blog/blog-2026-06-17-can-you-beat-polymarket.html) | I analyzed 932 resolved Polymarket markets — can you actually beat them? | 932 resolved markets; sampled ≈6h before expiry; mean(actual − price) ≈ −1.5pp; z ≈ −1.4; **not significant** |
| [Jerusalem Post](https://www.jpost.com/science/article-894967) | Study: A tiny elite sets Polymarket's prices while most users lose money (Gómez-Cram, Guo, Ingerslev Jensen & Kung, 2026-05-03) | ≈3% of traders contribute most price discovery; those <3.5% of accounts take >30% of profits; 67% of accounts are "unlucky or unskilled losers"; $13.76B / 1.72M accounts / 98,906 events / 2023–2025 |

---

## 13. Change log

| Date | Change |
|:---|:---|
| 2026-11-09 | **Amendment 1 (before any data was fetched).** The gate was originally stated on the market's raw YES probability. That is a category error for the "dip below $X" family, where a rising YES probability is a BEARISH signal while both arms are long-only — the gate would have fired on the wrong side of the market. The gate is now stated on the **directional probability** (§6.1): `d = p` for a rising claim, `d = 1 - p` for a falling claim, and the gate fires when `d` rises by more than 1.0pp. Cohort criterion **C6** was added: a market whose question does not reveal its direction is excluded rather than assigned a direction by guesswork. The tag was moved to the amended commit. **No data had been fetched when this amendment was made**, so the pre-registration is intact. |
| 2026-11-09 | Frozen. No changes after this line without a new tag and an explicit note in the article. |
