AMM DEXs Lead Now But Will They Be the Top DeFi Trading Venue Next Bull Run?

AMM DEXs Lead Now But Will They Be the Top DeFi Trading Venue Next Bull Run?

By Michael @ CryptoEQ | CryptoEQ | 6 Jun 2023


You are reading an excerpt from our free but shortened abridged report! While still packed with incredible research and data, for just $20/month you can upgrade to our FULL library of 50+ reports (including this one) and complete industry-leading analysis on the top crypto assets. 

67cbbf4723857b85c151585aa280e6d940346c501cef75bafd7dea02b44b24c9.png

Becoming a Premium member means enjoying all the perks of a Basic membership PLUS:

  • Full-length CORE Reports: More technical, in-depth research, actionable insights, and potential market alpha for serious crypto users
  • Early access to future CORE ratings: Being early is sometimes just as important as being right!
  • Premium Member CORE+ Reports: Coverage on the top issues pertaining to crypto users like bridge security, layer two solutions, DeFi plays, and more
  • CORE report Audio playback: Don’t want to read? No problem! Listen on the go.

 

Decentralized Exchanges (DEXs)

A key advantage of decentralized exchanges (DEXs) lies in their transparency, achieved through open-source smart contracts. With all transactions recorded on a blockchain, a public ledger is accessible to all. DEXs also enable peer-to-peer (P2P) transactions without intermediaries, allowing users to transact directly from personal wallets, eliminating the need to trust third parties. Consequently, DEXs appeal to investors seeking increased transparency and control over their assets, as centralized exchanges have encountered challenges in customer holdings and transaction history transparency.

On the other hand, DEXs exhibit certain limitations compared to centralized exchanges. Blockchain-based transactions on DEXs may result in slower speeds and higher fees than those processed by centralized exchanges utilizing central servers. Additionally, centralized exchanges often feature user interfaces similar to traditional financial institutions, making them more accessible to investors, whereas DEXs might offer less intuitive experiences. Furthermore, while centralized exchanges facilitate digital asset trading against fiat currencies, fiat currency conversions on DEXs are less straightforward.

AMMS

An automated market maker (AMM) is a specific type of decentralized exchange (DEX) that relies on a mathematical formula to price assets instead of an order book where buys and sells are matched like on Coinbase or Gemini. Traditional market-making utilizes giant firms with extensive resources to create a tight bid-ask spread on an order book exchange. Automated market makers decentralize this process, enabling anyone to create a market for any two tokens on a blockchain. 

DEX vs CEX DEX vs CEX. Image credit: Wharton

The image shown below illustrates the three primary parties:

  • Liquidity Providers – create new pools, add liquidity to existing pools, and remove tokens from reserves they contribute to;
  • Traders – pay the swap fee, which is effectively added to the reserve of the pool KNC/USDT; and
  • Arbitrageurs – enforce an efficient price mechanism at a pool-level.

UNI AMM diagram Uniswap. Uniswap Blog​​​​​​

In order to enable anyone to provide liquidity and earn fees on any assets, Uniswap uses a mathematical formula to rebalance liquidity providers' deposits. Uniswap uses the formula x * y = k. 

  • x is the amount of one token in the liquidity pool
  • y is the amount of another
  • k is a fixed constant 

AMM explainer diagram Source

Both x and y are rebalanced based on their price and liquidity variations to one another. The goal is for the value of k to remain constant, despite these changes and split 50/50 between both assets in the pool. Essentially, the ratio of value between the two tokens must always remain the same. The price of a trade is determined by how much the ratio between the tokens in the liquidity pool changes after a trade. If the ratio changes by a wide margin, there’s going to be a large amount of slippage.

Traders interact with a smart contract, rather than an order book, that dictates the trade price between assets. This is a peer-to-contract (P2C) interaction that removes the need for a central entity/business to help facilitate the trade. The combination of x*y=k and only interacting with smart contracts is what is truly revolutionary and enables Uniswap to democratize market making. 

Liquidity providers (LPs) add funds to the AMM pool which creates the market for each trading pair. LPs will deposit an equivalent value of two tokens i.e 50% ETH and 50% AAVE to the ETH/AAVE pool. When a trader draws from that liquidity pool, the mathematical formula will set the price so that the balance of ETH-AAVE remains in balance.

liquidity pool diagram Source

AMM Dominance

Automated Market Makers (AMMs) have gained substantial ground, capturing over 95% of the total volume of decentralized exchanges (DEXs). This dominance emanates from the core attributes of AMMs that uniquely position them in the face of alternative designs, such as traditional limit order books or Request For Quotations (RFQs).

