Imagine 100 consecutive trade pairs. If 98 pairs come from different wallets, the cross-wallet bucket can own most of the total autocorrelation even when each cross-wallet pair is only weakly aligned. A large bucket share is not the same claim as strong pairwise herding.
Bai and Kan expose that denominator problem in on-chain markets. Their correction is a ratio called kappa (κ): cross-account sign correlation divided by same-account sign correlation. The distinction reverses the casual reading of small Uniswap swaps and reveals a different mechanism—accounts racing to the same centralized-exchange price—where κ really is high.
Split persistence into frequency and behaviour
A trade sign is +1 for a buy and −1 for a sell. Persistent order flow means nearby signs tend to agree. For a chosen lag, let p be the fraction of pairs from the same account. Let ρsame and ρdiff be the average products of demeaned signs for same- and different-account pairs. Their ratio κ = ρdiff/ρsame measures behaviour pair by pair. The traditional herding share h measures contribution to the total after weighting by how often each pair type occurs.
| Paper sample | same-pair p | ρsame / ρdiff | κ | herding share h |
|---|---|---|---|---|
| Order book, main | 0.331 | 0.831 / 0.634 | 0.76 | 0.61 |
| Order book, earlier | 0.098 | 0.953 / 0.689 | 0.72 | 0.87 |
| Uniswap 2024, all | 0.025 | 0.810 / 0.037 | 0.05 | 0.65 |
| Uniswap 2024, ≥$100k | 0.104 | 0.761 / 0.257 | 0.34 | 0.75 |
| Uniswap 2023, all | 0.016 | 0.732 / 0.072 | 0.10 | 0.86 |
| Uniswap 2023, ≥$100k | 0.059 | 0.667 / 0.346 | 0.52 | 0.89 |
Rebuild the statistic
def herding_share(p_same, kappa):
cross_weight = (1 - p_same) * kappa
return cross_weight / (p_same + cross_weight)
def kappa_from_share(p_same, share):
return (share * p_same) / ((1 - p_same) * (1 - share))The site runs the tested TypeScript implementation; Python and C++ are line-for-line translations. The equation makes the confound visible. Whenp shrinks, the cross-account bucket receives almost all pair weight, so h rises even if κ does not change.
Feeding the reported 65% share and 2.5% same-wallet rate backward through the equation gives κ ≈ 0.048. That is close to the paper's 0.05 after allowing for rounded table inputs. On the order book, a similar 61% share accompanies κ = 0.76—a fundamentally different market even though h looks familiar.
High κ is a race, not proof of imitation
On the EVM order book, pairs no more than ten blocks apart contribute 90–96% of cross-account covariance. Same-block orders cannot imitate fills that neither account has observed yet. The authors instead test a common-signal explanation: a cross-fitted gradient-boosted model predicts each order sign using only recent Binance returns, signed volume, and volatility.
| Sample | Filter inputs | sign R² (%) | cross covariance removed (%) | Note |
|---|---|---|---|---|
| Order book, main | Binance | 69 | 84 | — |
| Order book, main | Binance delayed 0.5 s | 68 | 83 | leakage control |
| Order book, earlier | Binance | 54 | 73 | — |
| Uniswap 2024, ≥$100k | Binance | 60 | 109 | residual flips sign |
| Uniswap 2023, ≥$100k | Binance | 48 | 91 | — |
The main filter removes 84% of cross-account covariance. Delaying every input by half a second barely moves that result—83%—which weakens the concern that its latest 100 ms grid cell leaks post-block Binance data. Cross-fitting by clock-hour parity prevents the filter from absorbing its own in-sample noise into the residual statistic.
The common-signal component is economically toxic
A basis point is one hundredth of a percent. A negative markout means the liquidity provider sold before the reference price rose or bought before it fell. Orders aligned with the filter's predicted sign receive steadily worse markouts, connecting the statistical race to adverse selection rather than merely to classification accuracy.
| Liquidity provider | race share of $ | race markout | rest markout |
|---|---|---|---|
| Book, main makers | 54% | −1.87 bp | −0.94 bp |
| Book, earlier makers | 74% | −1.70 bp | −0.46 bp |
| Uniswap 2024 LPs | 66% | −2.38 bp | +2.43 bp |
| Uniswap 2023 LPs | 78% | −2.44 bp | +5.57 bp |
What to probe next
Reproduce the decomposition before training anything: report p, κ, and h together across venues, lags, and size thresholds. Then fit a shallow XGBoost-style model with strict time-blocked cross-fitting, and compare it with a transparentlogistic-regression filter. If the inferred common component survives delayed inputs and alternative leading venues, test whether it predicts markouts out of sample.
The general lesson travels beyond crypto. Whenever a headline contribution share combines a group's frequency with its conditional effect, publish both parts. Otherwise a population with more entities can look more coordinated even when its pairs are less correlated.
References
- Bai, Y. and Kan, D. (2026). Herding or Racing? Decomposing Cross-Account Order-Flow Persistence in On-Chain Markets. ICAIF 2026 Workshop / arXiv
- Tóth, B. et al. (2015). Anomalous price impact and the critical nature of liquidity in financial markets. Physical Review X 5
- Friedman, J. H. (2001). Greedy function approximation: A gradient boosting machine. The Annals of Statistics 29(5)