header-langage
简体中文
繁體中文
English
Tiếng Việt
한국어
日本語
ภาษาไทย
Türkçe
Scan to Download the APP

DWF Labs: An Overview of the Ecology and Strategic Analysis of Decentralized Perpetual Contracts.

2023-10-12 15:07
Read this article in 38 Minutes
总结 AI summary
View the summary 收起
Original Title: "Diving Deep into Decentralised Perpetual Futures: An Ecosystem Overview and Strategic Analysis"
Original Author: DWF Labs Research
Original Translation: Kaori, BlockBeats


In the early articles of the "Hindsight" series, we introduced the investment thesis of DWF Ventures 2023, which elaborated on the three main areas of our focus.


· Derivatives Agreement

· Consumer Dapps

· Data and privacy layer in infrastructure


For the first field, derivative agreements cover a wide range of products. This includes various 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 cryptocurrency field - perpetual contracts. Here, we will explore the current state of perpetual contracts, analyze the differences between centralized exchanges (CEX) and decentralized exchanges (DEX), review the evolution of existing DEX perpetual protocols, and discuss the potential development of this field.


永续合约:一种适合加密世界的产品


Perpetual Contract: A Product Suitable for the Cryptocurrency World


For beginners, perpetual contracts or perpetual products, also known as perps, are currently the most popular derivative contracts in the cryptocurrency market. Since being introduced by Bitmex in 2016, perpetual contracts have steadily taken market share from traditional futures contracts.


Currently, perpetual contracts account for an astonishing 97% of total trading volume.



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


· Flexible contract terms: Perpetual contracts offer flexibility, allowing positions to remain open indefinitely or be closed at the discretion of the trader. Fixed expiration dates in traditional futures have practical uses in hedging risks and pricing future production and delivery costs for physical commodities. However, in the field of digital assets such as Bitcoin, these costs are negligible, making term or delivery-based hedging no longer necessary.


· Aligning with spot prices better through funding rates: In the absence of an expiration date, perpetual contracts use funding rates to ensure their prices are closely linked to the spot market. Compared to price fluctuations during the expiration period of futures contracts, this method results in less price volatility.


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


CEX perpetual contracts vs DEX perpetual contracts mismatch


Considering the success of perpetual contracts, people may expect to see this success extend to centralized and decentralized cryptocurrency trading platforms. However, currently there is a severe imbalance in trading volume between DEX and CEX, with DEX accounting for only about 1% of total trading volume.



This significant contrast highlights that, compared to most decentralized venues, centralized trading platforms still have clear advantages in central limit order book (CLOB) and trading processes.


Creating a Decentralized "CEX Experience": Limit Order Book Model


CEX uses the CLOB model for trading, as it is one of the most effective ways to match buyers (takers) and sellers (makers). These limit order books can process up to 100,000 orders per second on CEXs like Binance, with an average delay of only 5 milliseconds. This model allows savvy participants 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, due to the limitations of blockchain such as block finality, speed, and gas fees, replicating the Limit Order Book (LOB) model in DeFi has proven to be challenging. This challenge has led to the emergence of Automated Market Makers (AMMs) as an alternative solution. AMMs allow for permissionless trading of tokens without the need for centralized exchanges or market makers, as liquidity providers (LPs) take on the responsibility of facilitating trades.


However, the inherent AMM algorithm has drawbacks. It often leads to higher slippage, especially for larger trade sizes and during market volatility. This fundamental limitation highlights why market makers are inherently more motivated to participate in the LOB model. The LOB model allows market makers to enter positions at advantageous bid-ask prices, significantly reducing the risk of finding themselves in a losing position. In contrast, liquidity providers (LPs) in AMM primarily rely on user transaction fees as a source of revenue. However, these fee revenues may be temporarily offset when traders are profitable. This makes AMM less attractive to LPs compared to the potential profitability demonstrated by the LOB model.


DYDX: The Pioneer Leading the Decentralized Perpetual Contract Market


Recognizing the market gap, dYdX was the first to introduce the order book model in the decentralized perpetual contract field. As a market pioneer, dYdX has gained the necessary market share and established its position as a top decentralized exchange (DEX) for perpetual contract trading in terms of trading volume. Through the order book (LOB) model, it offers the lowest maker and taker fees among all DEX perpetual contract protocols, which is a key factor in its dominant position. Currently, dYdX operates on a layer 2 (L2) infrastructure provided by StarkEx, achieving higher transaction throughput.



However, due to the inherent limitations of the underlying blockchain, dYdX is not fully decentralized. 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 verifying transactions off-chain, requiring only on-chain verification of STARK proofs. Processing transactions on-chain means that it is processed on Ethereum, which is not efficient because each block update can only support about 12 seconds.


