Papers
Topics
Authors
Recent
Search
2000 character limit reached

Atomic Arbitrage in DeFi

Updated 9 July 2026
  • Atomic Arbitrage (AA) is a trading method where multi-leg swaps are bundled into a single transaction, ensuring either full execution with profit or complete reversion.
  • AA frameworks leverage cyclic arbitrage across automated market makers by employing closed-form solutions for optimal trade sizing and equilibrium enforcement.
  • Attribution methods in AA analyze causal origins using techniques like simulation and Shapley value allocation to assess market inefficiencies and protocol impacts.

Searching arXiv for the cited Atomic Arbitrage literature and related papers. arxiv_search(query="Atomic Arbitrage AMM closed-form solutions generic N-token arbitrage (Willetts et al., 2024)", max_results=5) arxiv_search(query="Closed-form solutions for generic N-token AMM arbitrage", max_results=10) {"query":"Closed-form solutions for generic N-token AMM arbitrage", "max_results": 10} Atomic Arbitrage (AA) most commonly denotes a multi-leg arbitrage whose entire execution is bundled into a single blockchain transaction, so that either every leg settles and the profit condition holds, or the transaction reverts. In decentralized-exchange and automated-market-maker research, this notion covers cyclic arbitrage across pools, price-convergence trades between AMMs and external venues, and basket trades in multi-asset CFMMs (Wang et al., 2021, Gogol et al., 2024, Willetts et al., 2024). A distinct usage in mathematical finance studies “atomic arbitrage” created by insider information taking values on finitely many atoms; that usage is conceptually separate from blockchain execution semantics, even though the terminology overlaps (Chau et al., 2016).

1. Definition and terminological scope

In recent blockchain studies, AA is usually formalized as a transaction-level property. An on-chain transaction TT is classified as atomic arbitrage if and only if three conditions hold: it executes at least two swaps, the net balance change is non-negative for every asset in the route, and the transaction’s net profit after protocol fees τ\tau and priority bids β\beta is strictly positive. In compact form,

AA(N2)[A,  Δ(A)0][AΔ(A)P(A)τβ>0].\mathrm{AA}\Longleftrightarrow (N\ge 2)\wedge \bigl[\forall A,\;\Delta(A)\ge 0\bigr]\wedge \Bigl[\sum_A \Delta(A)P(A)-\tau-\beta>0\Bigr].

This criterion is used in large-scale Polygon analyses to detect AA in block data (Vostrikov et al., 29 Aug 2025, Seoev et al., 30 Apr 2026).

Within DEX theory, AA is often a cyclic arbitrage: a multi-step trade that starts and ends in the same token and exploits price discrepancies around a cycle of liquidity pools. For tokens A1,,AnA_1,\dots,A_n, the cycle

A1δ1A2,A2δ2A3,  ,  AnδnA1A_1 \xrightarrow{\delta_1} A_2,\quad A_2 \xrightarrow{\delta_2} A_3,\;\dots,\; A_n \xrightarrow{\delta_n} A_1'

is profitable when the final amount exceeds the initial amount (Wang et al., 2021). In A2MM, the term is specialized further to a two-step cycle across two AMMs: swap Δx\Delta_x of asset XX for Δy\Delta_y of YY on one AMM, then immediately swap τ\tau0 back to τ\tau1 on another, with τ\tau2 (Zhou et al., 2021).

The older mathematical-finance usage differs materially. There, the “atomic” object is not a transaction but an atom of information τ\tau3 known to an insider at time zero. In a complete market, the insider can super-hedge τ\tau4 for an initial capital strictly less than τ\tau5, yielding strong arbitrage on that atom while NUPBR can still hold (Chau et al., 2016). This suggests that the phrase “atomic arbitrage” is polysemous: in DeFi it denotes all-or-nothing execution, whereas in enlargement-of-filtration theory it denotes arbitrage tied to atomic information.

2. Atomicity as an execution primitive

The core operational property of AA on-chain is all-or-nothing execution. In cyclic DEX arbitrage, packaging all swaps into one transaction eliminates partial-fill risk: if the final condition τ\tau6 is not met, the EVM reverts the entire transaction, so no intermediate leg settles except for gas expenditure (Wang et al., 2021). This rollback property is the main reason AA is modeled as safer than sequential multi-leg execution.

A canonical implementation is a custom smart contract that computes the route, checks profitability, and then executes the swap sequence. One documented pattern is: τ\tau45 This design captures the minimal AA logic for cyclic arbitrage on Uniswap-style pools (Wang et al., 2021).

