Decentralized exchanges have been core to DeFi since the very beginning. But why are there so many? and how are different from each other?

If you're looking for innovation of in DeFi, look no further than the evolution of DEXes.

🧵 Here's your map of the Cambrian DEXplosion
I've sorted DEXes into 8 major categories:

1. On-chain orderbooks
2. Off-chain orderbooks w/ on-chain settlement
3. Off-chain RFQ w/ on-chain settlement
4. AMMs
5. Concentrated Liquidity AMMs
6. Stable swaps
7. AMM variants
8. Synthetic swaps

Lets go through each w/ examples:
1️⃣ On-chain orderbooks

These systems model traditional centralized exchanges, but use smart contracts for order submission, matching, and execution.

This approach was used by the first DEXes on Ethereum, but has since fallen out of favor due to high gas costs and low TPS.
@EtherDelta was one of the original Ethereum DEXes to use this approach.

Today exchanges such as @ProjectSerum on Solana, and @tonicdex on Near have revived this approach on faster, lower-cost chains.
2️⃣ Off-chain orderbooks with on-chain settlement

To work around slow and expensive chains, hybrid architectures were built to offload order collection and matching to off-chain services. Only trade settlement (the actual exchagne of assets) happens on-chain.
@0xProject is a protocol that powered many of these hybrid DEXes in the early days prior to the advent of AMMs.

@dydx uses a similar architecture, as does the @WyvernProtocol that powers OpenSea
3️⃣ Off-chain RFQ with on-chain settlement

"Request for quote" is a market mechanism commonly found in OTC scenarios where market makers quote specific prices for each potential trade. Like off-chain orderbooks, off-chain quoting saves gas and trade costs.
A primary example is @hashflow_ which allows traders to obtain quotes directly from market makers that settle on-chain.

@0xProject can also be used to build an RFQ-style exchange.
4️⃣ Automated market makers

AMMs are smart contracts that manage both sides of a market. "Liquidity providers" deposit tokens into these contracts which are then priced automatically for traders to trade.

AMMs enabled the first autonomous, composable, "always-on" markets.
The most common form, known as the "constant product" AMM, was popularized by early protocols like @bancor and @uniswap

This simple architecture inspired many forks and offshoots including @sushiswap, @PancakeSwap, @traderjoe_xyz, @trisolarislabs, @Spirit_Swap, and @osmosiszone
5️⃣ Concentrated Liquidity AMM's

An important evolution of constant product AMMs, CLAMMs allow liquidity providers to specify the price ranges that their assets can be used to make markets.

This unlocks greater capital efficiency for market makers and better pricing for traders.
CLAMMs were pioneered by @uniswap v3 but we are starting to see competing implementations of the idea in projects like
@crema_finance and @sushiswap's Trident
6️⃣ Stable swaps

Another special type of AMM that can be used to efficiently create markets between similarly priced assets. DeFi stablecoin trading is largely powered by stable swap AMMs.
@CurveFinance was the first to bring these specialized AMMs to market and current leads in market liquidity and volume.

@saddlefinance, @mstable_, @Saber_HQ, and @sushiswap's Trident also employ similar approaches.
7️⃣ AMM variants

Many more enhancements to the basic AMM have been built:

→ More than two assets in a pool: @BalancerLabs, @sushiswap Trident

→ Oracle-informed AMMs that use external pricing information to reduce impermanent loss for LPs: @BreederDodo, @CurveFinance v2
→ Using the time dimension to reduce slippage losses: @mooniswap, TWAMMs like @fraxfinances's fraxswap and @PulsarSwap

→ Liquidity sensitive fee models: @THORswap

→ vAMMs which allow for trading with leverage: @perpprotocol @DriftProtocol

→ and many more
8️⃣ Synthetic swaps

Worth also mentioning are swaps between synthetic asset types, which are not token swaps per se, but swaps between different denominations of debt.

@synthetix_io has an internal market that allows traders to perform these swaps based on oracle prices.
Through crypto winters and DeFi summers, DEX teams have been continuing to build on each others work and push forward the state of the art.

If all this happened in the first 4 years, I'm excited to see what the next 10 years will bring.
You can follow @puntium.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: