Risk Warning: Beware of illegal fundraising in the name of 'virtual currency' and 'blockchain'. — Five departments including the Banking and Insurance Regulatory Commission
Information
Discover
Search
Login
简中
繁中
English
日本語
한국어
ภาษาไทย
Tiếng Việt
BTC
ETH
HTX
SOL
BNB
View Market
DWF Labs: Ecological overview and strategic analysis of decentralized perpetual contracts
区块律动BlockBeats
特邀专栏作者
2023-10-12 12:00
This article is about 7263 words, reading the full article takes about 11 minutes
What other potential developments are there in the field of DEX perpetual protocols?

Original title: Diving Deep into Decentralized Perpetual Futures: An Ecosystem Overview and Strategic Analysis

Original author: DWF Labs Research

Original compilation: Kaori, BlockBeats

In an earlier article in the Hindsight series, we introduced the DWF Ventures 2023 investment thesis, detailing our three main areas of focus:

  • Derivatives Agreement

  • Consumer Dapps

  • Data and privacy layers in infrastructure

For the first area, derivatives agreements cover a wide range of products. This includes a variety of financial instruments such as futures, options, structured notes and bonds. However, in this article, we will focus on one of the most prominent derivatives in the crypto space – perpetual contracts. Here, we will explore the current state of perpetual contracts, analyze the differences between centralized exchanges (CEX) and decentralized exchanges (DEX), review existing DEX perpetual protocol evolution, and discuss potential developments in this space develop.

Perpetual contracts: a product for the crypto world

For starters, perpetual contracts (perpetuals), or perpetual products (perps), are currently the most popular derivatives contracts in the crypto market. Since their introduction by Bitmex in 2016, perpetual contracts have steadily taken market share from traditional futures contracts.

Today, perpetual contracts account for a staggering 97% of total trading volume.

The popularity of perpetual contracts can be attributed to two main factors:

  • Flexible contract duration: Perpetual contracts provide flexibility, allowing positions to remain open indefinitely or closed at the trader’s discretion. Fixed expiration dates in traditional futures have practical uses in hedging risk and pricing future production and delivery costs for physical commodities. However, in the world of digital assets like Bitcoin, these costs are miniscule, making term or delivery-based hedging unnecessary.

  • Better alignment with spot prices through funding rates: Without an expiry date, perpetual contracts use funding rates to ensure their prices are closely aligned with the spot market. This approach results in less price volatility than the price volatility of a futures contract during its expiration period.

Ultimately, these factors simplify the trading experience, making it easier and more intuitive for users to manage leveraged positions. Thus, making it one of the most widely adopted derivatives.

Mismatch between CEX perpetual contracts and DEX perpetual contracts

Given the success of perpetual contracts, one might expect to see this success extend to both centralized and decentralized cryptocurrency trading platforms. However, the current trading volume ratio between DEX and CEX is seriously imbalanced, with DEX only accounting for about 1% of the total trading volume.

This striking comparison highlights that centralized trading platforms still have clear advantages over most decentralized venues in terms of centralized limit books (CLOBs) and trading processes.

Creating a decentralized “CEX experience”: the limit order book model

CEX uses the CLOB model for trading as this is one of the most efficient ways of matching buyers (takers) and sellers (market makers). These limit order books can process up to 100,000 orders per second on CEXs like Binance with an average latency of just 5 milliseconds. The model allows savvy actors such as market makers to interact with the system and facilitate fair price discovery. This helps users get the best price with minimal slippage.

However, replicating the limit order book (LOB) model to DeFi has proven challenging due to blockchain limitations such as block finality, speed, and gas fees. This challenge has led to the emergence of automated market makers (AMMs) as an alternative solution. AMMs allow tokens to be traded permissionlessly without the need for a centralized trading platform or market maker, as liquidity providers (LPs) take on the responsibility of facilitating trades.

However, the inherent AMM algorithm has shortcomings. It tends to result in higher slippage, especially for larger trade sizes and during periods of market volatility. This fundamental limitation highlights why market makers are inherently more motivated to participate in LOB models. The LOB model allows market makers to enter positions at favorable bid and ask prices, significantly reducing the risk of finding themselves in a losing position. In contrast, liquidity providers (LPs) in AMMs mainly rely on user transaction fees as a source of revenue. However, these fee gains may be offset by temporary losses when traders make profits. This makes AMM less attractive to LPs relative to the potential profitability demonstrated by LOB models.

