01what 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.
02the 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.
03why 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.
04what the law is
the share of numbers beginning with digit d is log10 of one plus one over 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.
05the 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.
06the 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.
07the correction
honest flow still scores above zero, because a sample is a sample. the expected amount of that noise is eight divided by the number of swaps in the window, and exactly that much is subtracted. what is left is zero for real flow at any window size.
08the 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.
09what 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.