Perpetual DEX Part 3: Oracle & Orderbook Based Perpetual DEXs

Oracle & Orderbook Based Perpetual DEXs
Perpetual DEX Part 3: Oracle & Orderbook Based Perpetual DEXs
Perpetual DEX Part 3: Oracle & Orderbook Based Perpetual DEXs
Disclaimer: The authors have not purchased or sold any of the relevant tokens including any material non-public information while researching or drafting this report. The contents of each report reflect the personal opinions of the respective authors. Each content is provided for informational purposes only. Nothing contained in this report is investment advice and should not be construed as such.

Table of Contents (Part. 3)

  1. Oracle-based Perpetual DEX: Background
  2. Oracle-based Perpetual DEX: Projects
    2.1. GMX
    2.2. GMX Risk
    2.3. Other Oracle-based Perpetual DEXs
  3. Orderbook-based Perpetual DEX: Background
  4. Orderbook-based Perpetual DEX: Projects
    4.1. dYdX
    4.2. Other methods to realize decentralized Orderbook
    4.3. Orderbook Model Risk

1. Oracle-based Perpetual DEX: Background

The Oracle model is a trading engine that borrows the market price of assets (Oracles) directly from external market leaders and uses it for the trading price. Therefore, it does not need to build its own price discovery mechanism, unlike AMM and order books.

Therefore, the traders will be referred to simply as “Takers” and the liquidity providers (LPs) as “Makers” in terms of the oracle model.

Depending on the strategy of each project team, it may vary, but basically it is taker-friendly as it allows you to trade the oracle price without market impact. The only thing traders need to be aware of is the time lag between the time the order is placed and the time the block is generated, which results in the only slippage that occurs from this time difference.

Meaning that while the taker has an advantage over other trading engines, it also means that the maker must bear the risk. Therefore, safety measures (e.g. spread, maximum order allowed) are necessary so that the maker cannot take all their assets without market impact. The subject that can exploit through the oracle distortion is the taker, so the maker also takes that risk. Therefore, the protocol must prepare a high required return rate for the position that can be unfavorable for the maker. However, the protocol spending to find the correct price continuously is just the cost of the oracle price feed, so if the protocol can receive a lot of revenue to share, it can easily meet the required return rate.

Therefore, the business is built on the basis of gathering many users (traders) in a trader-friendly manner and achieving a large-scale economy, thereby generating relatively high trading fees to meet the needs of liquidity providers.

As a drawback, theoretically, it cannot be a market leader because it follows the market price created by a third-party market leader. However, this is not a concern at the current stage where CEX accounts for more than 95% of the trading volume. It may not be too late to plan to modify the model after a great migration happens from CEX to DEX.

Additionally, all products depend on oracle, so if there is a problem with oracle, the protocol’s viability may be threatened. Therefore, the presence of a contingency plan for oracle risk is one of the important factors in determining the quality of the protocol.

2. Oracle-based Perpetual DEX: Projects

2.1. GMX

A long-awaited spot & margin decentralized exchange that has carried the expectations of everyone. It offers leverage trading, but realizes leverage through margin trading, which is a way of borrowing liquidity from LP rather than being based on futures contracts. Therefore, strictly speaking, it cannot be called a perpetual DEX, but it cannot be denied that it is leading the current on-chain trading and surpassing GMX, which is pioneering the genre of oracle-based DEX.

Fig. 1. Dapps cumulative revenue in the past 90 days. Data as of 23.01.31 (Source: Token Terminal)

GMX is generating revenue based on recent high trading volume. Currently, with the retail investors being the main market participants in the on-chain environment, the trading experience that is friendly to traders is attracting attention, which is the main factor that causes traders to gather. Additionally, as the actual user’s function, trading volume, has driven growth, it has been able to satisfy rewards for LP incentives by minimizing bootstrapping costs of liquidity.

