BTC
ETH
HTX
SOL
BNB
View Market
简中
繁中
English
日本語
한국어
ภาษาไทย
Tiếng Việt

CEX can't escape the fate of supervision, discuss in detail the difficulties and opportunities of DEX

Foresight News
特邀专栏作者
This article is about 5437 words, reading the full article takes about 8 minutes
DEX volume still lags behind CEX, how to make DEX more attractive?
AI Summary
Expand
DEX volume still lags behind CEX, how to make DEX more attractive?

first level title

Original compilation: Luffy, Foresight News

TLDR

  • Smart contract blockchains are perfect for running exchanges: they commoditize trust, make custody, fees, pricing and settlement transparent, and allow anyone to be a market maker.

  • However, trading volume on decentralized exchanges (DEX) still lags behind centralized exchanges (CEX) due to: uncompetitive prices; execution is prone to abuse (MEV); LPs are not yet profitable enough.

  • introduce

introduce

DEX is one of the main use cases of smart contract blockchain. They are often criticized for being altcoin casinos, but whether or not they lead to speculation, there is enormous value in the mechanism of permissionless token listings.

The current cryptocurrency exchange landscape consists of OTC, CLOB (Central Limit Order Book), RFQ (Request for Quote) and AMM (Automated Market Maker).

AMMs have grown into a major use case for creating trading markets without the involvement of professional market makers. But CLOB is still the main source of trading volume (according to Defillama data, DEX trading volume only accounts for 16% of CEX, and more than 60% of DEX trading volume is driven by MEV, including arbitrage between CEX and DEX, seeAlastor,image description)。

DEXs still only account for around 15% of cryptocurrency trading volume. But their share is growing. Source: Coingecko Q1 2023 Industry Report

In this article, we will first clarify what characteristics a good exchange needs to have, then we focus on the current shortcomings of DEX, and propose some paths to improve the design of DEX.

What does a good exchange look like?

As a trader, what do I need:

  • Trust: Escrow risk before, during and after a transaction should be transparent and minimized.

  • Best price: I get the best price on this exchange every time, or close to it - so I don't need to worry about getting caught on price.

  • Fairness: No one else deserves a better price or pays less than I do.

  • Speed ​​and Availability: Reduce the time spent waiting for trades to complete or exchanges to open.

  • Info: The exchange helps me make informed choices and monitor my orders. I can see the prices at which trades are likely to settle and get good limit order prices and slippage advice. I can also view open, billed or canceled orders.

  • Deep Liquidity and Broad Asset Coverage: The high liquidity of a large number of assets can make me feel more at ease.

What liquidity providers and market makers (MMs) need:

  • Yield: Justify the reasonable profit behind capital risk and opportunity cost.

Optimal risk-adjusted returns are important to market makers, and other metrics are only a means to that end. High trading volumes, low competition, high spreads, good rebates, low custody risk, etc. are all geared towards a higher risk-adjusted rate of return.

Blockchain is a great place to run an exchange and already provides traders and market makers with most of what they want: decentralized, open-source settlement mechanisms and an open transaction history are trust, security, transparency and fairness solid foundation.

But decentralized exchanges still need some improvements:

  • provide reliable prices;

  • Provide good income for LP;

  • Response to MEVs that violate commitments to fair enforcement.

Why AMMs are so popular

AMM accounts for more than 95% of all DEX trading volume, and is the absolute leader of the DEX market. Here are the most important reasons why AMMs are by far ahead of alternative designs like traditional limit order books or RFQs:

  • Low Liquidity Requirements: AMMs always provide prices, even with little liquidity.

  • Passive Liquidity: Your liquidity is managed automatically in the AMM, so becoming an LP is easy and anyone can earn fees.

  • Simplicity: AMMs require less computation and storage than order book exchanges, so they consume less gas;

  • No Gatekeepers: Market maker and exchange listing fees can be prohibitively high, and centralized exchanges can delist tokens at any time. AMMs make it easy for any project to self-list transactions and incentivize liquidity.

