# Polygon log index is not Polymarket matching order — Within a Polygon block the log index is not Polymarket's matching order: about one pair of trades in four is reversed

> Da **Sinapsi** (Prediction Markets, Measured — Mechanics, Backtest Traps and Strategies That Don't Survive) · CC BY 4.0 · usata 0× con esito verificato

On-chain fill events of Polymarket trades are often sorted by (block, log index) to decide who traded first. Between two different transactions in the same block that order does not follow the order in which the exchange matched them: on one maker account's own trades it was reversed in 24.5% of pairs, and in 38% when the two matches were less than 50 ms apart. Inside a single transaction the log order is reliable, and across blocks it is nearly so. Outcome: TRAP, confirmed by two independent measurements.

## The trap

Each matched trade is settled by a transaction that emits fill events, each with a position in the block (the log index). Sorting by block and log index gives a total order with no ties, which looks like the exchange's sequence.

On busy short-lived markets the comparison often falls inside one block. In one study of three accounts on BTC 5-minute Up/Down markets, 46,819 of 88,673 market cells traded by all of them had the second account in the same block as the first.

## How it was tested

Three steps, all on 23 October 2026.

Code and chain research. In the public exchange contract (version 2, commit of 13 April 2026) `matchOrders` can be called only by an operator and takes one taker order plus an array of maker orders. Twenty crowded blocks between 24 September and 19 October 2026 were read from a public RPC: 631 matching transactions.

Direct measurement. One maker account's own trades from 18 October 00:00 to 23 October 09:38 UTC: 2,826 trades, all as maker, in 2,826 distinct transactions. The user channel of the exchange websocket sends a `trade` frame with status MATCHED and a millisecond timestamp, plus an official `match_time` in seconds. There were 286 blocks with at least two of the account's transactions, giving 518 same-block pairs.

Book measurement. For three taker accounts that often trade together, 13–21 October 2026, 150,306 transactions were matched without ambiguity to chain rows, 142,445 of them with a public `last_trade_price` print (server time in milliseconds) in the recorded book; pairs are same block and same token.

## Result

Between transactions of the same block (TRAP):

| Measure | Reversed against (block, log index) |
|---|---|
| Own trades, millisecond frame time | 127 of 518 pairs = 24.5% |
| Own trades, official `match_time` (seconds), non-tied pairs | 52 of 268 = 19.4% |
| Matches 0–50 ms apart | 38% |
| 50–200 ms / 200–500 ms apart | 29% / 30% |
| 0.5–1 s / 1–2 s apart | 12% / 13% |
| Book prints, three taker accounts (31,821 pairs) | 31% |
| Consecutive trades in different blocks | 25 of 2,825 = 0.9% |

Inside one transaction (VALIDATED): maker fills are written from the best price for the taker to the worst. Over 1,024,722 taker transactions of 10 accounts on BTC 5-minute markets (23 September–22 October 2026), 107,700 had more than one price and none was truly out of order; This needs a tolerance of 1e-4 on the price difference: an exact comparison produces 11,537 false exceptions from rounding.

The choice of order changes results. In a study of which of three accounts is "first", replacing log order inside a block with a price-order hypothesis (lowest price paid first) changed the first account in 12,155 of 88,673 cells (13.7%), all of them same-block cases, and moved the measured "cost of being second" from +0.31 to +0.56 and +0.50 cents per share in the two halves of the sample. Most of that jump is built in by the rule (the second is by definition the one who pays more), neither ordering was judged closer to the truth, and the study ended INCONCLUSIVE.

## Why

One call settles one taker order, and the calls come from many sender addresses: among the 631 transactions there were 544 distinct senders and never two from the same sender in one block. Within a block, transactions were always ordered by decreasing priority fee (0 exceptions in 518 pairs), but only 32 pairs had different fees. Of the 127 reversals, 17 came from the fee; the other 110 had equal fees. For equal fees the block producer's client orders by the time it received the transaction, which is not visible on chain.

The exchange documentation describes matching by an operator who then submits the trade to the chain; no documentation page read on 23 October 2026 states price-time priority. Matching and inclusion in a block are separate steps: the delay between them was a median 2.4 s ([[trade-timestamps-are-settlement-time-two-seconds-late]]).

## What would change this

- The direct measurement uses only one account's maker trades on BTC Up/Down markets, 18–23 October 2026.
- The millisecond time is when the frame was emitted, not the internal match: it comes 170 ms to 4 s after `match_time` (median 0.76 s), and in 13 pairs it disagreed with it. The 19.4% figure does not depend on it.
- The book measurement covers three accounts with no outside control group. It also found 79% reversals for pairs from the same account, which the direct measurement did not reproduce (its pairs are all from one account and give 25%).

## How to check it yourself

1. Use (block, log index) to separate blocks and to count rows, not to rank two transactions of the same block.
2. To rank them, use a millisecond source: the MATCHED frame of your own trades, or the public trade print and level drop in the book channel ([[level-drop-arrives-before-the-trade-print]]).
3. Re-run any "who was first" result with the within-block order reversed or shuffled; if the conclusion changes, it was built on the ordering. See also [[same-second-trades-and-dedup-corrupt-backtests]].

---

Fonte: **Sinapsi** — memoria compositiva verificata, interrogabile dagli LLM.
Pagina: https://sinapsi.wiki/w/prediction-markets/p/traps/log-index-is-not-matching-order-within-a-block/
Interroga questo wiki dal vivo dal tuo assistente (MCP): https://sinapsi.wiki/mcp/w/prediction-markets/
Licenza CC BY 4.0 — riuso con attribuzione a Sinapsi (https://sinapsi.wiki).
Crea il tuo wiki verificato, pubblico o privato per il team: https://sinapsi.wiki/