AMMs, particularly of the Uniswap version 2 (Univ2) style, are designed to function even in low liquidity conditions. They always provide a price, thereby maintaining a continuous marketplace. Moreover, AMMs inherently offer passive liquidity management. This removes the active management burden from liquidity providers (LPs), making it easy for anyone to function as an LP and earn fees, thus democratizing the process beyond the realm of traditional market makers.

Another notable advantage of AMMs lies in their computational efficiency. Compared to order-book exchanges, they require less computational and storage resources, thereby consuming less gas—an important consideration given the costs associated with transactions in the Ethereum ecosystem. Additionally, AMMs operate without gatekeepers, offering a stark contrast to traditional exchanges where high listing fees can often be prohibitive, and centralized exchanges reserve the right to delist tokens at will.

However, the current decentralized finance (DeFi) environment presents different challenges. Despite increased order volumes, the presence of professional market makers, and a wider range of quoted assets, AMMs are not without their flaws. Gas is much cheaper on Layer 2 solutions (L2s), and the weaknesses of Constant Function Market Makers (CFMMs), which constitute most AMMs today, are more commonly understood.

One of the major drawbacks of AMMs is high gas fees. Trading on-chain remains expensive. Though AMM pool fees (0.01–0.3%) are comparable to centralized exchange (CEX) spreads, gas fees can substantially inflate the cost of small trades (under $1000), even on L2s. Additionally, prices on AMMs can often become stale, given that they only move through trades. This necessitates reliance on arbitrage traders to ensure AMM prices align with current market prices, yet these arbitrage traders face their own constraints such as pool fees, gas costs, and the inherent risk of holding volatile assets.

Furthermore, AMMs have vulnerabilities when it comes to value extraction. Traders can be subject to predatory practices such as frontrunning, sandwich attacks, or having their trades blocked, thereby resulting in unfavorable prices.

Sandwich Attacks

A sandwich attack is a type of frontrunning attack that exploits the fact that the price of an asset can move in response to buying and selling pressure.

To understand how a sandwich attack works, it is important to understand how the price of an asset is calculated on the blockchain. The price of an asset is typically calculated as the current exchange rate between assets. For example, if a contract is currently trading 1 USDC for 100 k9coin, then you could say k9coin has a price of 0.01 USDC.

However, prices generally move in response to buying and selling pressure. If a large order is sitting in the mempool, traders have an incentive to copy the order but with a higher gas price. That way, they can purchase the asset before the large order, let the large order move the price up, and then sell the asset right away.

The sell order is sometimes called “backrunning.” The sell order can be done with by placing a sell order with a lower gas price so that the sequence looks like this:

  1. Frontrun buy
  2. Large buy
  3. Sell

The primary defense against this attack is to provide a “slippage” parameter. If the “frontrun buy” itself pushes the price up past a certain threshold, the “large buy” order will revert, making the frontrunner fail on the trade.

It’s called a sandwich, because the large buy is sandwiched by the frontrun buy and the backrun sell. This attack also works with large sell orders, just in the opposite direction.

Here are some tips for avoiding sandwich attacks:

  • Use a slippage parameter.
  • Monitor the mempool for large orders.
  • Use a decentralized exchange (DEX) that uses a fair ordering mechanism.

Additionally, fragmentation of liquidity also poses a challenge for AMMs. The same tokens are often paired with different tokens across multiple pools, leading to a diffusion of liquidity, resulting in reduced fees for LPs, and lower depth and sub-optimal prices for traders. Centralized exchanges, by comparison, generally use a single quote asset, enabling market makers to concentrate most liquidity around the current market price.

Lastly, AMMs face issues of price and inclusion uncertainty. Trades can often fail or experience slippage due to market-moving trades, posing additional risks for traders. Additionally, the fixed spread charged by AMMs makes them vulnerable in highly volatile markets and less competitive in less volatile markets.

Despite these challenges, it's important to underscore that the era of AMMs is far from doomed. Ongoing research and advancements in blockchain technology are continuously refining these models, potentially providing solutions to the discussed drawbacks. The increasingly complex and sophisticated world of cryptocurrencies holds much promise for the evolution of AMMs and their role within it.

 

How do you rate this article?

36


Michael @ CryptoEQ
Michael @ CryptoEQ

I am a Co-Founder and Lead Analyst at CryptoEQ. Gain the market insights you need to grow your cryptocurrency portfolio. Our team's supportive and interactive approach helps you refine your crypto investing and trading strategies.


CryptoEQ
CryptoEQ

Gain the market insights you need to grow your cryptocurrency portfolio. Our team's supportive and interactive approach helps you refine your crypto investing and trading strategies.

Publish0x

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.