In multi-asset G3M pools, AA is generalized from a path of pairwise swaps to a single basket trade. The trade is represented by a net vector τ\tau7, and all token legs are packaged into one CFMM swap call. Because the closed-form solution enforces the pool invariant with equality, the transaction crosses the CFMM boundary once and leaves pool and market prices in perfect equilibrium, with no residual arbitrage kink (Willetts et al., 2024). The documented router flow is: transfer inbound tokens τ\tau8, call swapExactTokensForTokens with a custom multi-asset path encoding τ\tau9, and receive outbound tokens β\beta0 in the same transaction (Willetts et al., 2024).

Atomicity becomes more subtle when one leg is off-chain. For AMM–CEX arbitrage, the theoretical model treats the trade as if both legs are wrapped into one atomic arbitrage call, but the same work explicitly notes that off-chain CEX execution cannot literally be in the same EVM transaction; in practice, traders pre-fund CEX accounts or use pegged derivatives (Gogol et al., 2024). A common misconception is therefore that “atomic” always means cross-venue simultaneity in a literal execution sense. In cross-domain settings, atomicity is often an economic abstraction rather than a strict settlement fact.

3. Mathematical models and optimal trade sizing

The simplest AA model in AMMs is the cyclic constant-product framework. For each pool β\beta1 swapping β\beta2, reserves are β\beta3, the fee factor is β\beta4, and the swap function is

β\beta5

If the cycle output is β\beta6, profit is

β\beta7

A small-input cyclic arbitrage exists if and only if

β\beta8

equivalently β\beta9. The optimal input AA(N2)[A,  Δ(A)0][AΔ(A)P(A)τβ>0].\mathrm{AA}\Longleftrightarrow (N\ge 2)\wedge \bigl[\forall A,\;\Delta(A)\ge 0\bigr]\wedge \Bigl[\sum_A \Delta(A)P(A)-\tau-\beta>0\Bigr].0 is unique and can be written in terms of equivalent reserves AA(N2)[A,  Δ(A)0][AΔ(A)P(A)τβ>0].\mathrm{AA}\Longleftrightarrow (N\ge 2)\wedge \bigl[\forall A,\;\Delta(A)\ge 0\bigr]\wedge \Bigl[\sum_A \Delta(A)P(A)-\tau-\beta>0\Bigr].1 as

AA(N2)[A,  Δ(A)0][AΔ(A)P(A)τβ>0].\mathrm{AA}\Longleftrightarrow (N\ge 2)\wedge \bigl[\forall A,\;\Delta(A)\ge 0\bigr]\wedge \Bigl[\sum_A \Delta(A)P(A)-\tau-\beta>0\Bigr].2

This framework formalizes classical triangular and higher-order DEX cycles (Wang et al., 2021).

A more general formulation appears for AA(N2)[A,  Δ(A)0][AΔ(A)P(A)τβ>0].\mathrm{AA}\Longleftrightarrow (N\ge 2)\wedge \bigl[\forall A,\;\Delta(A)\ge 0\bigr]\wedge \Bigl[\sum_A \Delta(A)P(A)-\tau-\beta>0\Bigr].3-token geometric-mean market makers. Let reserves be AA(N2)[A,  Δ(A)0][AΔ(A)P(A)τβ>0].\mathrm{AA}\Longleftrightarrow (N\ge 2)\wedge \bigl[\forall A,\;\Delta(A)\ge 0\bigr]\wedge \Bigl[\sum_A \Delta(A)P(A)-\tau-\beta>0\Bigr].4, weights AA(N2)[A,  Δ(A)0][AΔ(A)P(A)τβ>0].\mathrm{AA}\Longleftrightarrow (N\ge 2)\wedge \bigl[\forall A,\;\Delta(A)\ge 0\bigr]\wedge \Bigl[\sum_A \Delta(A)P(A)-\tau-\beta>0\Bigr].5 with AA(N2)[A,  Δ(A)0][AΔ(A)P(A)τβ>0].\mathrm{AA}\Longleftrightarrow (N\ge 2)\wedge \bigl[\forall A,\;\Delta(A)\ge 0\bigr]\wedge \Bigl[\sum_A \Delta(A)P(A)-\tau-\beta>0\Bigr].6 and AA(N2)[A,  Δ(A)0][AΔ(A)P(A)τβ>0].\mathrm{AA}\Longleftrightarrow (N\ge 2)\wedge \bigl[\forall A,\;\Delta(A)\ge 0\bigr]\wedge \Bigl[\sum_A \Delta(A)P(A)-\tau-\beta>0\Bigr].7, invariant

