← Blog/blog/defi-herding-base-rate

The DeFi herding statistic that mostly counts different wallets

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.

01

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 samplesame-pair pρsame / ρdiffκherding share h
Order book, main0.3310.831 / 0.6340.760.61
Order book, earlier0.0980.953 / 0.6890.720.87
Uniswap 2024, all0.0250.810 / 0.0370.050.65
Uniswap 2024, ≥$100k0.1040.761 / 0.2570.340.75
Uniswap 2023, all0.0160.732 / 0.0720.100.86
Uniswap 2023, ≥$100k0.0590.667 / 0.3460.520.89
Paper-reported lag-one decomposition. Counts range from 3,816 to 142,659 orders; intervals are omitted here for compactness and reported in the paper.
02

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.

κ = 0.05κ = 0.75κ = 1 public signal
Core-computed herding share as the same-account pair probability p rises from 1% to 50%. Each line holds pairwise behaviour κ fixed; only the account-frequency base rate moves.
Core reconstruction from the paper's rounded p and κ values. Purple bars are the traditional share h; orange bars are the pairwise ratio κ. Small rounding gaps from Table 1 are expected.

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.

03

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.

SampleFilter inputssign R² (%)cross covariance removed (%)Note
Order book, mainBinance6984—
Order book, mainBinance delayed 0.5 s6883leakage control
Order book, earlierBinance5473—
Uniswap 2024, ≥$100kBinance60109residual flips sign
Uniswap 2023, ≥$100kBinance4891—
Paper-reported out-of-fold filter results. Values above 100% mean the residual cross-account covariance changes sign.

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.

04

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 providerrace share of $race markoutrest markout
Book, main makers54%−1.87 bp−0.94 bp
Book, earlier makers74%−1.70 bp−0.46 bp
Uniswap 2024 LPs66%−2.38 bp+2.43 bp
Uniswap 2023 LPs78%−2.44 bp+5.57 bp
Paper-reported 60-second markouts. Uniswap execution prices include the pool's 5 bp fee.
05

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

  1. Bai, Y. and Kan, D. (2026). Herding or Racing? Decomposing Cross-Account Order-Flow Persistence in On-Chain Markets. ICAIF 2026 Workshop / arXiv
  2. Tóth, B. et al. (2015). Anomalous price impact and the critical nature of liquidity in financial markets. Physical Review X 5
  3. Friedman, J. H. (2001). Greedy function approximation: A gradient boosting machine. The Annals of Statistics 29(5)