In order to achieve complete decentralization, some have attempted to introduce a fully on-chain order book, but at the cost of running on other chains such as Solana. Zeta and Mango Markets are such protocols that leverage Solana's fast block time (about 0.5 seconds) to provide the best on-chain experience. However, compared to centralized exchanges (CEX), the on-chain order book on Solana still lags 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 may not be a key advantage for users.


Therefore, increasing trading volume and liquidity remains the key to competing with CEX. dYdX is moving towards building its own L1 on Cosmos, using the Tendermint Byzantine Fault Tolerance (BFT) consensus mechanism. In addition to high performance with 1 second block time and up to 1000 transactions per second (TPS), Tendermint BFT also allows for customization of the validator set and their responsibilities. Each validator will ensure that orders and cancellations are always propagated on the network. However, this is not an on-chain operation as it is not committed to consensus. Orders are still matched off-chain, and then each block submits transactions on-chain.


Therefore, this has sparked a debate about the highly centralized risk that dYdX faces, as validators have an incentive to collaborate with market makers to obtain MEV profits from transaction front-running or reordering. In this regard, dYdX is working with Skip Protocol and Chorus One to mitigate bad behavior by validators. The cuts may be used to prevent collusion between market makers and validators, and penalties will be set at a level that discourages validators from taking on additional income risk.


Pushing the boundaries of perpetual decentralized LOB with Hyperliquid


Other protocols are also following suit, creating their own L1 - such as Hyperliquid, which is still in the testing phase. This application chain is manually built by the team and only uses Tendermint for consensus. It is reported to be able to handle up to 20,000 transactions per second (including orders, cancellations, and settlements), which is about 20 times the current capacity of dYdX v3. It utilizes a hybrid of external and internal market makers (HLP LPs) to facilitate greater decentralization, as anyone can provide liquidity. By optimizing the infrastructure and application code, it is able to fully put the order book on the chain. This ensures transparency of orders, unlike in off-chain order books where validators can capture MEV for themselves. In addition, the DAO will be responsible for the utilization of the insurance fund, as opposed to the insurance fund controlled by the dYdX team. Overall, Hyperliquid is more decentralized than dYdX in many aspects of the protocol.


Since the alpha mainnet phase of the protocol began on June 14th, it has completed over $5.6 billion in transaction volume, averaging $47.8 million per day. Although this only represents a small portion of dYdX's trading volume, it is comparable to GMX and exceeds Perpetual Protocol's daily trading volume.



However, the current trading volume and liquidity may be driven by airdrop rumors, and it is unclear whether this level can be maintained without incentives. From the beginning, the protocol may be quite centralized, with most validators being the team, to ensure the smooth operation and normal operating time of the protocol. Gradual decentralization may bring about consensus issues, and dYdX may also face this problem. Overall, the application chain model is still relatively new, and it will be very interesting if the protocol can undergo stress testing during periods of volatility.


Despite this, dYdX remains the clear market leader in the decentralized perpetual contract space, with low fees, deep liquidity, and battle-tested models across different volatility periods. In the aftermath of the FTX crash in November 2022, dYdX saw a 39% increase in user numbers. Since then, dYdX's average monthly trading volume has also been increasing, indicating that they provide a good alternative choice for CEX traders.


Adapting AMM Model for DeFi: Introducing vAMM to Perpetual Contracts


In the DeFi field, AMM (Automated Market Maker) helps solve the problem of high gas fees associated with numerous trading orders. Perpetual Protocol introduces the concept of a virtual Automated Market Maker (vAMM) designed specifically for perpetual contracts, further promoting the development of this field.


How Virtual Automated Market Makers Work: Insights from Perpetual Protocols


In the virtual automated market maker (vAMM) model, liquidity providers (LPs) play a unique role. Unlike in traditional setups where LPs directly hedge against traders, here traders provide liquidity to each other through a collateral repository located outside the vAMM ecosystem. This repository plays a crucial role in generating virtual tokens and facilitating perpetual contract trading.


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


Compared with the order book system, where the open interest levels of short and long positions are equal, the vAMM model allows for freely floating net open interest. To maintain price stability and consistency with the index price, funding rates play a role. These rates serve as incentives for arbitrageurs, encouraging them to participate and drive perpetual prices closer to spot prices.


Perp v1 Challenges


However, due to its persistent long and short imbalance, Perp v1 brought significant risks to the protocol. The protocol had to intervene and pay traders from the insurance pool. In theory, transaction fees should always be greater than the total amount paid to traders to make the protocol model sustainable. Unfortunately, during periods of high volatility and large deviations between the mark price and index price, this model proved to be unsustainable. As the market declined, the overestimation of the "k" value led to an increase in funding rate payments, ultimately depleting the insurance fund. Therefore, Perp v1 was gradually phased out.


Perp v2 Evolution