AA(N2)[A,  Δ(A)0][AΔ(A)P(A)τβ>0].\mathrm{AA}\Longleftrightarrow (N\ge 2)\wedge \bigl[\forall A,\;\Delta(A)\ge 0\bigr]\wedge \Bigl[\sum_A \Delta(A)P(A)-\tau-\beta>0\Bigr].8

and fee credit fraction AA(N2)[A,  Δ(A)0][AΔ(A)P(A)τβ>0].\mathrm{AA}\Longleftrightarrow (N\ge 2)\wedge \bigl[\forall A,\;\Delta(A)\ge 0\bigr]\wedge \Bigl[\sum_A \Delta(A)P(A)-\tau-\beta>0\Bigr].9. A trade A1,,AnA_1,\dots,A_n0 is accepted iff

A1,,AnA_1,\dots,A_n1

Writing the net trade as A1,,AnA_1,\dots,A_n2 and A1,,AnA_1,\dots,A_n3 if A1,,AnA_1,\dots,A_n4 else A1,,AnA_1,\dots,A_n5, the equality frontier is

A1,,AnA_1,\dots,A_n6

For an active set A1,,AnA_1,\dots,A_n7, normalized weights A1,,AnA_1,\dots,A_n8, and

A1,,AnA_1,\dots,A_n9

Appendix A yields the closed-form optimal trade

A1δ1A2,A2δ2A3,  ,  AnδnA1A_1 \xrightarrow{\delta_1} A_2,\quad A_2 \xrightarrow{\delta_2} A_3,\;\dots,\; A_n \xrightarrow{\delta_n} A_1'0

This converts AA from a numerical optimization problem into signature enumeration plus direct evaluation (Willetts et al., 2024).

For AMM–CEX arbitrage, a CPMM with reserves A1δ1A2,A2δ2A3,  ,  AnδnA1A_1 \xrightarrow{\delta_1} A_2,\quad A_2 \xrightarrow{\delta_2} A_3,\;\dots,\; A_n \xrightarrow{\delta_n} A_1'1 and invariant A1δ1A2,A2δ2A3,  ,  AnδnA1A_1 \xrightarrow{\delta_1} A_2,\quad A_2 \xrightarrow{\delta_2} A_3,\;\dots,\; A_n \xrightarrow{\delta_n} A_1'2 yields instantaneous AMM price A1δ1A2,A2δ2A3,  ,  AnδnA1A_1 \xrightarrow{\delta_1} A_2,\quad A_2 \xrightarrow{\delta_2} A_3,\;\dots,\; A_n \xrightarrow{\delta_n} A_1'3. If the CEX has price A1δ1A2,A2δ2A3,  ,  AnδnA1A_1 \xrightarrow{\delta_1} A_2,\quad A_2 \xrightarrow{\delta_2} A_3,\;\dots,\; A_n \xrightarrow{\delta_n} A_1'4, the optimal amount of token A1δ1A2,A2δ2A3,  ,  AnδnA1A_1 \xrightarrow{\delta_1} A_2,\quad A_2 \xrightarrow{\delta_2} A_3,\;\dots,\; A_n \xrightarrow{\delta_n} A_1'5 sold into the AMM is

A1δ1A2,A2δ2A3,  ,  AnδnA1A_1 \xrightarrow{\delta_1} A_2,\quad A_2 \xrightarrow{\delta_2} A_3,\;\dots,\; A_n \xrightarrow{\delta_n} A_1'6

and the corresponding Maximal Arbitrage Value is

A1δ1A2,A2δ2A3,  ,  AnδnA1A_1 \xrightarrow{\delta_1} A_2,\quad A_2 \xrightarrow{\delta_2} A_3,\;\dots,\; A_n \xrightarrow{\delta_n} A_1'7

For concentrated liquidity, the analogous quantity is computed per tick and summed: A1δ1A2,A2δ2A3,  ,  AnδnA1A_1 \xrightarrow{\delta_1} A_2,\quad A_2 \xrightarrow{\delta_2} A_3,\;\dots,\; A_n \xrightarrow{\delta_n} A_1'8 This formulation explicitly links trade size, liquidity depth, and price divergence (Gogol et al., 2024).

A2MM analyzes the two-pool case with constant-product AMMs and 0.3% fee. If pools A1δ1A2,A2δ2A3,  ,  AnδnA1A_1 \xrightarrow{\delta_1} A_2,\quad A_2 \xrightarrow{\delta_2} A_3,\;\dots,\; A_n \xrightarrow{\delta_n} A_1'9 and Δx\Delta_x0 have reserves Δx\Delta_x1 and Δx\Delta_x2, the arbitrageur chooses Δx\Delta_x3 to maximize

