DeFi-CeFi Arbitrage Mechanics and Price Impact Estimation

Market Microstructure · Medium · Free problem

A trader notices price discrepancies between a token on a decentralized exchange (DEX, e.g., Uniswap) and a centralized exchange (CEX, e.g., Binance).

  1. Describe the mechanics of DeFi-to-CeFi arbitrage -- how does the trade work in practice?
  1. Within an Ethereum block, at what point in the transaction ordering would you want your arbitrage trade to execute, and why?
  1. How would you execute the trades to minimize risk?
  1. How can you estimate the price impact of your trade on each venue? Provide quantitative formulas where applicable.

Hints

  1. Think about what creates the price discrepancy in the first place -- a large trade on one venue that has not yet been arbitraged away.
  2. Consider how Ethereum's block structure and MEV ecosystem affect transaction ordering -- who decides which transaction goes first?
  3. For the AMM price impact, start from the constant-product invariant $x \cdot y = k$ and compute how much $y$ you must pay to extract $\Delta x$ from the pool.

Worked Solution

How to Think About It: DeFi-CeFi arbitrage is one of the cleanest forms of cross-venue arb in crypto markets, but it has unique execution challenges that don't exist in traditional finance. The core idea is simple: if ETH trades at \

{,}000 on Uniswap and \ {,}010 on Binance, buy on Uniswap and sell on Binance. The wrinkle is that DEX execution happens on-chain with public transaction ordering, so other arbitrageurs can see and front-run your trade. Understanding block structure, MEV, and AMM mechanics is essential.

Key Insight: The profitable arb is not just about finding a price gap -- it is about whether the gap exceeds your total costs: gas fees, price impact on both venues, and the risk of adverse execution (someone else capturing the arb first or the price moving between legs).

The Method:

1. Arbitrage Mechanics

Suppose token $X$ trades at price $P_{\text{DEX}} < P_{\text{CEX}}$.

The reverse works too: if the DEX price is higher, buy on CEX and sell on DEX.

In practice, you need pre-positioned inventory on both venues to execute both legs near-simultaneously. Alternatively, on the DEX side, you can use flash loans to borrow the input asset, execute the swap, and repay within a single transaction -- requiring no upfront capital for the DEX leg.

2. Optimal Position in the Block

Ethereum blocks are produced roughly every 12 seconds. Within a block, transactions are ordered by the block proposer (formerly miner, now validator post-merge).

3. Execution Strategy

4. Price Impact Estimation

DEX (constant-product AMM, e.g., Uniswap v2):

A pool holds reserves $x$ (token $X$) and $y$ (stablecoin) with invariant $x \cdot y = k$. To buy $\Delta x$ of token $X$, you pay:

$\Delta y = \frac{y \cdot \Delta x}{x - \Delta x}$

The effective price is $\Delta y / \Delta x$, and the price impact relative to the marginal price $y/x$ is:

$\text{Price impact} = \frac{\Delta x}{x - \Delta x}$

For small trades ($\Delta x \ll x$), this simplifies to approximately $\Delta x / x$. For a pool with \

0M in reserves and a \
00K trade, impact is roughly 1%.

For concentrated liquidity AMMs (Uniswap v3), the impact depends on the liquidity distribution around the current price and requires integrating over tick ranges.

CEX (order book):

The classical square-root impact model gives:

$\text{Impact} \approx \sigma \cdot \sqrt{\frac{Q}{V}}$

where $\sigma$ is the daily volatility, $Q$ is the order size, and $V$ is the average daily volume. For a \

00K order on a token with \
0M daily volume and 5% daily vol:

$\text{Impact} \approx 0.05 \times \sqrt{0.01} = 0.05 \times 0.1 = 0.5\%$

Alternatively, for immediate execution, walk the order book: sum the quantity at each price level until your order is filled, and the volume-weighted average price gives the realized impact.

Practical Considerations:

  • Gas costs: At 20 gwei and a 200K gas swap, gas is roughly \$5-10. This sets the minimum profitable arb size.
  • Competition: MEV is extremely competitive. Searchers run sophisticated bots and bid most of the profit away as builder tips.
  • Inventory risk: If you pre-position on the CEX, you bear the risk of holding the token while waiting for arb opportunities.
  • Latency vs. capital: Flash loans require no capital but add gas cost. Pre-positioned capital is faster but ties up money.

Answer: DeFi-CeFi arb exploits cross-venue price differences by buying cheap on one venue and selling dear on the other. Execute the DEX leg atomically (smart contract with slippage protection), ideally positioned via Flashbots as a backrun immediately after a price-moving trade. DEX price impact follows $\Delta x / (x - \Delta x)$ for constant-product AMMs. CEX impact follows the square-root model $\sigma \sqrt{Q/V}$. Profitability requires the price gap to exceed total costs: gas, impact, fees, and builder tips.

Intuition

DeFi-CeFi arbitrage is the crypto equivalent of cross-exchange arb in traditional finance, but with a crucial twist: DEX transactions are public and orderable by block builders. This creates an entire ecosystem (MEV) around transaction ordering rights. The arbitrageur's edge comes not just from detecting price discrepancies but from executing faster and with better block positioning than competitors. In mature markets, most of the arb profit gets bid away as tips to block builders, making it a game of infrastructure and efficiency.

The price impact formulas reveal an important asymmetry: AMM impact is deterministic (given the pool state, you know exactly what you will pay), while order-book impact is stochastic (the book can change between observation and execution). This makes the DEX leg more predictable but potentially more expensive for large trades, since AMM liquidity is typically thinner than deep CEX order books.

Open the full interactive solver →