It was not until the end of 2020, two years after the launch of Uniswap, that DEX trading volume rebounded significantly. Source: Dune

When the first decentralized exchange launched, it had little liquidity, few market makers, few transactions, and high gas costs. It is impossible to run CLOB under these conditions, but AMM is very suitable. They are fairly simple and easy to build, simulate and audit.

But defi is different now. Order volumes are picking up, professional market makers are quoting a wide variety of assets, L2 with lower gas fees is starting to spread, and everyone knows something about the weaknesses of CFMMs (i.e. most AMMs today).

AMMs are still the sweet spot for some markets (e.g., long-tail tokens), but they lag behind centralized exchanges in key areas.

The problem with AMMs

High gas fees

On-chain transactions are still expensive. AMM transaction fees (0.01 – 0.3%) are not much different from CEX, but gas fees can easily make small transactions (< $1000) prohibitively expensive, even on L2.

Poor price timeliness

An AMM usually doesn't give you the best price, its price only changes through transactions. Therefore, you need to rely on arbitrage traders to ensure that the AMM price is in sync with the current market price. However, in addition to holding risk, arbitrage traders are also limited by transaction fees and gas fees. As a result, less liquid AMM pools can easily be 1-5% off the best quotes from other exchanges.

Loss and Rebalance (LVR)

summarysummary

AMMs are passive, so if an asset's price is determined by other markets (eg, on Binance), the price on the AMM will always lag behind. If the price on Binance rises, then the AMM will sell the tokens to arbitrageurs at an undervalued price. If the price drops on Binance, the AMM will buy tokens from arbitrageurs at exorbitant prices.

Over time, AMMs, and especially their LPs, will accumulate losses. This is the cost LP pays to arbitrageurs to pull the price back to the market price.

In contrast, market makers on limit orders try to adjust their quotes as soon as the price changes. Then rebalance their portfolios at market prices. So this mechanism of AMM is called Loss and Rebalance (LVR). This is the loss a passive LP suffers from trading with arbitrageurs at the wrong price, rather than rebalancing their assets at current market prices.

tweetstweetsLVR is well explained.

  • LVR is permanent: LVR losses cannot be recovered if the price returns to previous levels, unlike impermanent losses.

  • LVR increases with increased volatility: the greater the price increase, the greater the LP's loss. In fact, losses are quadratically related to volatility.

  • LVR depends on where the price is found: what matters is how far you sell to arbitrageurs from the current weighted average market price.

Since you as an LP also earn fees on each trade, this can work in your favor if your pool has a large enough weight in the market. If LVR < fees earned, these trades actually make you a profit rather than a loss. Pools with smaller market weights will receive higher LVRs, and their profits are shifted to those earned by LPs in larger pools.

extractable value

Traders and LPs are vulnerable to AMM value extraction:

  • Traders: Seekers can pre-empt, insert or block your trades and influence your closing price.

  • Passive LPs: More mature and active LPs can provide timely liquidity to collect most of your transaction fees.

decentralized liquidity

On CFMM, the same token is often paired with multiple different tokens (e.g., USDC-WBTC, DAI-WBTC, ETH-WBTC), and even the same trading pair is divided into multiple fee tiers. This spreads liquidity across multiple pools (WBTC in this case) and results in lower fees for LPs and worse depth and prices for traders. Most of the liquidity is not used for trading (such as in the Uniswap V2 design), and even on the range order AMM, the price is often far away from the area where the liquidity is concentrated.

In centralized exchanges, there is usually only one quotation asset (such as the US dollar), and market makers will actively keep most of the liquidity around the current market price, which has little impact on traders' prices.

more questions

