Domain Context
The vocabulary, ecosystem map, and references a senior smart-contract engineer should be conversant in before walking into an AMM/DEX interview loop.
Vocabulary
| Term | Quick definition |
|---|---|
| AMM | Automated Market Maker. Smart-contract pool that quotes prices algorithmically. |
| CFMM | Constant Function Market Maker. Any AMM with a held-constant invariant. |
| CPMM | Constant Product Market Maker. x · y = k. Uniswap v1/v2. |
| CLMM | Concentrated Liquidity Market Maker. v3-style. |
| LP | Liquidity Provider. The party that deposits tokens earning swap fees. |
| Tick | Integer i such that price = 1.0001^i. Discrete unit of v3 prices. |
| sqrtPriceX96 | Square root of price in Q64.96 fixed-point. v3 native price representation. |
| Hooks | User-deployed contract that the core calls at swap/LP lifecycle moments (v4). |
| Singleton | One core contract holds state for all pools (v4, Balancer). |
| PoolManager | The singleton in v4 terminology. |
| Callback | Pool-initiated call back into the caller's contract mid-swap. Pull-based payment. |
| Permit / Permit2 | Signature-based approval. Permit2 is a canonical wrapper for any ERC-20. |
| Multicall3 | Canonical contract for batching multiple calls into one tx. |
| Flash swap / flash loan | Borrow within one tx; must repay before end. |
| JIT | Just-in-time liquidity. MEV pattern of adding LP right before a large swap. |
| Sandwich | MEV pattern of trading same direction before victim, reverse after. |
| TWAP | Time-Weighted Average Price. On-chain oracle from observation cumulatives. |
| Intent | User signs desired outcome; off-chain solver competes to fulfill. |
| Batch auction | Settle all orders at one clearing price per batch (CoW model). |
| StableSwap | Curve's invariant blending constant-sum and constant-product. |
| D invariant | StableSwap's "virtual reserve" computed via Newton's method. |
| K | Constant-product invariant; reserve0 · reserve1. |
| Virtual reserves | v3 LP position's effective reserves within its tick range. |
| Fee growth global | Per-token, per-pool cumulative fees-per-unit-liquidity. |
| Slot0 | Single-storage-slot pool state. Read once on every swap. |
| Tick bitmap | Compact bit set marking initialized ticks in v3. |
| EIP-1153 | Transient storage. TSTORE/TLOAD opcodes. |
| EIP-4844 | Blob transactions; reduces L2 data cost. |
| EIP-7702 | EOA delegation; EOAs can act as smart accounts in-tx. |
The DEX ecosystem
| Project | Family | What's distinctive |
|---|---|---|
| Uniswap v2 | CPMM | Two-token, fixed 30bps fee. The reference CPMM. |
| Uniswap v3 | CLMM | Concentrated liquidity; tick-based; multiple fee tiers. |
| Uniswap v4 | CLMM + Hooks + Singleton | Pluggable hooks, flash accounting, singleton PoolManager. |
| Curve v1 / v2 | StableSwap / Crypto pools | D-invariant; optimized for pegged pairs. v2 supports non-pegged via internal oracle. |
| Balancer v2 / v3 | Weighted; singleton Vault | Multi-token portfolios; vault architecture predates v4 singleton. |
| Sushi (v2/Trident) | CPMM + Trident-style | Fork-and-extend ecosystem. |
| PancakeSwap | CPMM + CLMM | BSC-native; gamified LP. |
| Aerodrome | v2 fork + ve(3,3) | Optimism/Base. Vote-escrow + bribes. |
| Maverick | Dynamic-bin CLMM | Directional LP; auto-shift bins with price. |
| Trader Joe v2 / v2.1 | Liquidity Book (discrete bins) | Per-bin reserves; no overflow-prone tick math. |
| Camelot | Concentrated + V2 | Arbitrum-native; staked-LP. |
| Dragonswap | v2/v3 fork | Sei-native; alt-VM but EVM-flavored. |
| Carbon (Bancor v3) | Asymmetric strategies | Limit-order-style concentrated liquidity. |
| CoW Swap | Batch auction | Solver-cleared, MEV-resistant. |
| UniswapX | Dutch-auction intent | Off-chain fillers settle on-chain via Reactor. |
| 1inch Fusion | Resolver-based | Pre-approved resolvers compete to fill. |
Aggregator / router ecosystem
| Aggregator | Speciality |
|---|---|
| 1inch | Pathfinder; on-chain settler; Fusion intents. |
| 0x | RFQ + AMM hybrid. Settler per chain. |
| ParaSwap | Adapters; supports many DEX families. |
| KyberSwap | Meta-aggregator + own pools (Elastic). |
| Odos | SOR; splitting; gas-aware routing. |
| CoW Swap | Order batching; not strictly an aggregator but consumes DEX liquidity. |
| Bebop | RFQ; market-maker driven. |
| LiFi / Socket / Squid | Cross-chain DEX aggregation + bridging. |
| Matcha (0x front-end) | Retail UX over 0x infra. |
The EVM L2 landscape
DEXes are deployed across many L2s. Each has quirks that affect contract engineering.
| Chain | Tech | Quirks for DEX engineers |
|---|---|---|
| Arbitrum One | Optimistic rollup, Nitro | L1 calldata pricing; gas reimbursement model differs slightly. Long-running tx limit. |
| Optimism | OP Stack | Same as Base. Mature ecosystem. |
| Base | OP Stack | Cancun. Very low fees. Big DEX volume. |
| Unichain | OP Stack, DEX-focused | Liquidity-hub aspirations; sequencer-level intent batching. |
| Scroll | zkEVM (Type 2) | Bytecode-equivalent. Some opcodes priced differently. Newer Cancun support. |
| Linea | zkEVM | Type-2 equivalent. Gas accounting differs slightly. |
| zkSync Era | zk-VM (account abstraction native) | NOT bytecode equivalent. Contracts must be recompiled with zksolc. Some opcodes (SELFDESTRUCT) unsupported. |
| Polygon zkEVM | Type-3 zkEVM | Mostly compatible. |
| BNB Chain | EVM L1 | Older Solidity compatibility considerations. Cheap; high-volume. |
| Avalanche C-Chain | EVM | Standard EVM behavior. |
| Polygon PoS | EVM L1 | Mostly standard. |
| Blast | OP-derived | Native yield on ETH/USDB; affects accounting. |
| Mode / Manta / Linea / Zora | OP Stack variants | Standard EVM. |
Where the volume actually lives
Most DEX volume currently sits on Ethereum L1, Base, Arbitrum, and BNB Chain. New EVM chains compete for it via incentives. Senior engineers think about which chains are "first-class" supported vs "best-effort."
The contract engineer's stack
- Solidity 0.8.26+ — current default. Older codebases on 0.7.x / 0.8.10.
- Foundry — build, test, fuzz, invariant, script, snapshot, mainnet fork.
- Solady — Yul-optimized library; FixedPointMathLib, SafeTransferLib, EIP712, etc.
- OpenZeppelin — for periphery, governance, upgradeable patterns.
- Halmos / hevm / Certora — formal verification.
- Echidna / Medusa — property-based fuzzers.
- Slither / Aderyn / Wake — static analyzers.
- Tenderly — simulation, alerts, traces.
- Etherscan + Dedaub — bytecode inspection.
- Dune / Flipside — SQL on-chain.
- The Graph + Goldsky + Envio — indexing.
- Forta / Hypernative / OZ Defender — monitoring.
Recommended reading
- Uniswap v2 whitepaper — Adams & Zinsmeister (2020).
- Uniswap v3 whitepaper — Adams et al. (2021).
- Uniswap v4 whitepaper + draft (Adams, 2023; finalized 2024).
- StableSwap (Curve) whitepaper — Egorov (2019).
- Improving Front Running Resistance of x*y=k Market Makers — Atallah, Ciamac (2021).
- An analysis of Uniswap markets — Angeris & Chitra (2019). The foundational CFMM-LVR paper.
- LVR (Loss Versus Rebalancing) — Milionis, Moallemi, Roughgarden (2022).
- Flash Boys 2.0 — Daian et al. (2019). MEV foundational.
- Spearbit, Trail of Bits, OpenZeppelin public audit reports — read 5+.
- Code4rena / Sherlock contest reports — the long-tail bug catalog.
- Solidity docs, Yul docs, EVM Codes — bookmark.