Δx\Delta_x4

Equation 16 gives a closed-form approximate optimizer,

Δx\Delta_x5

with a necessary profitability condition Δx\Delta_x6 (Zhou et al., 2021).

4. Detection, attribution, and measurement at scale

Large-scale empirical work operationalizes AA by scanning blocks, parsing swaps, aggregating per-asset net flows, and computing net profit after fees and prioritization bids. A documented detection loop over 23 million Polygon blocks uses a full Polygon archive node, PolygonScan API, and web3py: for each transaction, parse swaps, discard Δx\Delta_x7, compute Δx\Delta_x8, reject any transaction with Δx\Delta_x9, then classify as AA when XX0 (Vostrikov et al., 29 Aug 2025).

Once AA events are identified, a separate question is causal attribution: which earlier transaction created the arbitrage opportunity. One framework defines the candidate set

XX1

and compares four attribution methods for atomic arbitrage on EVM-compatible networks (Seoev et al., 30 Apr 2026).

Method Mean cost Coverage / accuracy
Coefficient 0.8 ms 88.4% / 77.2%
Bot-data 8 ms 38.4% / 94.2%
Simulation 12.3 ms 99.1% / 91.7%
Shapley MC 2.1 s 98.1% / 100%
Shapley exact ~5 min 98.1% / 100%

The simulation-based method replays the block with and without candidate transactions, searching backwards up to XX2 blocks for an edge transaction where profit drops below XX3 of original XX4, then computes

XX5

and selects the source maximizing XX6 (Seoev et al., 30 Apr 2026). The coefficient-based method instead tracks a price-multiplier coefficient XX7 along the arbitrage cycle and attributes to the transaction maximizing XX8; it is lightweight but omits slippage and depth (Seoev et al., 30 Apr 2026). Shapley-based attribution models candidate transactions as players in a cooperative game with value function XX9 and assigns marginal contributions

Δy\Delta_y0

This is theoretically ideal for multi-source attribution but computationally costly (Seoev et al., 30 Apr 2026).

A plausible implication is that AA research has bifurcated into two layers: optimization of the arbitrage transaction itself, and retrospective attribution of the opportunity’s causal origin. The first asks how to execute the trade; the second asks who created the state from which the trade became profitable.

5. Empirical regularities across chains and market designs

A systematic study of Uniswap V2 from May 2020 to April 2021 recorded 292,606 executed cyclic arbitrages over eleven months, with total gross revenue of approximately Δy\Delta_y1 ETH, gas costs of approximately Δy\Delta_y2 ETH, and average net profit of approximately Δy\Delta_y3 ETH per cycle. The same study reports more than Δy\Delta_y4 million USD in revenue and observes persistently unexploited opportunities above Δy\Delta_y5 ETH per block, indicating that DEX markets may not be efficient enough (Wang et al., 2021).

Polygon measurements emphasize the distinction between Spam-based and Auction-based backrunning. Over Jan 2023 to Oct 2024, a 23 million-block study estimates total AA MEV at approximately Δy\Delta_y6 million USD. Spam-based AA accounts for approximately Δy\Delta_y7 of AA MEV volume and approximately Δy\Delta_y8 of AA transaction counts, whereas Auction-based AA via FastLane accounts for approximately Δy\Delta_y9 of AA MEV volume and approximately YY0 of AA transaction counts. Average profit per transaction is approximately YY1 MATIC for Spam-based AA and approximately YY2 MATIC for Auction-based AA; the study also reports that FastLane’s private relay and bid auction reduce network congestion by approximately YY3 fewer failed/duplicated transactions, and that observed efficiency satisfies YY4 over the study period (Vostrikov et al., 29 Aug 2025).

The same Polygon work reports token concentration: WMATIC appears in approximately YY5 of AA, followed by WETH at YY6 and WBTC at YY7, reflecting deep liquidity (Vostrikov et al., 29 Aug 2025). A separate March 2026 attribution study on Polygon analyzes 360,026 atomic arbitrage events with total extracted value of \$334,799 and finds highly concentrated opportunity creation: the top YY8 of opportunity-creating transactions account for YY9 of extracted value, the top τ\tau00 of protocols generate τ\tau01 of total MEV creation, and τ\tau02 of arbitrage events attribute more than τ\tau03 of positive Shapley value to a single transaction (Seoev et al., 30 Apr 2026). Among 220,262 identified opportunity creators in February 2026, participation rates are τ\tau04 for Uniswap V3, τ\tau05 for Algebra, τ\tau06 for Uniswap V4, τ\tau07 for Uniswap V2, and τ\tau08 for DODO, with protocol overlap because a single swap may touch multiple pools (Seoev et al., 30 Apr 2026).