DYDX: Pioneer in the decentralized perpetual contract market

Recognizing this market gap, dYdX was the first to introduce the order book model in the field of decentralized perpetual contracts. As a first mover in the market, dYdX gained the necessary market share and established its position as the top perpetual contracts decentralized exchange (DEX) in terms of trading volume. Through the order book (LOB) model, it provides the lowest market maker and order taker rates among all DEX perpetual contract protocols, which is an important factor in its dominance. Currently, dYdX operates on Layer 2 (L2) infrastructure provided by StarkEx, enabling higher transaction throughput.

However, dYdX is not yet fully decentralized due to the inherent limitations of the underlying blockchain. It uses an off-chain matching engine because the on-chain model is too slow and inefficient for users. StarkEX extends dYdX by processing and validating transactions off-chain, requiring only STARK proofs to be verified on-chain. Processing transactions on-chain means it is processed on Ethereum, which is not efficient as each block update can only support about 12 seconds.

In order to achieve complete decentralization, some people have tried to introduce a fully on-chain order book, but at the expense of running on other chains, such as Solana. Zeta and Mango Markets are such protocols that leverage Solanas fast block times (~0.5 seconds) to provide the best on-chain experience. However, compared to the centralized exchange (CEX), the on-chain order book on Solana still lags far behind - Zeta can only accommodate up to 910 buy and sell orders at a time, and the speed is still significantly slower than CEX. The limited growth of these protocols suggests that decentralization will not be a key advantage for users.

Therefore, increasing trading volume and liquidity remain key to competing with CEXs. dYdX is moving towards building its own L1 on Cosmos, leveraging the Tendermint Byzantine Fault Tolerance (BFT) consensus mechanism. In addition to 1-second block times and high performance of up to 1,000 transactions per second (TPS), Tendermint BFT allows customization of the set of validators and their responsibilities. Each validator will ensure that orders and cancellations are always propagated in the network. However, this is not an on-chain operation as it is not submitted to consensus. Orders are still matched off-chain, and transactions are subsequently submitted on-chain each block.

This therefore raises the debate that dYdX faces the risk of high levels of centralization, as validators have incentives to work with market makers to front-load or reorder trades for MEV profits. In this regard, dYdX is working with Skip Protocol and Chorus One to mitigate bad validator behavior. Slashbacks may be used to deter collusion between market makers and validators, with penalties set at a level that makes validators unwilling to risk additional revenue.

Pushing the boundaries of LOB sustainable DEX decentralization: Hyperliquid

Other protocols are following suit, creating their own L1s - such as Hyperliquid, which is still in beta. The application chain was built manually by the team, using only Tendermint for consensus. It is reportedly capable of handling up to 20,000 operations per second (including orders, cancellations, liquidations), which is approximately 20 times the current capabilities of dYdX v3. It leverages a mix of external and internal market makers (HLP LPs), promoting greater decentralization as anyone can provide liquidity. Through optimization of infrastructure and application code, it is able to fully bring the order book on-chain. This ensures ordering transparency, unlike in off-chain order books where validators can capture MEV for themselves. Additionally, the DAO will be responsible for the utilization of the insurance fund, compared to the insurance fund controlled by dYdX’s team. Overall, Hyperliquid decentralizes more protocol aspects than dYdX.

The protocol has completed more than $5.6 billion in transaction volume since starting its alpha mainnet phase on June 14, averaging $47.8 million per day. Although this represents only a small portion of dYdX’s trading volume, it is comparable to GMX and exceeds Perpetual Protocol’s daily trading volume.

However, current trading volume and liquidity may be driven by airdrop rumors, and it is unclear whether these levels can be maintained without rewards. From the outset, the protocol is likely to be quite centralized, with the majority of validators being teams ensuring the smooth functioning and uptime of the protocol. Gradual decentralization may bring consensus issues, which dYdX may also face. Overall, the AppChain model is still relatively new and it would be very interesting if the protocol could be stress tested during periods of volatility.

Despite this, dYdX is currently the clear market leader in the decentralized perpetual contracts space, with its low fees, deep liquidity, and a model that is battle-tested through different periods of volatility. In the direct aftermath of the FTX crash in November 2022, the number of dYdX users increased by 39%. Since then, dYdX’s average monthly trading volume has also increased, indicating that they offer a good alternative to CEX traders.

AMM model adapted to DeFi: introducing vAMM for perpetual contracts