Perp v2 attempts to mitigate the risks that plagued v1 by utilizing Uni v3 pools as the execution layer for liquidity. While LPs still provide "one-sided liquidity," collateral is converted into two virtual tokens (e.g. USDC collateral generates equal amounts of vUSDC and vETH, which are then deposited into the Uniswap vUSDC-vETH pool) for range orders. This approach ensures that each long order corresponds to a short order assumed by a market maker, and vice versa. As a result, fund transfers are limited to counterparties and do not involve the protocol or traders, as seen in v1. By concentrating liquidity, LPs can achieve higher capital efficiency, while traders can obtain better prices and smaller slippage. However, if an LP's position is not hedged accordingly, they may experience temporary losses in this model.


V2 uses Uniswap v3 TWAP and Chainlink oracle to determine the index price. In theory, as long as the asset has price data sources on any oracle platform, it can be listed without permission. However, there are still risks in listing other assets, and this process is managed by DAO, adding a layer of complexity to the creation of new markets. As the protocol defaults to using cross-margin, users' collateral will automatically be shared between different positions in their accounts. Long-tail assets, due to their inherent volatility and lack of liquidity, will pose significant risks to these portfolios, which presents a major challenge for the protocol to list these assets.


Overall, vAMM provides a good option for traders seeking decentralization and instant liquidity. However, in the Perp v2 model, liquidity providers (LPs) must bear the risk of impermanent loss. They are compensated through higher fees earned in trades, thus passing the cost onto traders. Additionally, vAMM is limited by the amount of liquidity in the pool, which can result in price slippage for larger trades. The model still heavily relies on arbitrageurs to reduce the gap between the mark price and index price, with arbitrageurs incentivized by funding rates. As a result, the top 10 traders on Perp v2 account for an average of 88% of daily trading volume across all currency pairs. Therefore, the protocol is better suited for LPs and arbitrageurs skilled in market operations, as traders can enjoy lower fees and deeper liquidity on other protocols.


Combining Two Advantages: Connecting Order Book and AMM to Achieve Optimal Trading


The experience of Perp v1 and Drift v1 shows that a pure vAMM model is not sustainable in the long run. A similar situation also occurred in Drift v1, which adopted a dynamic vAMM model (dAMM) based on adjusting virtual reserves (k) according to trading demand. However, during the sharp drop in LUNA price, the long and short imbalances escalated rapidly. At the same time, the settlement issue in the smart contract allowed traders to extract a large amount of positive PnL without corresponding negative PnL, resulting in bad debts exceeding the insurance fund. This triggered a bank run scenario, forcing trading and withdrawals to be suspended.


Drift v2: Hybrid Solution


Drift v2 aims to solve the issues with the dAMM model in v1 by introducing a hybrid approach that utilizes both order books and dAMM as liquidity sources. Drift v2 allows trades to be routed through 3 liquidity sources, ensuring efficient matching of large volumes of orders on-chain.


1. Real-time (JIT) liquidity: Market makers fill market orders through Dutch auctions. The auction starts at the market order price and gradually changes. The auction lasts for 5 seconds.


2. Decentralized Limit Order Book: Orders are routed through a Limit Order Book (LOB) managed by keepers and matched with market makers, who earn a certain percentage of fees from the trades.


3. AMM: Even without market makers, this component ensures that users' orders are always filled. It uses funding rates to achieve the goal of neutrality (i.e. if there is a net long position, there is a premium on short positions).



The advantages of hybrid models


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


Combining with the reversal of the traditional order book's market maker-taker sequence (i.e. market makers are "passive" because takers specify their orders before competing with market makers for execution), this enhances competition and incentivizes market makers to quickly execute orders. Compared to traditional LOBs, this method is also more efficient because market makers do not have to actively manage positions (i.e. requote as prices change). Therefore, the incentive is aligned with both counterparties - encouraging market makers to continue providing liquidity because the protocol can reduce takers' toxic liquidity while ensuring takers obtain the best execution price through competition among market makers.



The hybrid model significantly improves liquidity and enhances the trading experience through better pricing and faster execution. On Drift, over half of the trading volume is now completed by market makers rather than dAMMs, indicating the effectiveness of adding an additional layer of liquidity. Having external sources of liquidity also helps balance the inventory skew of AMMs, reducing the likelihood of non-permanent losses faced by LPs and reducing the need for arbitrageurs to intervene. In the near future, there may be more iterative improvements to this model, with protocols such as Vertex and Syndr also building towards a hybrid order book AMM model.


Perpetual Contract DEX's Rise of Liquidity Pool Model


Driven by the growth of protocols such as Synthetix and GMX, the liquidity pool model is becoming increasingly popular in the perpetual contract trading field. Over the past year, we have observed more and more new decentralized trading platforms adopting this model.


GMX's Unique Approach


