Frank Benford f - x
fig. 1 — the nine counters against the law. the outlines are drawn from the formula. the fills are reads from the pool.

( method )

01

WHAT IS COUNTED

the hook takes the leading digit of the eth amount of every swap through the pool and adds one to that digit's counter. nine counters, one instruction, no weighting by size. a swap of one eth and a swap of nineteen eth both add one to the counter for 1.

02

THE FLOOR

swaps under a thousandth of an eth are not counted at all. every dust amount begins with the same handful of digits, so without a floor anyone could push the counters toward the law for almost nothing and buy themselves a cheaper rate. the floor is the whole defence against that and it cannot be changed.

03

WHY THE FIRST DIGIT

in real quantities the leading digit is not uniform. it is 1 about thirty percent of the time and 9 under five. quantities that span orders of magnitude are spread evenly in log, not in count, so the span from 1 to 2 is wider than the span from 9 to 10 and more numbers land in it.

04

WHAT THE LAW IS

the share of numbers beginning with digit d is log10(1 + 1/d). that is the whole formula. it has no parameters, nothing was fitted to anything, and it is the same on every pool on every chain.

05

THE WINDOW

the counters hold the last 8192 counted swaps and no more. when the window is full the oldest digit is removed as the newest arrives. a clean early history does not buy cover for what the pool is doing now, and a bad patch does not follow it forever.

06

THE DISTANCE

the squared gap between each counter's share and the law's share, divided by the law's share, summed over nine digits. zero is a perfect match. it is computed on shares rather than raw counts so it does not grow with volume alone.

07

THE CORRECTION

honest flow still scores above zero, because a sample is a sample. the expected amount of that noise is 8 / n, and exactly that much is subtracted. what is left is zero for real flow at any window size.

08

THE CHARGE

the adjusted distance is measured against 0.4017, which is where a perfectly flat digit spread sits and where invented numbers tend to drift. the surcharge runs from zero to three hundred basis points across that range, is taken in token, and is burned. it is zero until the window holds 1024 swaps.

09

WHAT IS FIXED

the law, the window, the arming count, the ceiling, the floor and the burn were set at deploy. no address can change any of them. there is no owner, no treasury, no keeper, no mint, no pause and no upgrade path.

source — newcomb 1881, benford 1938, pinkham 1961, hill 1995
how far each digit sits from where the law puts it. above the line is too many, below is too few.
window8192 counted swaps, rolling
arming count1024 — no surcharge below this
floor0.001 ETH — anything smaller is not counted
ceiling300 bps
reference0.4017 — a perfectly flat digit spread
in the window nowno reads yet
the window is a queue, not an average. the 8193rd swap removes the 1st. nothing about the pool's past is preserved beyond it, in either direction.
the counter does not care how large a swap is, only what it begins with. this is deliberate: weighting by size would let one large trade set the reading, and the law is a statement about how many numbers begin with a digit — not how much they are worth.
1.4 ETHcounts one toward digit 1
19.8 ETHcounts one toward digit 1
0.0143 ETHcounts one toward digit 1
0.0004 ETHbelow the floor — not counted
9.9 ETHcounts one toward digit 9
copied