How to quantify liquidity-taking versus liquidity-providing behavior using mempool traces?

Quantifying on-chain trading behavior from raw mempool activity requires combining protocol semantics, timing analysis, and reconstructed state to separate liquidity takers from liquidity providers and to measure their relative impact.

Identifying transaction roles

At a protocol level, liquidity providers and liquidity takers emit different transaction patterns. On automated market makers like Uniswap the swap function is a canonical taker action while addLiquidity and removeLiquidity are provider actions. Hayden Adams, Uniswap Labs, documents these function distinctions and the emitted events that allow unambiguous classification. Observing the mempool, one can classify transactions by function selector and by the event logs produced after inclusion. Network propagation and timing reveal behavioral intent: Christian Decker and Roger Wattenhofer, ETH Zurich, analyzed transaction propagation to show how timing differences and reordering opportunities arise in public mempools. Transactions with aggressive gas pricing, short inclusion latency, or chained multi-contract interactions often indicate taker urgency and MEV targeting. Vitalik Buterin, Ethereum Foundation, frames how public mempool visibility creates extractable value that intermediaries and searchers pursue; that context matters for interpreting why many taker-style transactions appear.

Measuring volumes and impact

Reconstruct pool state by replaying prior blocks and apply the transaction sequence to compute reserve delta and token flow. Sum positive reserve deltas matching addLiquidity flows to quantify provider volume and sum reserve changes caused by swap calls to quantify taker consumption. Compute a taker share metric as taker-volume divided by total on-chain traded volume over a chosen window. Complement volume metrics with price impact and realized slippage per transaction by comparing pre- and post-trade prices on the same reconstructed state. Measure inclusion latency from first-seen mempool timestamp to block inclusion as a proxy for information advantage and urgency. Correlate high latency differential and gas premium with evidence of frontrunning or sandwich attacks.

These measurements illuminate causes and consequences: concentrated MEV extraction concentrates yields toward sophisticated searchers and validators, altering incentives for retail liquidity provisioning and potentially increasing on-chain transaction churn. Cultural effects emerge when regional trading firms or validators with superior connectivity systematically capture value, and environmental costs may rise if extra transactions and reorgs increase validator work. Combining precise on-chain classification with timing analysis yields reproducible, auditable metrics for policy, research, and risk management.