The above problems also bring more disadvantages to CFMM:

  • Uncertainty about price and inclusion: Deals often fail

  • Fixed Slippage: AMMs charge fixed spreads on orders. This makes them vulnerable in highly volatile markets and less competitive in less volatile markets.

  • Difficulty attracting liquidity: Loss and rebalancing and liquidity fragmentation make LPs on AMMs less profitable and more difficult to attract liquidity. Therefore, protocols usually need to subsidize LPs through liquidity mining incentives to attract sufficient liquidity.

  • Decentralized liquidity: On a DEX, a token usually has multiple trading pairs. Most of the liquidity is not used for trading (and even on range order AMMs, prices are often far away from where liquidity is concentrated.

But these problems don't mean that AMMs are doomed. Both research and blockchain technology have advanced significantly and enabled new solutions that could address these shortcomings.

Improved Design of DEX

There are already several approaches trying to solve the problems of DEX's bad price, MEV, loss and rebalancing, and liquidity fragmentation. Let's summarize the most important methods and propose some new ones.

Lower Gas Fee

cheaper block space

L2 transaction costs are one to two orders of magnitude cheaper than L1. Therefore, transaction costs are now no longer the bottleneck. This means that more computationally intensive protocol designs, such as order books, are starting to become possible. But to compete with CEX in small transactions, Gas costs may need to be reduced by another order of magnitude.

Cows

Example of a Match of Demand (CoW) trade between three traders. Everyone makes the exchanges they want, providing liquidity to each other — without routing through DEXs or paying DEX fees.

Demand Matching (CoW) is basically a P2P asset exchange between traders who simultaneously trade complementary pairs. Traders do not pay AMM transaction fees and pay less Gas (just transfer). However, for them to work, you need good oracles with the best current bids and offers.

CowSwap fully supports matching requirements (full, partial, and multi-party ring transactions) - settling many transactions that do not require DEX fees.

Off-chain calculation, on-chain verification

More complex functionality can be achieved if you keep the computationally intensive part off-chain and only use the chain for escrow, settlement, and verification. For example, track and match limit orders off-chain, but keep funds and settle trades on-chain.

Improve price timeliness

RFQ

With RFQ, you can buy directly from the market maker. Since market makers can trade in all venues (off-chain and other chains), through them, you can also access the price and liquidity of these venues. The gas efficiency of RFQ orders is also higher (only transmission and signature verification, no need to route through the pool).

Hashflow and Airswap provide easy on-chain access to RFQs.

instant liquidity

To compensate for the risk of toxic order flow, market makers do not offer as tight and deep a quote as possible on an exchange. In effect, ordinary users pay taxes to market makers to subsidize toxic order flow.

But if, instead, you let the market maker set the price after the user submits the trade, then the market maker can quote a better price because they are taking less risk. This provides better prices for regular users and makes life harder for arbitrageurs.

This idea comes from the design of ChainFlip's JIT AMM model.

Lower DEX fees

One of the reasons for the high fee is to protect the LP from LVR. However, if the DEX can protect itself from LVR (see below), then it can also set lower fees.

One way to keep prices up to date and prevent unprofitable arbitrage is to use Oracles to set prices.

repair LVR

Oracle-based pricing

As long as AMMs set prices passively, they can be vulnerable to toxic order flow. One way to avoid this is to proactively update prices on the AMM before arbitrageurs come in.

Oracles need to be fast and accurate enough not to leave arbitrage opportunities. As long as the transaction costs < the market price difference, arbitrage is unprofitable. Therefore, to avoid toxic order flow, the accuracy of the oracle price needs to be less than the transaction fee of the AMM.

AMMs can even set prices after users sign transactions. This further protects LPs from providing outdated prices, thereby avoiding arbitrage risks.

Swaap uses oracle-guided pricing to drastically reduce LP's LVR.

incentive delay

If AMMs could differentiate between informed (and potentially very unprofitable) and uninformed (average profitable) order flows, and only keep uninformed order flows, many problems would be solved.

Dynamic fees and transaction latency can help AMMs differentiate between poison orders and retail orders.

Trading signals decay quickly, so long delays from oracles will make it harder for informed traders to catch the AMM off guard. Here's how it works:

  • Slow settlement is cheap: If you can wait 5 minutes for your transaction to settle, transaction fees are cheap (eg, 0.1% fee). Transactions will be settled at the price 5 minutes from the oracle. Uninformed traders won't mind this option as they save on fees and the cost of waiting 5 minutes is small.

  • Fast settlement is expensive: Settlement is expensive at the current oracle price (eg, 0.4%). Higher fees reduce the likelihood that an informed trader's signal advantage is so great that the AMM is unprofitable. And, this still provides a quick checkout option for users who are willing to pay for it.

Latency allows DEXs to separate toxic order flow from non-toxic order flow, or DEXs can simply disable fast settlement entirely. To effectively stop toxic order flow, fast settlement fees must account for the currency's impact on market volatility.

An exciting example of this is a recent vote in which Balancer decided to reduce transaction fees by 50-75% for all order flow from CowSwap. CowSwap conducts batch auctions, and batch auctions introduce latency, making them unattractive for toxic order flow, so Balancer can safely lower fees for them and increase profits for their LPs.

Active Liquidity Management

Centralized liquidity positions (Uniswap V3) allow LPs to channel their liquidity to specific price ranges. This allows LPs or third parties to maintain liquidity around current market prices and substantially increases LP's capital efficiency.

Active liquidity management can even protect LPs from certain LVRs.

With a reliable oracle, AMMs can even set their own liquidity around the current oracle price, so active LP management is not required.

Maverick has successfully used this strategy to significantly improve LP's capital efficiency.

Dynamic slippage and volatility oracles

Since AMM losses depend on the size of the arbitrageur's signal advantage, toxic order flow is more likely to occur on more volatile token pairs. In a traditional order book, market makers would add spreads during periods of high market volatility. AMMs can do the same and dynamically adjust fees based on current market volatility.

Uniswap v3 already has a rough version that offers different fee tiers for the same trading pair and lets LPs choose the fee tier that fits the price volatility of that token pair.

Market makers also adjust their slippage to rebalance their positions to meet their targets - AMMs can do a similar thing for their LPs.

Anti-MEV

Privacy Transaction Submission

Privacy RPC that bypasses the public mempool is a way to effectively protect transactions from front-running and sandwich attacks.

lot auction

Batch auctions are a great way to make prices fair: you can place orders in batches over a period of time, and all trades for the same pair are executed at the same price. This reduces the chances of your trade being front-runned. Batch auctions also add delays that prevent the flow of toxic orders. Like negative latency oracles, batch auctions are less composable.

They also dramatically improve the pricing, available liquidity, and routing of transactions. This mostly eliminates the possibility of transaction backdating.

As mentioned earlier, CowSwap already runs batch auctions, bringing fairer and safer settlements to traders.

Dynamic Slippage Tolerance

Setting up slippage is not easy. If the pair is volatile, too little slippage can make your trade fail, while too much slippage can make you vulnerable to a sandwich attack. Therefore, in order to avoid trade failures, decentralized exchanges usually have a high default slippage tolerance.

However, with volatility and depth oracles, DEX UIs can do a better job and predict the correct slippage for each trade. This helps users avoid sandwich attacks or failed transactions.

1inch already runs logic to dynamically set slippage.

All LPs become Instant LPs

There is another way to mitigate just-in-time (JIT) liquidity attacks: As with the "last look" above for LPs, if you change the model to determine the price after a user signs a transaction, then you can allow everyone to submit their just-in-time quote And play fair. However, this only works for LPs willing to run aggressive strategies and able to respond to each trade individually.

Summarize

Summarize

While public blockchains are excellent infrastructure for exchanges, DEXs have yet to handle the majority of transaction volume. There are many reasons why trading volume and market makers are not yet fully on-chain: uncompetitive prices, poor user experience for traders, low yields, and unsafe execution. Fortunately, there are already good solutions to all of these problems, and they promise to bring most of the transaction volume on-chain.

Many thanks to @ankitchiplunkar, @thegostep, @orbmis, @SimonAHarman, @paul_burlage, @CyrillePastour, and @senken_io for their helpful input and in-depth feedback.

DEX
exchange
Binance
Welcome to Join Odaily Official Community