In the DeFi field, AMMs (automated market makers) help solve the problem of high gas fees associated with numerous trading orders. Perpetual Protocol further advances this area by introducing the concept of a virtual automated market maker (vAMM) designed specifically for perpetual contracts.

How a Virtual Automated Market Maker Works: Insights from Perpetual Protocols

In the virtual automated market makers (vAMMs) model, liquidity providers (LPs) play a unique role. Unlike traditional settings where LPs hedge directly with traders, here traders provide liquidity to each other through collateral warehouses located outside the vAMM ecosystem. This warehouse plays a vital role in generating virtual tokens and facilitating trading of perpetual contracts.

The vAMM mechanism relies on the x*y=k constant product formula, which is a time-tested concept in decentralized finance (DeFi). However, there is a key difference here. In this case, the k value is not determined by the real assets in the asset pool; instead, it is set manually by the platform team. This manual control ensures that the value of k remains balanced to prevent users from suffering slippage (if k is too low) or experiencing significant price deviations relative to the underlying index price (if k is too high).

In contrast to order book systems, where short and long open interest levels remain equal, the vAMM model allows for a free-floating net open interest. To keep prices stable and consistent with index prices, funding rates play a role. These rates act as an incentive for arbitrageurs, encouraging them to participate and driving the perpetual price closer to the spot price.

Challenges facing Perp v1

However, Perp v1 poses significant risks to the protocol due to its persistent long-short imbalance. The protocol had to step in and pay traders the funds, which came from the insurance pool. In theory, transaction fees should always be greater than the total amount of funds paid to traders to make the protocol model sustainable. Unfortunately, this model proves to be unsustainable during periods of greater volatility, when the deviation between the mark price and the index price is large. As the market declines, overestimating the k value causes funding rate payments to increase, ultimately depleting insurance funds. Therefore, Perp v1 is being phased out.

The evolution of Perp v2

Perp v2 attempts to mitigate the risks that plagued v1 by leveraging the Uni v3 pool as an execution layer for liquidity. Although LP still provides unilateral liquidity, the collateral will be converted into two virtual tokens (for example, USDC collateral generates equal amounts of vUSDC and vETH, and then deposited into the Uniswap vUSDC-vETH pool) for range orders . This approach ensures that every long order corresponds to a short order that is taken on by the market maker, and vice versa. Therefore, fund payments are only between counterparties and do not involve the protocol and traders, as seen in v1. By pooling liquidity, LPs can achieve greater capital efficiency while traders receive better prices and less slippage. However, LPs will also experience temporary losses in this model if their positions are not hedged accordingly.

V2 utilizes Uniswap v3 TWAP and Chainlink oracles to determine index prices. In theory, permissionless listing of assets could be allowed as long as they have a price data source on either oracle platform. However, there are still risks associated with listing with other assets, and the process is managed by a DAO, adding a layer of complexity to the creation of new markets. Since the protocol uses cross-margining by default, a user’s collateral is automatically shared between different positions in the account. Long-tail assets, due to the inherent volatility and illiquidity of these assets, will pose significant risks to these portfolios, which poses significant challenges for protocols to list these assets.

Overall, vAMM provides a good option for traders looking for decentralization and instant liquidity. However, in the Perp v2 model, liquidity providers (LPs) must bear the risk of impermanent losses. They are compensated by the higher fees they receive on trades, thereby passing the cost on to traders. Additionally, vAMM is limited by the amount of liquidity in the pool, which will result in price slippage on larger trades. The model still relies heavily on arbitrageurs, who are incentivized by funding rates, to reduce the gap between sticker and index prices. As a result, the top 10 traders on Perp v2 account for an average of approximately 88% of the daily trading volume across all currency pairs. Therefore, this protocol is more suitable for LPs and arbitrageurs who are proficient in market operations, as traders can enjoy lower fees and deeper liquidity on other protocols.

Integrating two major advantages: connecting order books and AMM for optimal trading

Experience with Perp v1 and Drift v1 shows that a pure vAMM model is unsustainable in the long term. A similar situation also occurs in Drift v1, which adopts a dynamic vAMM model (dAMM) that adjusts virtual reserves (k) based on transaction needs. However, when LUNA prices plummeted, the long-short imbalance quickly escalated. At the same time, problems with settlement in smart contracts allowed traders to withdraw large amounts of positive PnL without corresponding negative PnL, causing bad debts to exceed the insurance fund. This triggered a bank run scenario, forcing a halt in transactions and withdrawals.

