All articles
MEV·December 2, 2025·5 min read

MEV in Polymarket's AMM: Liquidity Pool Arbitrage and Mispricing Capture

Polymarket's CLOB and AMM hybrid creates exploitable mispricings when news breaks faster than market makers can update quotes. This article explains how to identify stale liquidity, build the arbitrage transaction, and manage the on-chain execution on Polygon.

Polymarket runs a hybrid architecture — a Central Limit Order Book (CLOB) for active market makers paired with an Automated Market Maker that absorbs retail flow and provides passive liquidity. When a news event moves the true probability of an outcome before the AMM's prices have adjusted, you get a clean arbitrage window: buy the underpriced shares from the pool, sell into the CLOB at the corrected price, or vice versa. The window is short and the gas economics on Polygon are unforgiving, but the edge is real and repeatable.

How the Hybrid Creates Stale Prices

The CLOB updates in near-real-time as market makers cancel and reprice their resting orders. The AMM does not. Its price is a function of the current reserve ratio — it cannot anticipate news, it can only react after someone trades against it. That asymmetry is the opportunity.

Concretely, the AMM uses a constant-product curve over YES and NO token reserves. The spot price for YES shares is reserveNO / (reserveYES + reserveNO). When a Republican primary result lands on wire services, sharp CLOB makers pull their YES offers and reprice within seconds. The AMM still holds the old reserve ratio for several blocks until an arb trade rebalances it.

The mispricing window is typically 3–15 blocks on Polygon (roughly 6–30 seconds at the 2-second block time). After that, either the AMM gets hit by arb flow or the CLOB liquidity thins enough that the spread converges naturally.

Finding the Trade

You need two live data feeds running in parallel:

  • CLOB mid-price — pull from Polymarket's off-chain order book API (/markets/{conditionId}) every 500ms and compute the weighted mid across the top 3 levels.
  • AMM spot price — derive on-chain from the pool reserves by calling getReserves() on the CTF Exchange contract, or subscribe to Swap events to keep a local state mirror.

When |CLOB_mid - AMM_spot| > threshold, a trade may be live. The threshold is not fixed — it needs to cover the AMM swap fee (typically 2%), the CLOB taker fee (currently 0 for most markets but check per-market config), and your expected gas cost expressed in probability terms. On a 1 USDC/share position, a $0.004 gas cost moves your breakeven by 0.4 percentage points.

Do not chase tight spreads. On markets with low liquidity, a 1% AMM mispricing can evaporate entirely inside your transaction due to slippage from the pool's shallow depth. Check the AMM's total value locked before sizing — if the pool holds less than $5k in reserves, the price impact of a $200 arb will eat most of the edge.

Building the Transaction

The execution path for buying from the AMM and selling to the CLOB is not atomic in the traditional sense — Polymarket's CLOB is off-chain (operated by Gamma), so you cannot close both legs in a single on-chain transaction. This means you carry inventory risk between legs.

For the on-chain leg (AMM buy), call swap() on the pool contract with amountIn set to your USDC, minAmountOut set to expectedShares * (1 - slippage_tolerance), and deadline set to block.timestamp + 2 to avoid stale inclusion. Use a slippage tolerance of 0.5–1% on liquid markets, tighter on deep pools.

For the off-chain leg (CLOB sell), submit a POST to /order with a limit order priced at or slightly below the current CLOB best bid. Do this immediately after your swap transaction broadcasts — before it confirms — so you are positioned to fill as soon as the shares land in your wallet. You will need to handle the case where the CLOB price moves adversely between your broadcast and confirmation; set a cancel-on-miss flag or monitor the order aggressively.

Signed orders require your wallet's ECDSA signature over the EIP-712 typed data structure that Polymarket's CTF Exchange contract validates. Keep your signing key in a local HSM or encrypted env var — never hot in the bot process itself.

Managing Polygon Gas

Polygon's gas market is cheap but spiky during high-activity periods — exactly when your arb windows open. Use eth_maxPriorityFeePerGas from the RPC to set a dynamic tip. Multiply the current base fee by 1.5 and add a 30 GWEI priority tip as a floor. This lands you in the top quartile of block inclusion without overpaying on quiet blocks.

Consider a private mempool relay (Flashbots Protect on Polygon, or a direct validator relationship) to avoid frontrunning. Your swap transaction is not sandwichable in the traditional sense — the AMM has no deadline on the fill order — but a faster arb bot can frontrun your trade and take the mispricing before you land. Private relays eliminate most of this exposure.

Position Sizing and Risk Controls

Hard limits matter more than alpha here. A few constraints worth enforcing:

  • Max notional per trade: size to no more than 2% of the AMM's TVL to keep price impact below your fee threshold.
  • Max open inventory: cap the shares you hold between AMM fill and CLOB fill at a level you can exit at a 5-point loss without material damage.
  • Stale-quote kill switch: if the CLOB mid moves more than 3 points against you after your swap broadcasts but before it confirms, cancel the CLOB sell immediately and assess manually.
  • Market-resolution guard: check isResolved on the ConditionalTokens contract before any trade. Entering a position 30 minutes before resolution with a 0.5% edge is not worth the binary outcome risk.

The bots we build at TierZero run these checks as synchronous guards inside the decision loop — not as async callbacks that can race.


If you want to run a Polymarket arb strategy in production rather than on paper, reach out — we scope, build, and operate the full stack.

Need a bot like this built?

We design, build and run trading bots on Solana, Hyperliquid and Polymarket.

Start a project
#MEV#Polymarket#AMM#arbitrage#Polygon#prediction markets#liquidity#on-chain trading