Everything you need to know about DeFi derivation.

This article will outline the basics of Perptual Futures, covering various aspects from basic execution (on-chain) to order books / price discovery, Oracle Machine, liquidation, fees, and more.

Written by: Diogenes Casares

Compiled by: AididiaoJP, Foresight News

Since dYdX and GMX launched in April 2020 and 2021 respectively, the usage of DeFi derivatives platforms has grown exponentially. Today, HyperLiquid poses a challenge to centralized exchanges in terms of trading volume and open contract volume. Despite being established later, its Total Value Locked (TVL) has grown 100 times. Currently, the total TVL of derivatives platforms and emerging prediction markets reaches $5.37 billion, with daily trading volume in the hundreds of billions.

However, in-depth analysis of the microstructure of the DeFi market is relatively scarce, such as the synergy principles of liquidity supply mechanisms like GLP and DMM with Perpetual Futures, the differences between DCLOB and (X)LP/ "market maker" model exchanges, varying margin requirements, and interoperability issues. Existing reports are mostly written by non-traders or non-engineers, and the content tends to be superficial.

This article will outline the basics of Perptual Futures, covering various aspects from basic execution (on-chain) to order books / price discovery, Oracle Machine, settlement, fees, and more. Finally, we will discuss the differences between current DEX infrastructure and TradFi.

What are Perpetual Futures?

Perptual Futures allow traders to amplify their asset exposure through leverage. This means that when the BTC price rises by 10%, users could profit by 30% or even more, but if the price drops by 10%, the losses will also be proportionately magnified. For example, with 3x leverage, the gains and losses will be magnified three times.

Specifically, perpetual futures are derivative futures contracts without a fixed expiration date. Unlike most American futures that settle monthly and require physical delivery (such as crude oil), perpetual futures maintain price anchoring through a funding rate mechanism. This mechanism determines whether longs or shorts need to pay interest (calculated based on nominal value, i.e., principal * leverage) based on the premium and discount of the perpetual futures price relative to the underlying asset. When the contract price is above the underlying, shorts will receive the funding rate, and vice versa. The static funding rate for this type of contract generally maintains around an annualized 10.9%. Protocols like @ethena_labs and @ResolvLabs utilize this mechanism for basis trading: shorting in the perpetual market while pledging the underlying asset, thus achieving delta-neutral returns.