At the same time, since 2022, the layer 2 ecosystem based on rollups such as Arbitrum has received attention and capital has been injected, and Arbitrum Odyssey has overlapped, making GMX a facilitator that solves the problem of chicken and egg without indiscriminate token issuance.

Even the scale of GMX revenue shown in Fig. 1 corresponds to the gross profit that excludes LP rewards (about 70% of trading fees) from trading fees. On the other hand, in the case of dYdX revenue, the COGS is expensed by token issuance ($DYDX), so this is recorded as revenue without being deducted. Therefore, the amount of trading fees generated itself already shows that GMX is ahead of dYdX.

Fig. 2. GMX Fee Accrual and Revenue (Sourece: Token Terminal)

In other words, the LP reward cost provided by GMX actually solves the liquidity reward by dividing 70% of the actual transaction fees incurred. This is not solved by $GMX issuance and is not short-term speculative liquidity, but rather based on actual transaction fees through a high volume of transactions, which is why it has become a synonymous with the “Sustainable Real Yield” that is frequently mentioned nowadays.

A clear revenue model of transaction fees is attractive to investors because it allows for a clear valuation without processing costs through token issuance. GMX distributes the remaining 30% of revenue directly to governance token stakers, and the value accrual logic is also very clear. Therefore, instead of being a liquidity provider, the low revenue share rate attracts investors who are interested in gaining a continuous increase in future transaction volume based on a limited issuance. This has made $GMX holders into a more diamond-like hand.

Of course, there is a discussion about whether it is appropriate to fully distribute profits like value stocks in the long term. However, in an industry where the success of business expansion and new business development is unclear, giving an option to reinvest or realize profits can be considered as a loyalty to the token holders.

Additionally, if the “Composability” unique to the DeFi industry is utilized to the fullest, there is an opportunity to expand without direct investment in separate businesses. And in fact, GMX’s business is smoothly expanding based on composability. A representative example is the various combinations using GMX’s liquidity provider position, $GLP.

$GLP is a pool token consisting of various assets that allow GMX traders to borrow assets and make leverage trades. They receive transaction fees from the protocol and borrowing fees from traders as a reward for liquidity provision, but there is a tendency for the position to be ambiguous due to the uncertainty of market beta with changing risk asset ratios as well as high stablecoin ratio.

Fig. 3. $GLP Composition (Sourece: GMX)

A solution has already been presented by other projects. For example, the Delta Neutral Vault established by Rage Trade to accumulate liquidity provides remaining liquidity to GMX, enabling LP to hold $GLP positions, but hedge the beta of $ETH and $BTC. In other words, GMX now is able to provide delta neutral $GLP positions. Of course, if GMX had directly provided the positions, it would have fully taken the liquidity, but it is obvious that they are scratching each other’s back.

There are also cases where the composability provides additional choices for $GLP holders. JonesDAO built a margin leverage position vaults using $GLP as collateral to buy additional $GLP and provide additional yield with higher position beta. Dopex plans to offer options products using $GLP and provide opportunities to earn additional income or hedge the downside risk.

The GLP vaults launched by Rage Trade and JonesDAO reached their deposit limits immediately and, in the case of JonesDAO, the TVL of one GLP bolt is currently higher than the sum of all other bolts’ TVL. This utilization of composability is attracting more liquidity to GMX and external projects such as JonesDAO can onboard existing GMX liquidity providers, so it is an upward trend.

2.2. GMX Risk

1. Margin Trading Model
(1) Borrowing Fee, Not Funding Rate

GMX uses margin trading models for leveraged transactions, so traders pay bowrrowing fees to liquidity providers. The settlement price, the oracle price is based on the spot price and both long and short positions have positive rates, which indicates the demand of short positions may be lower compared to futures contracts. Due to the nature of leverage contracts, there should be a high demand for short positions, but without providing funding rate or spot-futures arbitrage, the market share may be taken over by other perpetual DEXs.

