28 Tweets 3 reads Jan 20, 2023
The DEX wars are heating up with each protocol vying for liquidity and fees.
Each contender offers it's own unique value prop and is packing some serious tech under the hood.
Let's sample these delectable delights and see whose recipe makes for the best DeFi experience 🍮
But just before we dive in, it's important to call out that there is no one perfect place to make a trade.
Depending on which AMM you're using, there are trade-offs.
Whether you're a liquidity provider or a trader will dictate how you're affected and how your downside is protected.
Liquidity providers may gravitate toward a particular AMM for impermanent loss protection while traders may choose another for less slippage on a sizable swap.
Speaking of downside protection, a good protocol will leverage the tech in their AMM to:
1. service a segment of users willing to pay adequate fees
2. protect users from IL and/or slippage in a trade of two or more particular asset types.
So let's get started!
It all began when Bancor developed their alternative to the traditional order book, the Constant Product Market Maker.
The CPMM relies entirely on price discovery and does not take on additional info from an oracle, the price is wholly defined by the example curve below.
The CPMM sets a price as a function of the ratio of assets held in the liquidity pool, with price then responding to demand.
Bancor's innovation led to what is one of the most popular DeFi primitives, used also by the likes of Uniswap and Balancer.
Next up are the Constant Sum Market Makers which function by way of pricing two assets using an oracle.
A CSMM will ignore am LPs portfolio amounts and trade until both assets are exhausted.
The curve below shows the exchange rate remaining constant until the LP is illiquid.
The CSMM is put to use in Aave's wrapper contracts and Maker's Peg Stability Module.
CSMMs have stable exchange rates but are vulnerable to arbitrage and can sometimes fail to provide liquidity.
These two examples are historic and represent more extreme types of AMMs with major trade-offs for both volatile and stable asset pairs.
Modern algorithms have taken the best from both approaches and combined them into what are some of the market leading AMMs.
Significant R&D has been invested into improving the previous two models, and as a result a number of very exotic and highly performative hybrid solutions have emerged.
The first of these solutions is Curve's StableSwap which has been adopted as the standard for pegged assets.
$CRV's algorithm is excellent when pooling 1:1 pegged assets due to it's behaviour of only slowly moving from a CSMM -> CPMM.
StableSwap will adjust the exchange rate between two or more assets very slowly, but then accelerates as the price deviates from the peg.
This behaviour was seen during the Luna collapse, when their respective 4CRV pools diverged from equilibrium.
As users frantically sold off their $UST, StableSwap quickly deviated toward it's constant product mechanism, giving up the peg and spectacularly crushing the UST price.
While known for efficient 1:1 pegged pools, Curve is also a major player in the volatile asset space with their Curve V2 pools powered by CryptoSwap.
This algorithm builds on StableSwap by introducing a parameter which allows the pool to more quickly adjust from a CSMM -> CPMM.
CryptoSwap has the added benefit of concentrating liquidity around the current price, reducing slippage and allowing large trades to not drastically affect price.
Curve V2 pools have been refined over time and now form a major part of the liquidity backbone of DeFi.
A recent entry into the AMM market is Solidly, pioneered by the famed Andre Cronje.
$SOLID leverages SolidlyStable, an algorithm based on Uni V2, but with a couple of subtle differences, most notably, the lack of Uniswap's adjustment parameter.
SolidlyStable is a stable swap algorithm and is a marked improvement over CPMM when performing 1:1 exchanges.
It performs similarly to Curve's StableSwap, and can be used for assets with fluctuating pegs.
However, it can be less efficient for those assets with a tighter peg.
If you're unsure how Solidly and many of the other forks leveraging Andre's work function, take a look at the following thread 👇
The previous AMMs have spun efficiency via transformation of their curve.
Kyberswap introduced another flavour to the mix with their Virtual Reserves AMM, multiplying the real balances of each asset to achieve capital efficiency, but at the cost of portfolio risk.
It was Uniswap V3 that took the virtual reserves concept and dialed it up to eleven.
$UNI allowed their LPs to select their price range and potentially earn more fees, cleverly outsourcing the hard problem of where to deploy liquidity.
V3 has dominated the space and is by far the largest by volume, generating outsized returns for LPs and a seamless experience for traders.
The trade-off for LPs is that their V3 position requires active engagement and complex decision making.
Dashboard credit: @zackmarkman
To wrap-up each approach we have:
- StableSwap (Curve): excellent for 1:1 assets
- CryptoSwap (Curve): great for volatile pairs with the added benefit of some automated liquidity concentration
- SolidlySwap (Solidly): similar performance to StableSwap but somewhat easier to manage and is more forgiving to fluctuating pegs
- UniV3 (Uniswap): market leader with minimal slippage and massive volume on stable and volatile swaps leveraging virtual reserves.
This overview is by no means exhaustive and has focused on the primitives themselves.
Each approach discussed offers many additional features which skew the value prop for users in one direction or another.
Other considerations beyond the tech are financial KPIs and tokenomics, product engagement figures, ecosystem and community engagement figures alongside market share, CAGR and addressable vs obtainable markets.
There's nothing more exciting than a healthy battle between incumbents and challengers.
Each protocol is vying for market share, their approaches are unique and the fierce competition makes for an improving LP & trading experience.
The heat in the kitchen can only get hotter!
If you'd like to dive deeper into how AMMs function be sure to check out @mattdeible's work at @semioticlabs along with Uni's, Curve's and Solidly's various whitepapers.
Want more threaded DeFi insights with a side of dessert? Follow, like and retweet if we've added to your knowledge stack.
Pudding out 😋

Loading suggestions...