(Ethena's Delta Neutral Trading Diagram Explanation) Delta neutral traders and market makers are the main providers of liquidity in the perpetual market

Trading Mechanism and Collateral

Perptual Futures trading primarily uses stablecoins as collateral. Although assets like BTC and ETH can also be used as margin, there are significant differences in the management standards for cross-margining among different platforms (especially in DeFi), and for most traders, the rates for such collateral are usually higher than directly using stablecoins. The subsequent section will explore "Maintenance Margin and Liquidation" in detail.

Although Perptual Futures can amplify returns, high leverage can also easily lead to liquidation. As the most profitable financial product in the crypto space, the competition for Perptual Futures in DeFi is becoming increasingly intense.

Classification Logic of DeFi Perpetual Protocols

The core contradiction of DeFi Perptual Futures protocols focuses on the interrelationship among three main functions: liquidity acquisition, execution efficiency, and latency. Taking @avantisfi as an example, a low-latency trading system may negatively impact the liquidity pool because all transactions within the protocol are betting against the protocol's own liquidity pool. If there is a pricing deviation, professional traders with quick reactions may erode the protocol's profits through "toxic order flow."

Transitioning from B-Booking (where all trades are handled by the protocol) to A-Booking (building the market) model can eliminate systemic risks in liquidity pools, but it cannot guarantee a continuous supply of liquidity. HyperLiquid's HLP has undergone this transformation: initially handling all trades, and gradually introducing market makers to optimize pricing as trading volume increases.

Theoretically, an off-chain order book can provide more efficient and cheaper trading, but if the validators or sorters act maliciously while processing the order flow, it can still lead to execution failures. These issues can be resolved, but the solutions are not perfect and will consume resources.

Liquidity Cold Start Dilemma

Participants in the trading market

First of all, each order differs in terms of expected returns and risks. Traders wish to make directional bets on the underlying asset or the likelihood of a certain event in the prediction market. Market makers hope to make money by completing the cycle of buyers and sellers, collecting fees, and managing positions (i.e., exposure to different assets at a given point in time). Lenders seek to provide leverage in the spot market while taking on minimal risk, that is, being prioritized in the capital structure for repayment.

According to diversified risk preferences, participants can be roughly imagined as three different levels, each with different risk-return ratios. Traders may achieve returns of over 3000% through directional bets, but they can also lose their entire position. Large market makers (if hedged properly) are expected to have an annual return rate in dollars of about double digits, but if risk management is inadequate, they could still incur losses. Lenders in the crypto space are expecting returns higher than U.S. Treasury bonds (currently about 5.3%), approaching junk bond rates (around 7-8%). This leverage will be provided to traders or market makers to support their activities.

In the case of price fluctuations and liquidations, lenders take precedence over market makers and traders, whose positions will be liquidated.

The Real Role of Market Makers: Creating Liquidity vs Acquiring Liquidity

Market makers do not profit by "betting against retail investors." Their core profit model is to complete the buy-sell cycle: for example, buying asset X at $9 and selling it at $10, earning profits through small price differences and quantitative trading. Market makers need to dynamically manage position risks; if hedging fails, they may incur unrealized losses due to asset depreciation.

To incentivize liquidity, exchanges commonly adopt the "Order Book - Market Taker" fee model, charging liquidity extractors to compensate market makers.

Traders essentially need and use market makers, and in most cases, traders are completing the orders set by the market makers. Unlike market makers, traders mainly bet directly on the rise and fall of asset prices and hope for liquidity to open positions, allowing them to use leverage to amplify gains when trades are correct.

For example, if a trader is confident that BTC will rise by 30% and will not drop more than 10%, then using Perptual Futures with 5x leverage could yield a return of 150% (excluding fees / funding rate), while spot trading can only yield 30%. The only difference is that if the trader makes an incorrect judgment, they will face liquidation risk.

As a marketplace platform, DEXs face the classic "chicken and egg" problem: it is difficult to attract traders when there is a lack of market maker liquidity, and market makers who do not have trading volume are reluctant to enter the market. There are usually two solutions:

Liquidity Pool Model: Such as Ostium, early HyperLiquid's HLP, GMX, etc., where the protocol itself acts as the counterparty. However, in the long run, it will form a zero-sum game — the profits of (X)LP will inevitably come from the losses of traders.

Market Maker Agreement: High-cost and dilutive collaboration agreements like those adopted by dYdX and Aevo. Once incentives stop, liquidity may plummet (such as the sharp widening of the basis after dYdX V3 terminated market maker support).

The two main methods to solve the "Which came first, the chicken or the egg" problem first address the liquidity issue. One method tackles the fundamentally profit-driven liquidity provider protocol, while the other effectively attracts users and establishes an inverse correlation between user profits and losses and liquidity provider profits and losses (see Figures 1 and 2). Neither of these models has completely eliminated reliance on the initial models.

Figure 1, HLP Profit and Loss:

Figure 2, Net Profit and Loss of HyperLiquid Traders:

Figure 3, Combination Chart:

The Essential Differences Between Perpetual Futures and Spot

Spot trading can be freely circulated after settlement, but perpetual futures are essentially a continuous obligation relationship. There are significant differences in clearing standards, margin requirements, price formation mechanisms, etc. among various exchanges, and the clearing process is generally internalized, which is completely different from traditional derivatives markets.

In traditional finance, order matching and clearing are separate: exchanges are responsible for matching, while central clearing parties (such as DTCC) manage position health. In contrast, DeFi derivatives platforms typically bundle the two, forming non-standardized contracts that hinder the development of interoperability.

Comparison of Price Discovery Mechanisms

Price discovery is the process through which market participants and exchange mechanisms determine prices. Different exchanges have very different order management methods, which can affect price discovery and subsequent clearing. Some exchanges operate through a "liquidity pool" system, where LPs deposit assets into the pool to bet against traders.

The order book of the exchange is similar to the order matching layer of the exchange, where the price discovery for Perptual Futures takes place, and it is also the place where the buyers and sellers "agree" on the price. The order book is "constructed" by limit orders continuously set by users, market makers, and the clearing engine, with pricing determined by total demand.

AMM is automated, so price discovery is determined based on its pricing model, although an increasing number of systems that obtain liquidity from AMM-based systems allow order books to form around the pricing of AMM.

The order book varies greatly in the way it processes orders and the environment.

  • Order Book (CLOB): Prices are formed through the continuous game of buying and selling limit orders. For example, the off-chain order book of dYdX V4 can exempt Gas fees, but validators may manipulate block sorting.
  • Automated Market Maker (AMM): Just like GMX's GLP pricing through preset curves, its profits come entirely from traders' losses (through fees or liquidations). HyperLiquid innovatively combines the two: allowing limit orders to coexist with AMM quotes, and dynamically adjusting the spread through algorithms.

Related project examples:

CLOB Perpetual Futures Trading Example

Let's say Alice wants to go long BTC with 1,000 USDC with 10x leverage, or a notional position size of $10,000. Bob went long BTC, and Alice paid 5 basis points (0.05%) in taker/platform fees to enter the market at a price of 50,000 USDC / 1 BTC. Note that this does not include the bid-ask spread, as this pricing is not an actual loss. Assuming Alice is using 10x leverage, Alice would actually have to pay 50 basis points (0.5%) slippage (0.05 x 10). This equates to $5, so now Alice's effective margin is $995. Intuitively, if the price drops by 10%, Alice will be liquidated; If the price rises by 10%, Alice will receive a 100% gain of $995 (10% * 10). However, in reality, Alice will be liquidated when the price drops by around 7-8%. This is because the liquidation layer must ensure that Alice can repay Bob's money at any time, otherwise the position will be insolvent and Bob will not be able to make money despite the trade and taking the risk. If the liquidation engine happens to liquidate Alice when her position drops by 10%, it will most likely not be able to recoup the full value of the position, so Bob can still make money. Conversely, the exchange has a maintenance margin, which varies from exchange to exchange itself, but is usually a combination of a base margin of the principal (e.g. 2%) and another multiplier based on leverage, usually in a progressive scale, to prevent bad debts from highly leveraged positions.

In this system, Bob and Alice find each other through CLOB, which simply matches users willing to buy and sell a certain asset. In this case, Bob and Alice can place orders without paying transaction fees, indicating that the orders are made through an off-chain order book, similar to how IntentX and DyDx operate. If Bob and Alice need to adjust their orders on-chain, they will also need to pay Gas fees and compete for block space.

Here, both Bob and Alice's orders have been fulfilled, even though they do not know each other, and they have obligations to each other. To meet these commitments and avoid bad debts/system health issues, the clearing layer has maintenance margin and clearing procedures.

Evolution of the Settlement Mechanism

When the account margin falls below the maintenance threshold, the liquidation engine will close positions at a discounted price. Different platforms handle it differently:

  • dYdX model: Liquidated positions enter the public order book to maximize recovery rate through competition.
  • GLP/HLP Model: Protocol affiliates take over at a fixed discount, sacrificing efficiency for loyal liquidity.

In extreme cases, when the insurance fund is insufficient, it may trigger a socialization of losses, and profitable positions are forcibly reduced to cover the system deficit. Although this practice has gradually been replaced by capital reserves, DeFi platforms still face challenges due to the overlap of liquidity incentives and insurance funds.

Complexity of Cross-Margin Systems

Cross margin can be roughly divided into perpetual cross margin and spot cross margin. Perpetual cross margin means that the unrealized profit and loss (PnL) of different positions can be offset against each other. For example, if the total deposit is $1000 and one of the positions loses $1100 and the other makes a profit of $1200, the two positions can cancel each other out and you will not be liquidated (provided that your maintenance margin is safe). Perpetual cross margin has been widely implemented and used by perpetual platforms. The only major consideration is to adjust based on liquidity to avoid a similar DyDx Yearn attack Manipulating the token price would allow the manipulative trader to withdraw collateral and then sell the spot back to zero, causing losses in the event of a mark price correction and hitting the platform's insurance fund.

The second type of cross margin is spot cross margin. The exchange allows positions to be settled on margin, but not on other assets. The most obvious example of this is Ethena. Ethena uses BTC and ETH/LSD as collateral to short BTC/ETH, effectively creating USDe from these negatively correlated positions, which is very beneficial to the exchange. If someone shorts 1 BTC and has 1 BTC as collateral, then the perpetual contract must be depegged by about 90% or more to potentially incur bad debts as a result of this transaction. At the same time, it is relatively complicated to use spot assets that are different from the settled assets to conduct cross-margin operations on perpetual contract positions, because theoretically, negatively correlated positions (which require payment of funds) are not easy to liquidate, and if there is a large number of withdrawals of settled assets, the health of the exchange may theoretically be affected. Most exchanges use a unified trading account to deal with this problem for larger accounts, allowing for the deposit of non-yield assets and then functionally lending out most of them, making money not only through existing trading fees but also through the floating of those assets, although larger institutions and traders may be able to deposit yield assets as collateral.

In DeFi, the problem of spot cross margin is mainly solved through the UTA model (positions cancel each other out) or the lending model. The lending model is functionally simpler, as it allows borrowing positions to be decoupled from the margin of the perpetual contract, and functionally only creates a lending system that is tightly integrated with a standalone risk engine, rather than directly integrated. For example, in this system, you can provide 1 BTC as collateral for shorting BTC and then borrow USDC as margin for shorting. The exchange system has USDC to meet the demand, but this kind of system is capital inefficient for traders, especially for traders like Ethena who are trying to trade Delta neutral, because the amount borrowed will reduce the funding rate for Ethena short selling.

  • Perptual Cross-Margin: Allows the profit and loss of different positions to offset each other (for example, in a $1000 deposit, a $1100 loss can be balanced with a $1200 profit).
  • Spot Cross Margin: If Ethena uses BTC/ETH as collateral to short similar assets, it needs to handle the settlement asset (such as USDC) redemption risk.

The current DeFi options market is lagging due to high margin requirements and a lack of cross-collateral functionality, with CeFi platforms like Deribit still dominating the field.

Currently, unlike centralized exchanges, there is not much lending support for UTA-style cross-margining. This is despite the fact that USDe/sUSDe's lending positions (which are essentially behind-the-scenes operations) are backed by Delta neutral trading. CME and Deribit operate using a risk matrix, while DeFi protocols have relatively static and non-dynamic margin requirements. This means that options must be fully covered, and most major short-term options can be covered by as little as 50% of the notional value in 99% of cases. If you are a trader at DyDx or HyperLiquid and have made more than 80% annualized gains based on the Delta neutral financing strategy, you will not be able to continue this strategy by borrowing at an interest rate of 10-20%, even if you hold a negatively correlated position and are fully hedged. The clearing layer of an exchange will have to adapt to these issues if it wants to remain competitive.

Aevo Cross-Margining Model

In the Aevo model, there is a centralized participant that will sell your collateral in order to pay for gains and losses, as well as funding rates, using USDC. This situation occurs when the exchange has health risk requirements or positions are liquidated. The system is more efficient because it still settles in USDC but allows positions collateralized with other currencies to be "credited" as USDC in the system. When funding rates and gains and losses must be paid, these positions will be sold to meet the obligations in USDC. This transfers the liability of these positions to Aevo's clearing system.

Drift Collateral Model

Drift's lending product powers the multi-asset cross-collateralization feature of the perpetual contract exchange. All perpetual contract transactions are settled in USDC on Drift. Whenever an asset other than SUDC is used as collateral for a transaction, USDC is automatically borrowed until the transaction is completed. In addition, users can lend and borrow assets on Drift based on their specific use cases, just like they would with other lending protocols. Depositors (lenders) can earn income on their assets. Drift's model allows you to borrow USDC against Solana and other assets (depending on LTV), with the interest rate determined by the interest rate model. Similar to Aave. Since all transactions are still settled in USDC, this leads to deeper liquidity and easier settlement. But this effectively means that there are two potential debtors: the spot lender and the platform, and there is an inherent conflict of interest.

In-depth Discussion of GLP Mechanism

Although the GLP model has become common in crypto derivatives protocols, the mechanisms behind GLP are not fully understood by GMX itself or most market participants.

Unlike the clearing hierarchy of most exchanges that is positioned between users, in the GLP model, the clearing hierarchy and liquidity provision are managed by the exchange through GLP. Essentially, GLP is a capital pool, similar to an AMM. Unlike trades being filled by traders and spreads being set by market makers, trades are filled by GLP, with slippage and most fees attributed to GLP, rather than being attributed to market makers as in the market-making - order-eating model.

In addition to normal fees, traders on GMX also need to pay borrowing costs. This means that under the (X)LP model, users may be forced to pay fees for both long and short positions simultaneously. During periods of high volatility, traders may earn a funding rate of 7% net value, while short sellers may pay 14% net value. Generally, the funding rate remains relatively stable; if you are long and the funding rate is positive, you pay X%, and if it is negative, you receive X%. This allows the protocol to profit from the spread between payments to traders and payments from traders, while GLP does not have to pay such borrowing costs, thereby giving it a fundamental advantage in long-term liquidity provision.

GLP and GMX are severely exploited due to a lack of proper risk management. Dishonest traders like Avi Eisenberg manipulate the spot prices of assets like Avax to alter the vAMM on GMX, thereby closing positions at a huge profit at the expense of GLP and its depositors.

Price Discovery - CLOB and AMM

Price discovery is used to describe the process of asset pricing, and auctions are an example of price discovery. In an auction, the final prices reflect the willingness of the group to purchase at given quantities at given prices. For example, if there are five buyers and three items, where two buyers want to purchase three items at $4, two items at $5, and one item at $6, then the final prices for these three items would be $6, $5, and $5, respectively. This is intuitive. The order book is similar, but it is constantly changing and has no end. People continuously update the prices they are willing to pay for an asset and the returns they expect to gain for relinquishing that asset. Market makers place low-priced buy orders and high-priced sell orders, hoping to earn the spread through user transactions. In this model, market makers and traders are responsible for price discovery, which is the process of price formation.

Automated Market Maker (AMM) replaces the system by creating price curves. Unlike in the past where everyone declared the price they were willing to buy at, AMM orders are functionally "batch" and liquidity is also "batch". There are mainly two modes of AMM: dynamic AMM and non-dynamic AMM. Non-dynamic AMM is typically used for price discovery. Memecoin is primarily launched in the form of non-dynamic price AMM, which usually follows the pricing curve X * Y = K, where the ratio of the two tokens in a standard AMM determines the price, and the quantity of tokens determines the depth.

Dynamic AMM is suitable for assets with high correlation. For example, Curve AMM or Uniswap V3 AMM, where Curve sets the price, while Uniswap V3 allows liquidity providers to choose their own price.

Although people have a broad understanding of the use of AMM in the spot market, they are not very familiar with its use in the derivatives market.

Although people understand at a macro level that systems like GMX's GLP provide liquidity for traders on the platform, they may not realize that the only way GLP profits is by directly harming the interests of users, either through fees or mainly through liquidations. Despite this zero-sum game environment, AMMs can provide extremely deep liquidity in the cryptocurrency derivatives space, especially for emerging projects. HyperLiquid is an interesting and obvious example that successfully integrates these two price discovery systems. Users can still place limit orders on the order book, but it also functions as an automated market maker, allowing buy (long) and sell (short) orders to be placed on the same order book, typically choosing the opposite side of orders on the order book. This automated system is very dynamic and managed by former high-frequency traders.

and charge all liquidation and platform fees. Its function is also equivalent to the platform's insurance fund. Although HLP is a type of AMM, it is different from "dynamic" and non-dynamic AMMs. It is an automated model that can (approximately) adjust based on market fluctuations, adjust spreads according to the volatility of other markets, and use data from other markets to influence market-making decisions, etc. This is a new type of AMM, which stands out among its peers due to its success on HyperLiquid and its closed-source characteristics.

Comparison of DeFi and Traditional Market Structures

Traditional finance has developed a highly specialized hierarchy over 126 years: retail platforms (like Robinhood) → market makers → exchanges (like CME) → clearing institutions (like DTCC). On the other hand, DeFi protocols often attempt to cover multiple levels simultaneously, which is also the reason for inefficiency.

But DeFi has two major advantages:

  • Native: Can quickly launch crypto asset derivatives.
  • Permissionless: Provides access channels for regulated regions (such as the United States and Brazil) and establishes a fair settlement layer across borders.

With technologies like re-staking enhancing the security of infrastructure, DeFi is expected to become the ultimate settlement network for global derivatives.

DEFI-5.33%
View Original
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • Comment
  • Repost
  • Share
Comment
0/400
No comments
Trade Crypto Anywhere Anytime
qrCode
Scan to download Gate App
Community
English
  • 简体中文
  • English
  • Tiếng Việt
  • 繁體中文
  • Español
  • Русский
  • Français (Afrique)
  • Português (Portugal)
  • Bahasa Indonesia
  • 日本語
  • بالعربية
  • Українська
  • Português (Brasil)