Batch auctions and uniform clearing prices
1. TL;DR
Section titled “1. TL;DR”A batch auction collects every order that arrives during a window, then settles all of them at once at a single clearing price per token pair, so the order in which transactions landed no longer matters. Orders on opposite sides of a pair are matched directly (a “coincidence of wants”), and only the leftover imbalance is sent to on-chain liquidity such as an AMM. On Ethereum this is what CoW Protocol does; on Solana there is no live uniform-price batch protocol, and the closest relatives are per-order Dutch auctions (Drift’s JIT auctions) and off-chain quote systems.
2. Explain it simply
Section titled “2. Explain it simply”Analogy
Section titled “Analogy”Think of a village market where, instead of haggling one by one all morning, every buyer and seller drops a slip into a box: “I will buy up to 4 kg of apples at no more than 3.01 each,” “I will sell 10 kg at no less than 2.99 each.” At noon the clerk empties the box, finds the one price at which the most apples change hands, and everyone who is in the money trades at that same price. Nobody gains from elbowing to the front of the queue, and if buyers and sellers cover each other the clerk never has to go to the wholesaler at all.
Normally a trade happens the instant it reaches the exchange, so whoever gets there first can jump in front of you and make your price worse. A batch auction waits a few seconds, gathers all the trades that arrived, and settles them together at one shared price. Because everyone in the batch gets the same price, being first is worthless, which removes the reason to jump the queue. If one person wants to sell exactly what another wants to buy, they are simply matched with each other and neither has to pay an outside market. Specialist helpers compete to find the settlement that gives traders the most, and the best proposal wins.
Step-by-step walkthrough
Section titled “Step-by-step walkthrough”Scenario: an ETH/USDC batch on CoW Protocol; the reference AMM pool holds 10,000 ETH and 30,000,000 USDC (spot 3,000, 0.3% fee).
- Orders arrive (state: nothing settled). Alice signs “sell 10 ETH for at least 2,985 USDC each”. Bob signs “buy 4 ETH for at most 3,010 each”. Carol signs “buy 2 ETH for at most 3,015 each”. Their tokens stay in their wallets; only signatures are shared.
- Batch closes. The protocol snapshots the three orders and publishes them to solvers.
- Solvers compute a settlement. Bob + Carol want 6 ETH and Alice sells 10: 6 ETH is matched peer-to-peer; the remaining 4 ETH go to the AMM, which returns 11,959.2 USDC (2,989.81 per ETH).
- Uniform price chosen. Because Alice must receive one price for all 10 ETH and the AMM leg fixes the marginal price, the solver sets for the ETH→USDC direction. Alice: 10 ETH → 29,898.1 USDC. Bob: 11,959.2 USDC → 4 ETH. Carol: 5,979.6 USDC → 2 ETH.
- Competition and settlement. Other solvers submit alternatives; the one delivering the most surplus over the users’ limit prices wins and posts one on-chain transaction. Final state: Alice −10 ETH / +29,898.1 USDC; Bob +4 ETH / −11,959.2 USDC; Carol +2 ETH / −5,979.6 USDC; AMM +4 ETH / −11,959.2 USDC.
Common misconceptions
Section titled “Common misconceptions”- Myth: Batch auctions eliminate MEV. Reality: They remove the value of reordering inside a batch; censoring or inserting orders is still physically possible for whoever builds the block or the batch (Yuhjtman, 2024).
- Myth: Everyone in the batch gets the same price. Reality: CoW’s current design uses uniform directed clearing prices: everyone trading ETH→USDC gets one price, but the USDC→ETH direction may clear at a slightly different one (CoW docs, 2026).
- Myth: A batch always waits a long time. Reality: The smallest meaningful batch is one block, since two transactions in the same block have no natural order (Köppelmann, 2019).
- Myth: Finding the clearing prices is easy. Reality: With many tokens the optimisation is believed NP-hard, so the protocol outsources it to a solver competition and only verifies solutions on-chain (Köppelmann, 2019; Zhang, 2020).
If you only remember one thing
Section titled “If you only remember one thing”Same block, same pair, same price — a batch auction turns “who was first” into an irrelevant question, and lets traders be each other’s liquidity before any pool is touched.
3. How it works
Section titled “3. How it works”Orders as functions of price
Section titled “Orders as functions of price”An order is a signed message: sell token , receive token , with a limit price and a maximum size. Given a candidate price vector (one number per token), the traded amount of every order is determined: a sell order executes only if , a buy order only if . Yuhjtman notes that a set of orders therefore admits only a limited set of valid clearing vectors, and that this “perfectly corresponds to the concept of Walrasian equilibrium in a pure exchange market” — a price vector at which supply equals demand for every good.
Constraints on a valid settlement
Section titled “Constraints on a valid settlement”Gnosis’ 2019 formulation of the multi-asset problem (Köppelmann, 2019) lists the constraints a solver’s solution must satisfy:
- Price consistency. One price per token; the price of any pair is the ratio , which makes the settlement arbitrage-free across pairs.
- Limit prices. Orders strictly better than the clearing price can (in the stricter variant, must) be executed; orders exactly at the clearing price may be partially filled.
- Value preservation. For each token , — nothing is created or destroyed.
- Fill fractions per executable order.
Consistent prices enable ring trades: A→B, B→C and C→A orders settle against each other although no two share a pair.
What the solver maximises
Section titled “What the solver maximises”Köppelmann’s post compares objectives. Maximising volume produces perverse ring trades: a user swapping 10 S1 for S2 is routed through S3 so two market makers each earn 1% and the user “pays 2%”. Maximising trader utility splits surplus 50/50 even when abundant liquidity exists at a better price. Gnosis settled on disregarded utility: utility minus what an unfilled in-the-money order would have generated. CoW Protocol today selects “the combination of winning bids that maximizes the surplus received by the orders that are part of the auction” and filters out “unfair” batched bids — those delivering less to an order than some available single-order bid (CoW docs, 2026). For a sell order with output and limit output , surplus is ; for a buy order paying against a maximum , .
Why it neutralises reordering
Section titled “Why it neutralises reordering”Yuhjtman summarises two structural properties: (a) execution does not depend on the ordering of orders, and (b) same-direction users receive the same price “with no room for intermediaries between them”. A sandwich needs a victim whose price depends on what executed before it; inside a batch that dependence is gone. Censorship and insertion remain, deterred (he argues) because censoring one order in pair A/B also loses “orders in other pairs due to operating away from the market equilibrium prices”.
Hardness and the solver competition
Section titled “Hardness and the solver competition”Even the proposer’s simpler problem — which uniform-price swaps to include to maximise fees — is NP-hard by reduction from maximum independent set (Zhang, 2020). Gnosis therefore designed an open competition: anyone may submit a solution within a fixed window, and the contract only needs to “make sure the solution is valid; check the value of the objective function”. CoW keeps this shape with a permissioned, bonded solver set; the winner is the solver “whose solution generates the greatest surplus for the batch” (CoW docs, 2026).
Affiliated AMMs and permissionless solving
Section titled “Affiliated AMMs and permissionless solving”Yuhjtman (2024) adds two extensions. Affiliated AMMs accept swaps only at the batch price, behaving as pre-programmed orders, so LPs stop leaking loss-versus-rebalancing (see /exchange/impermanent-loss-vs-lvr/). Permissionless solving lets anyone execute a batch as long as prices are consistent within a block, moving solver competition into block building.
4. Worked numeric example
Section titled “4. Worked numeric example”Same scenario as §2, computed end to end. Pool: ETH, USDC, fee , so . For an input the pool returns (see /exchange/cfmm-math/).
Each trader alone against the pool.
- Alice sells 10 ETH: USDC, i.e. 2,988.02 per ETH.
- Bob buys 4 ETH: he must pay with , so USDC (3,010.23 per ETH) — above his 3,010 limit, so his order would not fill.
- Carol buys 2 ETH: , USDC (3,009.6 per ETH).
In the batch. The solver matches 6 ETH peer-to-peer and sells only the net 4 ETH: USDC, a marginal price of 2,989.81. Solver surplus is increasing in the clearing price (Alice gains , buyers lose of headroom, net minus a constant), so the solver sets at the highest feasible value, , where the USDC collected from Bob and Carol plus the AMM leg exactly funds Alice: .
| Trader | Alone vs pool | In batch | Improvement |
|---|---|---|---|
| Alice (sell 10 ETH) | 29,880.2 USDC | 29,898.1 USDC | +17.9 USDC |
| Bob (buy 4 ETH) | fails (3,010.23 > limit) | pays 11,959.2 USDC | filled, 81.7 below alone-cost |
| Carol (buy 2 ETH) | pays 6,019.3 USDC | pays 5,979.6 USDC | +39.7 USDC |
Surplus over limits: Alice , Bob , Carol ; total 179.3 USDC, which is the number competing solvers try to beat. The pool saw 4 ETH of flow instead of 16 ETH gross, and no participant’s outcome depended on transaction order.
5. Where it’s used
Section titled “5. Where it’s used”Ethereum
Section titled “Ethereum”- CoW Protocol — fair combinatorial batch auctions with uniform directed clearing prices; bonded solvers compete on surplus; coincidence-of-wants matching before tapping AMMs. Roughly 1% of Ethereum DEX volume (as of 2024-07, Yuhjtman citing DefiLlama). docs.cow.fi
- Gnosis Protocol v1 / dex-contracts (2019–2020) — the on-chain multi-asset batch exchange whose matching research is summarised above; the direct ancestor of CoW. ethresear.ch/t/6248
- UniswapX — not a batch: each order runs its own Dutch auction (see /exchange/rfq-and-intents/); McAMM and am-AMM instead auction the first trade (see /exchange/v4-hooks-and-am-amm/).
Solana
Section titled “Solana”- n/a for uniform-price batch settlement — no Solana source describes a live CoW-style batch protocol. With no public mempool, 400 ms slots and most retail flow already routed by the Jupiter aggregator (over 40% of DEX swap volume goes through aggregators as of 2025-08, Helius), competition happens per order rather than per batch.
- Drift JIT auctions — every taker order runs a per-order Dutch auction lasting a configurable number of slots, with the auction price interpolating linearly from the taker’s best price to their limit; makers fill first-come-first-served. This is the closest Solana analogue: a short window of competition per order rather than a shared clearing price. docs.drift.trade
- JupiterZ (Jupiter RFQ) and Kamino Swap — off-chain quote competition among market makers, with settlement on-chain; no uniform price across users (Helius MEV report, as of 2025-01). See /exchange/rfq-and-intents/.
6. Risks, attacks, and incidents
Section titled “6. Risks, attacks, and incidents”- Solver-side exploit: CoW Swap, 7 February 2023. A newly allow-listed solver (Barter) set a token approval from the settlement contract to its own
SwapGuardcontract; an attacker used a flaw in it to pull roughly $166K of DAI, USDT, USDC and ETH held in the settlement contract. User wallets were never at risk and the loss was covered by the solver’s bond ($500K cUSDC plus 1.5M COW per solver, as of 2023-02). Root cause: trust placed in a solver’s external code. CoW post-mortem - Censorship and insertion by the batch executor. Uniform prices kill reordering, but a solver or builder can still drop orders in one direction to move the clearing price. Yuhjtman argues the loss of cross-pair fees and honest-solver competition make this unprofitable; Kilbourn’s reply counters that gas fees and censorship value “can be very separated” — a 1 ETH and a 1,000 ETH swap pay the same gas (ethresear.ch 20187, 2024-08).
- Solver centralisation. CoW “runs a centralized solving protocol” (Yuhjtman, 2024); Paradigm warns that trusted middlemen receiving most order flow become entrenched (see /exchange/rfq-and-intents/).
- Computational shortfall. Because the optimum is NP-hard, solutions are heuristic: valid but not necessarily optimal, and the objective function decides who bears the cost (Köppelmann, 2019).
- Delay and failed fills. Orders wait for the batch and may go unfilled if no valid clearing price exists (Köppelmann, 2019).
7. Open problems
Section titled “7. Open problems”- Fee model for a permissionless batch contract. Yuhjtman leaves open “how to cover gas and trade fees” and whether zero trade fees can work; Kilbourn’s objection suggests a fee that grows (sublinearly) with size is needed.
- Objective function. Gnosis’ disregarded-utility metric makes on-chain verification cost scale with all open orders, not just executed ones; “we are looking for other objective functions where ideally only the touched orders play a role” (Köppelmann, 2019).
- Uniform vs directed prices. CoW moved from one price per token to uniform directed prices with a fairness filter; whether that preserves full ring-trade consistency is not analysed in the docs.
- Will honest solving converge with block building? Yuhjtman conjectures honest solvers become an oligopoly indistinguishable from builders; the thread leaves this contested.
8. Ethereum vs Solana
Section titled “8. Ethereum vs Solana”| Aspect | Ethereum | Solana |
|---|---|---|
| Live uniform-price batch protocol | CoW Protocol (~1% of DEX volume, as of 2024-07) | None in sources |
| Natural batch unit | 12 s block; builder chooses contents via MEV-Boost | 400 ms slot; leader streams transactions, no public mempool |
| Order-competition primitive | Batch surplus competition among bonded solvers | Per-order Dutch auctions (Drift JIT), off-chain RFQ (JupiterZ) |
| MEV addressed | Reordering inside batch; censorship remains | Sandwiches via private routing/Jito; no shared clearing price |
| Where price forms | Solver’s off-chain optimisation, verified on-chain | Aggregator quotes per order; makers’ last look |
On Ethereum the block is slow and built by few builders, so batching costs little extra latency and directly attacks the builder’s reordering power. On Solana the leader processes a continuous stream, retail flow is concentrated in one aggregator, and market makers prefer to update or fill individual orders within a slot — hence per-order auctions and quote systems. See /mev/order-flow-auctions/ and /mev/solana-mev/.
9. Reference doc
Section titled “9. Reference doc”The reference
Section titled “The reference”Affiliated AMMs and permissionless solving for uniform price batch auctions — Sergio Yuhjtman (work done at Flashbots Research), 31 July 2024. ethresear.ch/t/20187
Summary of the reference
Section titled “Summary of the reference”The post opens by tracing the idea of fighting MEV with batch auctions to a 2014 Reddit thread and asks two questions: how much MEV can batch auctions remove, and can we build better batch protocols than those existing today (CoW, UniswapX)? It answers “optimistic” to the first and proposes concrete mechanisms for the second.
A cooperative endeavour between traders. The ideal is trading at market prices with no fee beyond gas. A contract that settles orders in batches at uniform clearing prices has two properties: (a) execution is independent of order sequencing, and (b) same-direction traders get the same price with no intermediary between them. Reordering is thus meaningless, but censorship and insertion remain physically possible; the author explicitly abandons the search for a protocol that logically prevents them and instead aims for one where, under adoption, privileged players are incentivised not to censor. CoW is noted as the only live implementation, at around 1% of Ethereum DEX volume, and as running a centralised solving process.
Uniform clearing prices and Walrasian equilibrium. Each order is a function from prices to traded amounts; the set of valid clearing vectors is the set of Walrasian equilibria, which exist under mild assumptions and are found as fixed points of a mapping (citing the author’s Walraswap paper).
Affiliated AMMs. Special AMMs participate in the batch as pre-programmed orders, accepting only the batch price. The batch contract calls their swap functions with the clearing prices. Multiple affiliated AMMs can coexist without fragmenting liquidity, and, given adoption and low censorship, the clearing prices become true market prices, mitigating LVR for LPs.
Permissionless solving. Anyone may execute a batch provided prices are consistent within the block; which batch lands is decided at block-building level, analogous to permissionless access to AMMs. The author argues manipulation is unprofitable in a “flourished” scenario because (1) many tokens are interconnected in one price cluster, (2) short-term volatility is small (ETH moves under 0.1% in 12 s on a normal day) so slippage tolerances bound the manipulator’s bounty, and (3) honest solvers exist and maximise inclusion, so a censoring solver forfeits fees on the censored orders and on cross-pair orders knocked out of equilibrium.
MEV zoom-out. Total extracted MEV has been stable above 250 kETH per year (as of 2024-07); the root cause is the proposer monopoly, and the remedy is trader coordination — “a trade union”.
Final remarks leave the fee model undefined and note that non-affiliated AMMs can be treated as virtual batch agents from which solvers extract surplus, which should attract liquidity into affiliated AMMs. The replies clarify that does not restrict solvers to affiliated AMMs, and Kilbourn’s challenge on censorship value versus gas fees leads the author to concede a size-increasing trade fee may be needed and to predict that honest solving converges with block building.
Key quotes
Section titled “Key quotes”“The execution does not depend on the ordering of the trade orders.” (§ A cooperative endeavour, property (a))
“Uniform clearing prices ensure that a user trading in one direction receives the same price as the other users trading in that same direction, and is a direct counterpart to the users trading in the other directions” (§ A cooperative endeavour, property (b))
“Special AMMs may participate in a uniform price batch auction just like any other trader. These would be the affiliated AMMs.” (§ Affiliated AMMs)
“The proposal is to let W allow anyone to execute a batch, as long as there are no price inconsistencies within each block.” (§ Permissionless solving)
“Consider that a swap of 1 ETH and another of 1K ETH both consume the same amount of gas” (Reply #6, quintuskilbourn)
How to read the original
Section titled “How to read the original”Background needed: what a uniform-price auction is, the MEV vocabulary (reordering, censorship, insertion), and a passing familiarity with LVR. Skip the Walrasian-equilibrium paragraph and the reference list on a first pass. The hardest paragraph is the three-point argument under “Permissionless solving”: it is not a proof but a stability argument — the claim is that once a large token cluster clears together, any price deviation in one pair breaks the equilibrium in others, so a censor loses more than it gains; read it together with Kilbourn’s reply, which shows the argument depends on fees scaling with trade size.
What changed since
Section titled “What changed since”- CoW Protocol’s documentation (as of 2026-08) describes a fair combinatorial auction with uniform directed clearing prices and an unfairness filter, a departure from the single-price-per-token model the post assumes.
- Paradigm’s “Priority is all you need” (June 2024) proposes MEV taxes as an alternative way for AMMs and routers to reclaim ordering value on chains with competitive priority ordering.
- The proposer-censorship worry has resurfaced in the 2026 proprietary-AMM debate, where Neuder & Bahrani argue builder-level censorship of price updates is the myopically rational strategy on Ethereum (ethresear.ch 25543, 2026-07).
Secondary references
Section titled “Secondary references”- CoW Protocol docs, “Fair Combinatorial Batch Auction” — read if you want the production rules for bids, fairness filtering and UDP.
- Köppelmann, “Matching strategy for multi-asset batch auctions” (2019) — read if you want to see why volume maximisation is the wrong objective, with worked examples.
- josojo, “Batch auctions with uniform clearing price on plasma” (2018) — read if you care about encrypted orders and exit games.
- Zhang, “Optimum Transaction Collection for Uniform-price atomic swap auction is NP-Hard” (2020) — read if you want the hardness reduction.
10. Sources
Section titled “10. Sources”- Affiliated AMMs and permissionless solving for uniform price batch auctions — Sergio Yuhjtman — 2024-07-31 — https://ethresear.ch/t/affiliated-amms-and-permissionless-solving-for-uniform-price-batch-auctions/20187
- Fair Combinatorial Batch Auction — CoW Protocol docs — fetched 2026-08-29 — https://docs.cow.fi/cow-protocol/concepts/introduction/batch-auctions
- Solvers — CoW Protocol docs — fetched 2026-08-29 — https://docs.cow.fi/cow-protocol/concepts/introduction/solvers
- Welcome — CoW Protocol docs — fetched 2026-08-29 — https://docs.cow.fi/
- Matching strategy for multi-asset batch auctions — Martin Köppelmann — 2019-10-04 — https://ethresear.ch/t/matching-strategy-for-multi-asset-batch-auctions/6248
- Batch auctions with uniform clearing price on plasma — josojo (Gnosis) — 2018-07-14 — https://ethresear.ch/t/batch-auctions-with-uniform-clearing-price-on-plasma/2554
- Optimum Transaction Collection for Uniform-price atomic swap auction is NP-Hard — krzhang — 2020-03-27 — https://ethresear.ch/t/optimum-transaction-collection-for-uniform-price-atomic-swap-auction-is-np-hard/7208
- CoW Swap Solver Exploit — Post mortem 07/02/2023 — CoW Protocol — 2023-02 — https://medium.com/@cow-protocol/cow-swap-settlement-contract-post-mortem-07-02-2023-2faa9f918e29
- JIT Auctions — Drift Protocol docs (docs.drift.trade, branded Velocity Protocol at fetch) — 2026-08-27 — https://docs.drift.trade/developers/market-makers/jit-auctions
- Solana MEV Report: Trends, Insights, and Challenges — Helius — 2025-01 — https://www.helius.dev/blog/solana-mev-report
- Solana’s Proprietary AMM Revolution — Helius — 2025-08 — https://www.helius.dev/blog/solanas-proprietary-amm-revolution
- Intent-Based Architectures and Their Risks — Georgios Konstantopoulos, Quintus Kilbourn (Paradigm) — 2023-06-01 — https://www.paradigm.xyz/writing/intents
- Priority Is All You Need — Dan Robinson, Dave White (Paradigm) — 2024-06-04 — https://www.paradigm.xyz/writing/priority-is-all-you-need
- Proprietary AMMs and Ethereum — Mike Neuder, Maryam Bahrani — 2026-07-26 — https://ethresear.ch/t/proprietary-amms-and-ethereum/25543