On zkSync Era, arbitrage between SyncSwap and Binance from July to September 2023 yields cumulative MAV of \$\tau$0943.73M traded volume. Daily MAV peaks near \$8k on high-misalignment days, while price misalignments typically decay within a few minutes, with block time τ\tau10 s and median decay approximately τ\tau11–τ\tau12 s (Gogol et al., 2024). This suggests that AA opportunities on rollups can be persistent enough to measure but short-lived enough to require low-latency execution.

For multi-asset G3M pools, simulation and backtest results indicate that closed-form AA can outperform convex solvers. Synthetic trials over 120,000 random perturbations of an τ\tau13-token pool starting at equilibrium show strictly greater or equal profit in at least τ\tau14 of cases versus CVXPY, with τ\tau15 ms versus τ\tau16 ms on CPU for τ\tau17. A historical backtest from June 2021 to July 2022 on a 3-token ETH/BTC/DAI pool with τ\tau18, τ\tau19, and initial TVL τ\tau20 M USD finds that, in dueling mode where convex arb gets priority, the closed-form method still captures τ\tau21 more cumulative profit (Willetts et al., 2024).

6. Infrastructure, security, and open limits

AA is not only a trading strategy but also a source of network externalities. A2MM argues that when arbitrage and routing are internalized inside a smart contract, competitive MEV exploitation is reduced. In a 185-day replay on Uniswap and Sushiswap data, A2MM reports total on-chain arbitrage revenue of τ\tau22 K ETH, average revenue per AA call of approximately τ\tau23 ETH, block-space savings of τ\tau24 fewer total gas consumed versus separate AMM plus arbitrage transactions, and approximately τ\tau25 fewer mempool spam messages per AA. Under realistic block sizes and latencies, effective miner bandwidth improves by up to approximately τ\tau26 Mbit/s, translating into approximately τ\tau27 lower stale-block rate on Ethereum; in expectation, A2MM revenue allows swap fees to be reduced by τ\tau28 (Zhou et al., 2021).

On-chain integration details matter for whether AA is practically realizable. In the τ\tau29-token G3M setting, closed-form evaluation loops over at most approximately τ\tau30 trade signatures with τ\tau31 arithmetic per signature; for τ\tau32, even single-thread CPU evaluation is reported as less than τ\tau33 ms, and signature checks are embarrassingly parallel, allowing one thread per signature on GPU. The same work states that a CUDA kernel can complete the full pass in less than or equal to τ\tau34 ms for τ\tau35, and that end-to-end arb latencies from price feed to on-chain transaction can be driven below τ\tau36 ms (Willetts et al., 2024). It also notes that multi-asset swap gas scales roughly linearly in τ\tau37, with typical marginal cost approximately τ\tau38 gas per extra token leg, and recommends private relays or Flashbots to mitigate front-running and sandwich risk (Willetts et al., 2024).

Atomicity, however, is not sufficient in every execution environment. A shared-sequencer model over two constant-product pools shows that the expected profit under atomic execution,

τ\tau39

can be lower than expected profit under non-atomic execution when one-sided swap success is itself valuable. In the symmetric case τ\tau40,

τ\tau41

and the model states that this quantity is negative. The paper concludes that switching to atomic execution does not always improve profits, and that shared sequencers may need guaranteed execution features beyond atomic swap bundling to attract arbitrage flow (Silva et al., 2024). This directly qualifies the common claim that atomicity is always profit-enhancing.

Several open problems recur across the literature. For large τ\tau42, signature enumeration in closed-form G3M arbitrage grows as τ\tau43, so heuristics or branch-and-bound pruning become essential for very large τ\tau44 (Willetts et al., 2024). Temporally varying weights in TFMMs require differentiating through the swap, and extension to stableswap, Uniswap v3’s piecewise-linear pool, cross-pool routing, and cross-chain arbitrage remains open (Willetts et al., 2024). At the ordering layer, Polygon studies point to auction-based consensus, time-based fairness, content-agnostic ordering, and application-layer solver models as directions for reducing AA leakage and its adverse externalities (Vostrikov et al., 29 Aug 2025). A plausible implication is that future AA research will remain split between execution efficiency, causal attribution, and protocol design aimed at reducing the very opportunities that AA exploits.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Atomic Arbitrage (AA).