AMM & Liquidity
Decentralized exchanges are the beating heart of on-chain markets. In traditional finance, a centralized limit order book aggregates buy and sell orders, and a matching engine pairs them by price-time priority. On a blockchain, this is expensive — storing every order on-chain, updating the book with each fill and cancellation, and matching at the granularity traders expect would consume more gas than the trades themselves are worth.
Automated Market Makers solve this by replacing the order book with a mathematical formula. A single smart contract holds reserves of two (or more) tokens, and a bonding curve — most famously the constant product formula x * y = k — determines the exchange rate at any trade size. Traders interact directly with the pool rather than with each other. Liquidity is always available, at some price.
But this elegance creates a new kind of market microstructure. Slippage is deterministic: the larger the trade relative to pool depth, the further the price moves along the curve. Liquidity providers earn fees but face impermanent loss when the price ratio of the pooled assets diverges. Concentrated liquidity (Uniswap V3) lets LPs allocate capital within specific price ranges for higher efficiency, but demands active management — inactive positions earn nothing when the price moves outside their range.
This section covers the mechanics, mathematics, and strategies of decentralized exchange markets. From building a DEX market maker on Uniswap V3 that manages tick ranges and fee tiers, to modeling liquidity shocks as mean-reversion signals, to analyzing why large trades fail and how smart order routing mitigates fragmentation. We cover funding rate arbitrage across perpetual DEXs, the liquidity dynamics of liquid staking token pools, and the computational complexity underlying AMM design.
Research Areas
- AMM Design — Constant product, concentrated liquidity, dynamic fees, Uniswap V4 hooks. How the mathematical structure of the AMM determines execution quality and LP returns.
- Liquidity Provider Strategy — Tick selection, fee tier optimization, position rebalancing frequency. When does active LP management outperform passive provision?
- Impermanent Loss & LVR — Quantifying the adverse selection cost that LPs incur from arbitrageurs trading against stale prices. Is fee income sufficient compensation?
- Execution Quality — Slippage, price impact, and smart order routing. How aggregators split trades across fragmented DEX liquidity to minimize execution costs.
- Cross-Venue Arbitrage — CEX-DEX price divergence, funding rate spreads across perpetual DEXs, and the arbitrageurs who keep prices aligned.
Featured Research
Fading Toxic Flow: An Automated Mean-Reversion Strategy for DEX Liquidity Shocks
A microstructure alpha engine that detects isolated DEX liquidity shocks and systematically fades them, betting that temporary AMM price impacts revert to equilibrium. Full strategy design and implementation.
All AMM & Liquidity Articles
Fading Toxic Flow: An Automated Mean-Reversion Strategy for DEX Liquidity Shocks
A microstructure alpha engine that detects isolated DEX liquidity shocks and systematically fades them, betting that temporary AMM price impacts revert to equilibrium. Full strategy design and implementation.
Big O Notation and Time Complexity Analysis for Uniswap V3 Smart Contracts
Big O time complexity analysis applied to Uniswap V3 smart contracts. How factory operations, pool lookups, and fee tier configuration scale as the protocol grows — and what it means for gas costs.
Aftershock: How rsETH/wstETH Liquidity and Price Moved in the Hours After April 18
What happened to rsETH/wstETH liquidity and price in the hours after April 18, 2026: a block-by-block onchain analysis of the ripple effects on a thin Uniswap v3 pool, including 72.7% price impact, 108-second recovery, and what the aftermath reveals about AMM behaviour under stress.
C++ Trading - Building a DEX Market Maker: Simulating Uniswap V3 Liquidity Provision
How to build a DEX market maker in C++ that simulates Uniswap V3 liquidity provision in price bands, tracks fee earnings, and models how liquidity distribution changes as prices move.
Who Is Paying to Stay Long on Hyperliquid? Funding Rate Data Across 204 Pairs on Binance
A Python monitor that pulls live funding rates across all 230 Hyperliquid perpetuals and compares them against Binance. 141 of 166 cross-venue pairs skew the same direction. What the crowd is paying — and what the HIP-3 equity perp data actually shows.
Why Large Trades Fail on DEX - From 5% Slippage to 10% Price Crashes
Why institutional-scale trades fail on DEX: at $10M+ notional, DEX slippage hits 10% and stays there. Data-driven analysis of the liquidity ceiling that routes large orders to OTC desks instead of Uniswap.