Therefore, there is a concern that a long-short imbalance may occur, and if the liquidity only for long positions continues to deteriorate, it may cause difficulties in determining the spot transaction fee for maintaining Utilization Ratio and ideal token weights .

However, considering the retail-friendly nature of the zero-slippage and unleveraged real liquidity (low capital efficiency) model, it may not be a big issue as it plays a different role than an exchange for institutions. This is even more so when considering the fact that institutional liquidity and volume will be fed into the orderbook with the status quo bias.

(2) Limited Asset Onboarding for Leveraged Trading

GMX leverage is based on pure spot liquidity, so in order to onboard new trading assets, the liquidity pool must have the corresponding asset added. Therefore, the expansion of trading assets is limited and it is more difficult to support leveraged trading of long-tailed assets. Of course, the oracle model itself is exposed to the risk of liquidity theft through Oracle manipulation, so the available assets are limited.

2. Oracle

GMX uses its own off-chain oracle that directly retrieves price information from exchanges with high trading volumes and receives support from Chainlink. Therefore, it is not clear how the oracle infrastructure is constructed and how it calculates. Of course, in some cases, relying on external oracles itself can pose risks, but users must trust the GMX Oracle because it is centralized, which poses a challenge.

2.3. Other Oracle-based Perpetual DEXs

Several perpetual DEXs based on oracles have emerged to solve the limitations of GMX’s margin trading model. The representatives are gTrade (Gains Network) and Uniwhale that is currently running the testnet.

This model does not take on actual real liquidity but instead, traders and liquidity providers trade just P&L in stablecoins when positions are closed based on the method of futures contracts. As a result, it can introduce the funding rate format used in traditional perpetual futures markets instead of borrowing fees.

The liquidity provision is composed of 100% stablecoin. If the trader generates a profit, the liquidity pool will decrease by the same amount of profit, and if the trader generates a loss, the pool will increase accordingly, which is the same as GMX. As a result, liquidity providers will clearly take on a beta-neutral market maker position that passively takes the opposite position of traders. The environment that all participants in the crypto market have a high risk profile will not be valid forever, so there will certainly be demand for positions that provide passive alpha while satisfying the need for delta neutral. Additionally, the position can also receive trading fees.

And there is no need to source liquidity of underlying assets, so there is also an advantage that there are various assets that can be invested relatively easily.

Unlike GMX that continues to implement zero-slippage as an identity, it seems that they want to reflect virtual market impact by imposing spread through the protocol’s own calculation formula. This is disadvantageous to traders but favorable to makers and contributes to the liquidity and safety of the protocol.

Fig. 4. Spread formula to apply virtual market impacts (Source: Gains Network Medium)

With a fixed spread per traded asset, the variable spread is added through a function of the platform’s OI and the liquidity depth of market leaders (e.g. Binance). The intention is to minimize potential adverse effects on the protocol that can be caused by exploiting oracles and market impacts, by preparing a safety mechanism that can protect the liquidity provided.

Unlike GMX which provides leveraged trading with physical borrowing limit in the pool, gTrade and Uniwhale only exchange P&L, so there is greater freedom for the nominal total amount of the position against the liquidity provided. Requiring safety measures such as spreads is to secure high capital efficiency. Although GMX is a project that targets the concept of virtual liquidity and decides to use only real liquidity, the challenge for capital efficiency continues.

An additional differentiation against GMX is that they publicly use third-party decentralized oracle services. gTrade uses Chainlink while Uniwhale seeks to further aggregate data from various oracle sources such as Pyth network and Chainlink to complement the risk of single point of failure.

Fig. 5. GMX, gTrade, Uniwhale Model Comparisions (Source: Uniwhale Medium)

It remains to be seen if several oracle-based perpetual DEX that appeared with various differentiators against GMX will receive enough adoption from on-chain market participants. GMX has already established itself as a leader in leverage trading platforms, so it will need to have some incentive to surpass GMX that doesn’t even charge spreads and to secure market share.

