Polymarket utilizes Gnosis’s Conditional Tokens Framework (ERC-1155) paired with an off-chain Central Limit Order Book (CLOB) settled on Polygon. Unlike CPMM models (e.g. Uniswap), where liquidity is continuous along a constant product curve, a CLOB operates with discrete price ladders for each binary outcome token (YES and NO).
For an event space partitioned into $n$ mutually exclusive and collectively exhaustive outcomes, the canonical no-arbitrage condition is:
$$\sum_{i=1}^n p_i = 1.00$$
Where $p_i$ is the price of the $i$-th outcome token. If market makers update books with high latency or retail market orders sweep liquidity in single outcomes, the aggregate ask price can deviate:
$$\Omega_{\text{ask}} = \sum_{i=1}^n \min(\text{Ask}i) < 1.00 - \Phi{\text{fees}}$$
This presents an instantaneous, risk-free Long Dutch Book. The arbitrageur purchases quantities across all outcomes and calls the mergePositions function on the Gnosis CTF contract to redeem 1.00 unit of underlying collateral (USDC) per basket.
import numpy as np
from dataclasses import dataclass
from typing import Dict, List
@dataclass
class BookLevel:
price: float
size: float
class DutchBookEngine:
def __init__(self, taker_fee_bps: float = 0.0):
self.fee_multiplier = 1.0 + (taker_fee_bps / 10000.0)
def evaluate_arbitrage(self, books: Dict[str, List[BookLevel]]) -> Dict:
best_asks = {k: v[0] for k, v in books.items() if v}
total_cost = sum(lvl.price for lvl in best_asks.values()) * self.fee_multiplier
if total_cost < 1.00:
max_units = min(lvl.size for lvl in best_asks.values())
net_pnl = max_units * (1.00 - total_cost)
return {
"arbitrage_found": True,
"cost_per_basket": total_cost,
"net_profit_usdc": net_pnl,
"basket": {k: v.price for k, v in best_asks.items()}
}
return {"arbitrage_found": False}
Negative-Risk Conversion Mechanics
In high-cardinality markets (e.g., 20 candidates in an election), managing 20 independent binary pairs creates severe capital fragmentation. Polymarket solves this with the NegRiskAdapter.
The adapter allows an arbitrageur to convert:
$$\text{USDC} \longleftrightarrow \sum_{i=1}^n \text{NO}_i$$
and interchangeably execute:
$$1 \text{ YES}k \longleftrightarrow \sum{j \neq k} \text{NO}_j$$
This couples the order books mathematically. If YES_A surges due to retail demand, an algorithmic searcher shorts YES_A, converts collateral to NO tokens via the adapter, and sells the remaining NO tokens into the bid side of the sibling order books, extracting synthetic maker rebates while restoring market parity.
Top comments (0)