Drift v2: A hybrid solution

Drift v2 aims to solve the problems of the dAMM model in v1 by introducing a hybrid approach that utilizes both the order book and the dAMM as a source of liquidity. Drift v2 allows transactions to be routed through 3 liquidity sources, ensuring that large numbers of orders can be efficiently matched on the chain.

1. Just-in-time (JIT) liquidity: Market makers compete to fill market orders through Dutch auctions. The auction starts with a market order price and changes gradually. Auction duration is 5 seconds.

2. Decentralized limit order book: Orders are routed through the limit order book (LOB), managed by keepers, matched with market makers, and earn a certain percentage of fees from transactions.

3. AMM: Even without a market maker, this component ensures that users’ orders are always filled. Use funding rates to achieve the goal of remaining neutral (i.e. if you are net long, have a premium on short positions).

Advantages of hybrid models

Through a hybrid order book AMM model, Drift is able to bridge the gap in reducing slippage on large trades, which has been a barrier for users to fully switch to on-chain trading. Another advantage of this model is that trading pairs on the Drift decentralized limit order book (DLOB) can achieve tighter bid-ask spreads compared to other Solana perpetual contract DEXs. This is enabled by the ability for market makers to enter limit orders based on real-time oracle prices and price offsets, known as oracle offset orders.

Combined with the reversal of the market maker-taker order in the traditional order book (i.e., the market maker is passive in that takers specify their orders before market makers compete to fill them), this increases competition and incentivizes Market makers quickly fill orders. This approach is also more efficient than traditional LOBs because the market maker does not have to actively manage the position (i.e., requote as the price changes). Therefore, the incentives are aligned with counterparties on both sides - market makers are encouraged to continue to provide liquidity, because the protocol can reduce the toxic liquidity of the taker, while ensuring that the taker obtains the best transaction price through competition among market makers.

The hybrid model significantly improves liquidity, enhancing the trader experience through better prices and faster execution. On Drift, more than half of the trading volume is now done by market makers rather than dAMMs, demonstrating the effectiveness of adding an extra layer in terms of liquidity. Having an external source of liquidity can also help balance the AMMs inventory skew, reduce the likelihood of non-permanent losses faced by LPs, and reduce the need for arbitrageurs to step in. There may be more iterations to improve this model in the near future, with protocols such as Vertex and Syndr also building towards hybrid order book AMM models.

The rise of the liquidity pool model in perpetual contract DEX

The liquidity pool model is becoming increasingly popular in the perpetual contract trading space, driven by the growth of protocols such as Synthetix and GMX. Over the past year, we have observed an increasing number of new decentralized exchanges adopting this model.

GMXs unique approach

One notable example is GMX. GMX is a decentralized spot and perpetual trading platform built on Arbitrum and Avalanche. Different from the typical AMM model, GMX adopts a point-to-pool model.

GMX v1 features a multi-asset pool and dynamic aggregation oracle provided by Chainlink to determine the true price of an asset. GLP consists of asset indices for exchange and leveraged trading, such as BTC, ETH, AVAX, UNI, LINK and stablecoins. GLP tokens can be minted by depositing any index asset. GMX v2 also introduces an independent GM pool (GMX Market Pool), allowing liquidity providers to customize their exposure by selecting the specific tokens they prefer to support.

GLP is essentially like the “bookmaker” in a casino. When a trader opens a long position on ETH, the trader is taking the upside of ETH from the GLP pool. When a trader opens a short position on ETH, the trader is taking the upside of other assets relative to ETH from the GLP pool.

If the trader wins, the profit will be paid out from the GLP pool in the form of long or short tokens. If a trader loses money, the loss will be deducted from the collateral and paid to the GLP pool.

Although there is a risk that liquidity providers may lose principal when traders make profits, historical data shows that most liquidity providers actually make profits by hedging against traders. For example, in the example below, it is worth noting that most traders trading on GMX v1 are losing money with LPs (liquidity providers).

The revolutionary role of Synthetix

Synthetix, a decentralized liquidity layer based on Ethereum and Optimism, has been at the forefront of this change. Synthetix’s derivatives, facilitated through platforms like Kwenta on Optimism, rely on the liquidity provided by Synthetix’s debt pool. The Synthetix debt pool plays a key role in facilitating trading of synthetic assets and perpetual futures. With Synthetix liquidity pools and Chainlink and Pyth oracles, the need for traditional order books and counterparties is eliminated. This approach allows Synthetix’s liquidity to be pooled and transmitted across markets, effectively solving the problem of slippage.