Oracle-Perpetual based DEXs can take advantage of GMX’s limitations in capital efficiency. GMX secures high liquidity through $GLP and various composable derivatives, but it is still limited by its inability to handle large-scale trades through high leverage due to its spot settled liquidity borrowing model.

As of January 25, 2023, the utilization ratio of $ETH, which is the current representative trading asset of GMX, is 78.7%, and only $25m of the $ETH that can be borrowed with $121m worth of $ETH entire pool is available. This may not be acceptable to even some whales traders, let alone the optimal platform for retail traders.

On the other hand, gTrade and Uniswap, which settle P&L based on perpetual contracts, have high capital efficiency because they can make market-making possible by exceeding the supplied liquidity. Although spreads are imposed, high capital efficiency and beta-neutral market making positions, which is a low barrier to entry for LP, will allow them for better capacity to target whale traders.

3. Orderbook-based Perpetual DEX: Background

Orderbook, a familiar trading engine, has established itself as the preferred model for both retail and institutional customers without the need for elaborate explanation, unlike AMM and oracle-based exchanges.

Essentially, the orderbook platform offers only the book and is based on a brokerage model that facilitates the meeting between takers and makers. Makers, who are liquidity providers, are required to have an active market making and hedging strategy, making it difficult for retail individuals to participate in liquidity provision. However, this means that alpha is given to institutional and professional market makers, thereby providing abundant liquidity in the on-chain market.

However, implementing the deep-rooted trading engine, Orderbook, on-chain was not easy. IDEX and EtherDelta, which were early on-chain orderbook-based exchanges that appeared even before Uniswap, encountered highly inconvenient trading experiences due to the orderbook update cycle being limited to the Ethereum block generation cycle. In addition, the cost of gas fees for submitting or cancelling every orders, ultimately resulted in CEX traders and market makers not being able to adopt them.

Ultimately, the orderbook trading system was considered a model not suitable for the on-chain, and Uniswap, which introduced AMM, began to receive attention with its airdrop, and has maintained its position as the on-chain trading standard to date.

However, the treasure of orderbook, which can offer familiarity and low barriers to entry to on-chain users who have long desired orderbook trading, and even meet the alpha market making demand of existing professional traders, has been continuously developed.

The first solution proposed to realize orderbook on the on-chain was the off-chain orderbook. Centralized entities resolve the updating of the orderbook and the matching of the taker/maker orders off-chain like AWS without being affected by block creation time, and only record the transaction and settle the P&L on the blockchain. This is essentially a trade-off, not a solution.

This trade-off can bring critical threats to the identity as a decentralized exchange. One of the advantages DEXs have over centralized exchanges is the elimination of intermediary risk, which has to be given up. There are different types of intermediary risks caused by information asymmetry, but the problem with centralized off-chain order books is that you cannot know what is happening in the order book. It is impossible to determine if the liquidity in the order book is true liquidity based on market principles or false liquidity, and if front running by a centralized entity is occurring. You are faced with the challenge of having to “trust” the platform. Furthermore, the less decentralized it is, the more concern there should be about censorship resistance.

Thankfully, the nature of non-custodial and permissionless transactions can solve the problems of agency risk and the unbanked, and intermediaries’ costs can also be eliminated, so the model is significant. Therefore, if the realization of the final task, “decentralized or on-chain order book,” can be achieved through technological progress, the order book model can soon rise to the status of a candidate for the end game of decentralized exchanges.

In the case of the newly born AMM model, optimized for the on-chain environment, anyone can create a pool for trading and easily participate in market making, making bootstrapping easy, and there is a philosophy that all market participants make the market from an equal position. However, due to the characteristic of x * y = K, it was difficult to satisfy scaling for large transactions, but attempts to upgrade capital efficiency, such as concentrated liquidity or virtual liquidity, are ongoing and developing. On the other hand, in the case of the orderbook model, the entity responsible for the role of market maker is clearly differentiated, but it is already developing in the direction of adapting to on-chain as an engine that has been verified in the stock market and centralized crypto exchanges.