An example worth noting is GMX. GMX is a decentralized spot and perpetual trading platform built on Arbitrum and Avalanche. Unlike typical AMM models, GMX uses a spot pool model.


GMX v1 has a multi-asset pool and a dynamic aggregated oracle provided by Chainlink to determine the true price of assets. GLP consists of a basket of assets used for trading and leveraged trading, such as BTC, ETH, AVAX, UNI, LINK, and stablecoins. By depositing any indexed asset, GLP tokens can be minted. GMX v2 also introduces a separate GM pool (GMX market pool), allowing liquidity providers to customize their exposure by selecting specific tokens they prefer to support.


GLP is essentially like the "house" in a casino. When a trader takes a long position on ETH, they are gaining exposure to the upward movement of ETH from the GLP pool. When a trader takes a short position on ETH, they are gaining exposure to the upward movement of other assets relative to ETH from the GLP pool.


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


Despite the risk that liquidity providers may lose their capital when traders profit, historical data shows that most liquidity providers actually make profits from hedging against traders. For example, in the following example, it is worth noting that most traders who traded on GMX v1 suffered losses against LPs (liquidity providers).



Synthetix's Revolutionary Role


Synthetix, as a decentralized liquidity layer based on Ethereum and Optimism, has always been at the forefront of this revolution. Synthetix derivatives, facilitated through platforms like Kwenta on Optimism, rely on the liquidity provided by the Synthetix debt pool. The Synthetix debt pool plays a critical role in facilitating synthetic asset and perpetual futures trading. With the help of the Synthetix liquidity pool, as well as Chainlink and Pyth oracles, traditional order books and counterparty demand are eliminated. This approach allows Synthetix liquidity to aggregate and transmit across various markets, effectively solving the problem of slippage.


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



How to distinguish between liquidity pools and vAMM


Against this backdrop, it is crucial to understand the core differences between the liquidity pool model and vAMM. While both methods eliminate traditional intermediaries such as market makers and centralized trading platforms, their mechanisms differ significantly.


In vAMM, the pool only replicates the liquidity depth of AMM. Perp v2 is built on top of Uni v3, and the Perp pool is essentially a Uni v3 pool consisting of virtual tokens minted by the clearinghouse. On the other hand, the liquidity pool model does not replicate liquidity like Perp v2 and GMX, and traders directly trade with the pool liquidity.


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


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


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


Transcending Decentralization: Insights into the Future of Perpetual DEX


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


Although perpetual trading is undoubtedly very suitable for the cryptocurrency trading field, the challenges faced by perpetual DEX go far beyond improving speed, trading volume, and transaction costs. The transition from CEX to DEX is multifaceted and many complex factors must be addressed before users can confidently switch to perpetual DEX.


Key Components for Building Perpetual Contract Trading Platform



Developing a perpetual contract trading platform involves many key components, which are crucial for its successful operation. These components are important for both CEX (centralized exchange) and DEX (decentralized exchange) platforms, but the methods of implementing them differ greatly, driven by the core difference between centralization and decentralization. The following is a breakdown of these necessary components and their importance:


Note: UI/UX is not included in the components because we believe it is a fundamental aspect in evaluating any permanent DEX designed for large-scale adoption.


Decentralized Creativity: Inspiring Sustainable DEX Progress


Although both CEX and DEX platforms aim to provide perpetual contracts, there are significant differences in the underlying technology and decentralization concept, making the implementation of the same goal significantly different. The practicality of blockchain technology, decentralization, and protocol tokens are three key differences that have a significant impact on the operation of DEX compared to CEX:


· Blockchain technology: Decentralized exchange platforms (DEXs) use blockchain technology to provide a transparent and tamper-proof trading environment. All transactions are recorded on the blockchain, ensuring trust and verifiability.


· Decentralization: DEXs distribute power and control among network participants, reducing the risk of centralization 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 express their opinions on platform decisions, cultivate a sense of belonging, and decentralization.


These basic differences among perpetual decentralized trading platforms have given rise to multiple DeFi innovations, such as unique trading models through vAMMs and liquidity pools, which differ from traditional LOB models. Therefore, we are focusing on the innovation potential in these three areas:



Looking to the future, we hope to continue innovating in the permanent DEX environment. We are eager to see how each protocol addresses these three pillars, further shaping the future of permanent DEX.


"Original article link"


Welcome to join the official BlockBeats community:

Telegram Subscription Group: https://t.me/theblockbeats

Telegram Discussion Group: https://t.me/BlockBeats_App

Official Twitter Account: https://twitter.com/BlockBeatsAsia

举报 Correction/Report
This platform has fully integrated the Farcaster protocol. If you have a Farcaster account, you canLogin to comment
Choose Library
Add Library
Cancel
Finish
Add Library
Visible to myself only
Public
Save
Correction/Report
Submit