Additionally, Synthetix’s native token $SNX plays a crucial role as collateral for the Synthetix debt pool. Currently, approximately 93% of $SNX is staked, with a total staked value of approximately $573 million and a fully diluted valuation of $617 million (as of October 10, 2023).

How to differentiate between liquidity pools and vAMMs

In this context, it is crucial to understand the core differences between liquidity pool models and vAMMs. While both approaches eliminate traditional intermediaries such as market makers and centralized exchanges, their mechanisms are quite different.

In vAMM, the pool only replicates the liquidity depth of the AMM. Perp v2 is built on Uni v3, and the perp pool is essentially a Uni v3 pool composed of virtual tokens minted by the clearing house. On the other hand, the liquidity pool model does not have replicating liquidity like Perp v2 and GMX, traders trade directly with the pool liquidity.

Furthermore, in vAMM, funding rate plays a crucial role. They incentivize arbitrageurs to step in and minimize the deviation between market and index prices. In contrast, for the liquidity pool model, the oracle price plays a more important role than the funding rate. It is worth noting that GMX v1 does not rely on funding rates to maintain consistency with spot market prices. This situation continued until the launch of GMX v2.

Finally, in terms of risk management, vAMMs often use insurance funds as a safety net. This fund is used to absorb traders profits and losses (PnL). In contrast, in the liquidity pool model, liquidity providers (LPs) need to fully bear the traders PnL.

The rise of the liquidity pool model in perpetual contract trading reflects a revolutionary shift in the DeFi field. This innovative approach facilitates direct and decentralized interaction between traders and liquidity providers, while opening up profit opportunities for the latter. Groundbreaking protocols like Synthetix and GMX are paving the way for a more efficient and inclusive trading ecosystem. As DeFi continues to develop, the continued exploration of innovative trading models is expected to bring more diversity and efficiency to the entire field and meet the needs of a wider range of users and investors.

Beyond Decentralization: Insights into the Future of Sustainable DEX

In the ever-growing field of sustainable DEXs, this article delves into their evolution and explores case studies of some well-known models. Ideally, choosing between a perpetual CEX or a DEX should be a simple binary decision between centralization and decentralization. However, reality is far more complex than this.

While perpetual trading is undoubtedly a good fit for the crypto trading world, the challenges facing perpetual DEXs go beyond improvements in speed, volume, and transaction fees. The transition from CEX to DEX is multifaceted, and many complex factors must be resolved before users can move to a sustainable DEX with confidence.

Key components for building a perpetual contract trading platform

Developing a perpetual contracts trading platform involves a number of key components that are essential to its successful operation. These components are important for both CEX (Centralized Exchange) and DEX (Decentralized Exchange) platforms, but the methods to implement them are very different. This difference is driven by the core between centralization and decentralization. Driven by difference. Heres a breakdown of these necessary components and their importance:

Note: UI/UX is not included in the components as we consider it to be a fundamental aspect in evaluating any permanent DEX aiming to achieve mass adoption.

Decentralized Creativity: Inspiring Sustainable DEX Progress

Although both CEX and DEX platforms aim to provide perpetual contracts, fundamental differences in back-end technology and the concept of decentralization make achieving the same goal significantly different. Three key differences: blockchain technology, decentralization, and the utility of protocol tokens have an important impact on the operation of DEX relative to CEX:

  • Blockchain Technology: Decentralized exchanges (DEXs) utilize blockchain technology to provide a transparent and tamper-proof trading environment. All transactions are recorded on the blockchain, ensuring trust and verifiability.

  • Decentralization: DEXs spread power and control among network participants, reducing the risk of centralized manipulation or shutdown. This enhances security and censorship resistance.

  • Protocol Token Function: The existence of protocol tokens encourages active governance and community participation. Token holders can have a say in platform decisions, fostering a sense of belonging and decentralization.

The fundamental differences of these sustainable decentralized trading platforms have given rise to multiple DeFi innovations, such as unique trading models through vAMMs and liquidity pools, which are different from the traditional LOB model. Therefore, we are focusing on the innovation potential in these three areas:

Going forward, we expect to continue innovating in a permanent DEX environment. We are eager to see how each protocol addresses these three pillars to further shape the future of permanent DEX.

Original link


DeFi
DEX
Welcome to Join Odaily Official Community