They are developing from different starting points, but the direction is the same, with the goal of becoming an end game of DEX. It remains to be seen which model will be the leader in driving the on-chain market price.

4. Orderbook-based Perpetual DEX: Projects

4.1. dYdX

dYdX is a decentralized, non-custodial, perpetual trading exchange based on the orderbook that has been the top volume in the market since its launch. Especially this project introduced the orderbook perp DEX through the off-chain solution. It has received attention as one of the exchanges that provides the smoothest trading experience by securing high liquidity through aggressive trade mining.

dYdX launched its mainnet at a time when the significance of decentralized, non-custodial perpetual contracts was not yet clear, so it had to offer aggressive mining rewards to bring in traders and market makers from CEX. Efforts were made to increase the utility of the governance token by offering discounted trading fees and strengthened referral rewards. However, due to high liquidity requirements or for some reasons, dYdX continued to issue tokens exceeding the project’s revenue, leading to a decline and unable to defend against strong selling pressure, and still remains an example of a unsustainable model.

Fig. 6. dYdX does not distribute fee accrual to token holders and does continuously issue tokens exceeding the project’s revenue (Source: Token Terminal)

Therefore, dYdX plans to launch dYdX V4 in the 2nd quarter of 2023 to solve the current problems of centralized orderbooks and token economics. The main goal of V4 is to move to Cosmos and launch its own app-chain, solving both problems related to orderbooks and tokens at once.

By moving to Cosmos (1) the off-chain decentralized orderbook managed by the validator network can be made, allowing for fast ordering and matching while eliminating the disadvantage of centralization. Additionally (2) the previously issued dYdX governance token can take on the role of a Layer 1 native token, providing a solution for utility and selling pressure that was lacking when used in its own POS consensus mechanism.

And the trend of realizing a decentralized derivative exchange based on an orderbook through app-chain is not limited to dYdX.

In the case of the Injective Protocol, the app chain orderbook was launched on the “Injective Chain” based on Cosmos at the time of the mainnet launch in November 2021. Currently, as the Dapp ecosystem of the Injective Chain expands, the app chain orderbook is operating under the name Helix.

In addition, both Vega Protocol, which has been developing an all-in-one app chain exchange for physical & derivatives for a long period, and Sei Network, which is currently receiving a lot of expectations, are all Cosmos-based app chain orderbooks.

The way each protocol realizes decentralized or on-chain orderbook is of course different, but in general, order processing in orderbook requires higher computing power than AMM and especially in the case of market making, it requires high scalability, so the intention of occupying all resources in an independent app chain is a superb choice.

Even with the perpetual characteristics where settlement is only based on P&L using a single collateral asset (Stablecoin), there is no need to worry about the fragmentation of liquidity and bridging of spot assets, avoiding the Uniswap-Unichain dilemma.

Lastly, while the DeFi app chains may have to give up one of its strong advantages, “Atomic composability,” the orderbook perp DEX does not compromise much. Unlike AMMs and Oracle engines, the assets deposited in the orderbook DEX are only used for a minimum of stablecoins as collateral and project tokens for supplemental benefits such as fee discounts.

The risk of using position collateral in money markets, as seen in the recent exploit in Mango market, is still unverified. Therefore, if the benefits offered by the app chain model are greater than the benefits of composability like Dopex’s option vaults with $2CRV as collateral, it would be reasonable to adopt the app chain.

Hence, there seems to be no reason to miss the app chain as it can realize a decentralized orderbook without such trade-off and take advantage of the strong utility of governance tokens.

4.2. Other methods to realize decentralized Orderbook

The approach to realizing an on-chain order book is to record all order book activities on a highly computationally powerful and scalable chain, rather than solving the centralization problem through the app chain model. This can be seen as a straight way to solve the problem that IDEX and EtherDelta faced in the past.

