DeFi Fundamentals
Automated Market Maker (AMM)
An automated market maker is a smart contract that algorithmically prices and trades tokens using pooled liquidity instead of order books.
A decentralized exchange is a peer-to-peer trading platform powered by smart contracts that allows users to swap tokens without a central intermediary.
A decentralized exchange (DEX) is a peer-to-peer marketplace that enables users to trade cryptocurrencies directly from their wallets without depositing funds with a centralized intermediary. DEXs run entirely on smart contracts deployed on blockchains like Ethereum, Arbitrum, and BASE, eliminating the need for a trusted third party to hold assets or match trades. Since the rise of DeFi in 2020, decentralized exchanges have grown to process billions of dollars in daily trading volume, fundamentally changing how crypto assets change hands.
Most modern DEXs rely on an automated market maker (AMM) model rather than the traditional order-book approach used by centralized exchanges. In an AMM-based DEX, liquidity providers deposit pairs of tokens into liquidity pools — for example, an ETH/USDC pool. A mathematical formula, typically the constant-product equation (x * y = k), determines the price of each asset based on the ratio of tokens in the pool. When a trader swaps one token for another, they trade against the pool rather than waiting for a counterparty.
Some DEXs, such as dYdX and Maverick, use hybrid models that combine on-chain settlement with off-chain order books, offering tighter spreads and a more familiar trading experience for professional market makers. Concentrated liquidity models, pioneered by Uniswap v3, allow liquidity providers to allocate capital within specific price ranges, improving capital efficiency but adding complexity.
The most fundamental difference between a decentralized exchange and a centralized exchange (CEX) is custody. On a CEX like Coinbase or Binance, users deposit funds into the exchange's wallets, trusting the company to secure those assets. On a DEX, users retain control of their funds at all times — tokens only leave a wallet when a trade is executed through a smart contract.
Other important distinctions include:
Decentralized exchanges are deeply intertwined with lending protocols. Borrowers who take out loans against their crypto collateral often swap borrowed assets on DEXs to execute leveraged strategies or hedge positions. Liquidators — the participants who repay undercollateralized loans to claim collateral — depend on DEX liquidity to quickly sell seized assets at fair prices.
Slippage, the difference between the expected price and the actual execution price, is a critical consideration for both traders and liquidators. Large trades in shallow pools can suffer substantial slippage, which directly affects the profitability of liquidation and the health of lending markets. This is why deep, reliable DEX liquidity is essential to the stability of the broader DeFi ecosystem.
Despite their advantages, DEXs come with notable risks. Smart contract bugs can lead to exploits and loss of pooled funds. Impermanent loss affects liquidity providers when token prices diverge significantly from their deposit ratio. Front-running and sandwich attacks by MEV bots can extract value from ordinary traders by manipulating transaction ordering within a block.
Regulatory uncertainty also looms over the DEX landscape. As governments worldwide develop crypto regulations, the permissionless and pseudonymous nature of decentralized exchanges may face new compliance requirements.
The DEX ecosystem includes several well-known protocols: Uniswap dominates general-purpose token swaps, Curve Finance specializes in stablecoin and like-asset trading with minimal slippage, and PancakeSwap serves the BNB Chain ecosystem. Newer entrants like Aerodrome on BASE and GMX for perpetual futures continue to expand the range of on-chain trading options available to users.
Related Terms
DeFi Fundamentals
An automated market maker is a smart contract that algorithmically prices and trades tokens using pooled liquidity instead of order books.
DeFi Fundamentals
A liquidity pool is a smart contract holding pooled tokens that enables decentralized trading, lending, and other DeFi operations.
DeFi Fundamentals
The difference between the expected price of a crypto trade and the actual execution price, caused by liquidity constraints or market movement.
Blockchain & Networks
A custodial crypto trading platform operated by a central company that matches buy and sell orders on behalf of users.