Unfortunately, there is no platform yet that has released a mainnet for a fully on-chain order book. Currently, there are projects that present related roadmaps, such as (1) ZigZag, which plans to incorporate zkSync 2.0, (2) Clober, which intends to implement an on-chain order matching system using LOBSTER, and (3) ZKEX, which aims to build a multi-chain decentralized order matching system that encompasses zkLink, Starkware, and zkSync.

4.3. Orderbook Model Risk

The orderbook engine has already been validated in stock markets and centralized crypto exchanges, and is currently evolving in the direction of applying it to the on-chain environment. This also means that orderbook-based DEX must compete with CEX in their most fundamental form.

AMM and oracle models are newly created models specifically for the on-chain environment, with unique characteristics such as the growth engine of composability and a system that is easily accessible for permissionless onboarding. However, orderbook model does not seem to have much composability in the on-chain environment, and the challenge of onboarding new trading assets requires engaging with professional market makers, which is the same as with CEXs.

Therefore, until the fundamental value of “decentralized non-custodial perpetual contracts” is recognized by the public, it will be necessary to secure fundamental competitiveness in terms of fees, liquidity, and UI/UX compared to CEXs.

Currently, the competitiveness of fees in on-chain exchanges, especially in perpetual markets, is significantly lagging behind CEXs in general. Of course, as a later entrant in the same orderbook exchange, one needed a differentiating factor due to the lack of liquidity and trade volume, and in the case of dYdX, it took a strategy of trade mining instead of simply reducing fees and getting through J-curve.

For a long period, token issuance amount was greater than protocol revenue (Fee accrual), so existing dYdX token holders suffered losses, but the trade mining idea itself does not seem to be bad. And by expanding the concept of trade mining to give users a sense of ownership in the platform, it is necessary to clearly communicate the relationship that both order book takers and makers contribute to the growth and value capture of the platform through efforts and token economies.


Decentralized futures contracts are tools for achieving risk-free transactions in derivative markets without the need for a trusted intermediary. They allow anyone to have and store their own assets in a non-custodial wallet.

Currently, there are three main categories of perpetual DEX, based on the pricing discovery model, each with its own advantages.

The AMM model is based on the principle of permissionless and allows for on-boarding of assets. Anyone can easily become a liquidity provider, making bootstrapping the easiest. AMM can theoretically handle the largest number of trading assets, including long-tail assets. AMM is already established as a standard for on-chain spot trading, and its compatibility with various DeFi protocols is expected in the future, making it a measure of future growth.

The Oracle model can easily build a platform that mediates the contract between takers and makers without the additional cost of price discovery, presenting an innovation that provides a trader-friendly trading experience while also securing adequate rewards for makers. The growth prospects in the future will depend on whether the model can have adequate liquidity and capital efficiency that can be tapped into, not only by retail but also institutional players.

The Orderbook model already has the potential to onboard existing traders and market makers to an on-chain trading engine as it is a proven system that has been validated over a long period of time. By refining its implementation on the on-chain, the orderbook model can easily onboard huge sizes of existing traders and market makers. The orderbook model can become one of the most representative successful cases of the app-chain and if technological developments such as scalability allow for full decentralization, it can bring the orderbook closer to being the endgame for on-chain futures exchanges.

It is not easy to predict who will become the winner in advance. Also, it is not certain that only one model will survive. For example, AMM may handle long-tail assets, the Oracle model may become a heaven for retail traders, and Orderbook may offer a platform for both traditional orderbook traders and professional market makers. Anyway, it should be worth paying attention to the next era of perpetual DEX that is the leader of on-chain derivatives sector, which is still a frontier market not only in terms of market share but also the size of the market pie itself.

About the author
Earl Cho

Earl Cho

Senior Consultant at DeSpread

DeSpread Research

Meet our people's insight, our capabilities, our research, and the ever-changing face of our firm.

DeSpread Research

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to DeSpread Research.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.