<100 subscribers
This article dissects the algorithmic differences in the core mechanisms of perpetual contracts among the three major platforms and delves into the underlying financial philosophies and risk transmission mechanisms.
The asset sedimentation scale of CEX is a hundred times that of DEX, and the trading volume is ten times that of DEX. How does Hyperliquid ensure that it is not led by the nose by Binance? Is it the decentralized structure? Is it the algorithm?
When we talk about a "decentralized" exchange, what do we mean? Which parts really need to be "decentralized"? Assets? Matching? Price? Liquidation?
Introduction: A Contract Storm Unveils the Debate Between Centralization and Decentralization
In March 2025, the JELLYJELLY contract on Hyperliquid triggered a market turmoil.
Within just a few hours, the price of the contract surged by 429%, nearly triggering a large-scale liquidation. If liquidated, the short positions would be thrown into the on-chain liquidity treasury HLP, causing tens of millions of dollars in floating losses. With the on-chain positions on the brink of collapse, the community was in an uproar. Meanwhile, Binance rarely launched the perpetual contract trading of JELLYJELLY "overnight".... It seemed that it was about to be blown up by the joint efforts of CEX......
Ultimately, at the very moment before the nuclear bomb was about to be detonated, Hyperliquid validators urgently voted to intervene, forcibly delisted, liquidated, and froze trading, casting a big question mark over "decentralized" exchanges for a while?
This incident not only became a focal point of endless debate in the crypto community but also exposed a core issue:
On a decentralized trading platform, what determines the price? Who really bears the risk? Is the algorithm really neutral?
This article will take the JELLYJELLY incident as a starting point to dissect the algorithmic differences among the three major platforms in the core mechanism of perpetual contracts - index price, mark price, and funding rate - and delve into their underlying financial philosophies and risk transmission mechanisms. You will see how different algorithms shape different trading styles, serve different types of traders, and determine whether you can emerge unscathed from the storm.
This is not only a technical dissection of contracts but also a philosophical contest in the design of market order.
I. Overview of Perpetual Contract Trading
Before diving into the main topic, let's clarify the three key components of perpetual contract trading:
Index Price: It tracks the changes in the spot market price and serves as the "theoretical anchor." Hyperliquid refers to this as the Oracle price.
Mark Price: This is the decisive price used to calculate unrealized profits and losses, liquidations, and other key events.
Funding Rate: It is the economic mechanism that connects the spot and contract worlds, guiding the contract price back to the spot price.
For more detailed background information, please refer to: <https://x.com/agintender/status/1937104613540593742> (Note: Due to network issues, the parsing of this webpage was unsuccessful. If you need the content of this webpage, please check the validity of the link and try again.)
Here is an overview of the algorithms for index price, mark price, and funding rate used by the three platforms:
CEX vs. DEX Contract Algorithm Battle: Hyperliquid, Binance, and OKX
If you really can't bear to read so much text, just remember this:
Whoever controls the Mark price holds the power of life and death over the contract. Therefore, the "decentralized" core of Hyperliquid lies in how to ensure that the Mark price cannot be manipulated and can be verified.
Hyperliquid has made some optimizations based on Binance's algorithm to allow prices to quickly return to market levels in extreme market conditions and when trading on the Hyperliquid platform is manipulated.
Hyperliquid has really gone to great lengths to avoid outliers (price spikes).
II. The Devil Is in the Details
This is the dividing line between casual and in-depth discussions. Please prepare a kettle of water to prevent choking. Otherwise, it is recommended to skip directly to the next section.
A. Comparison of Index Price (Oracle Price)
Hyperliquid refers to its index price as the Oracle price, which is completely independent of its own market and constructed by validator nodes. It uses the weighted median method to counteract extreme price fluctuations, making it more resistant to manipulation (price spikes), but the update frequency is relatively slow (once every 3 seconds). In layman's terms, this is to eliminate outliers and smooth out price fluctuations. The so-called "slow" update frequency here is also a smoothing mechanism and is not necessarily a bad thing. To add, due to the time difference characteristic, Hyperliquid also attracts many smart scientists.
B. Differences in Mark Price Mechanisms and Algorithm Details
Binance's mark price algorithm is based on two principles: "price smoothness" and "market depth reflection." Its formula is based on the median of three types of prices: the bid/ask midpoint of the contract market, the transaction price, and the impact bid/ask price. The impact price reflects the real cost of liquidity by simulating the impact of large market orders on the order book, avoiding being misled by "pseudo prices" of shallow order books. Combined with the EMA-processed median construction, Binance's mark price changes smoothly and is resistant to price spikes, making it suitable for large funds to stabilize their layouts and implement arbitrage strategies.
OKX takes a more "aggressive" approach, using only the bid/ask midpoint in the order book as the source of the mark price. This algorithm does not refer to the transaction price nor consider the depth of the order book, so the price is extremely sensitive to small trades and can cause violent fluctuations due to large orders eating through the order book. Although more volatile, the price returns to the spot price faster, making it more suitable for high-frequency traders, price spike gamblers, and short-term operators.
Hyperliquid's mark price structure is a combination of Binance and OKX. In terms of data source form, it can be said to have a "decentralized characteristic" because it is controlled by several nodes. The nodes integrate three price sources to calculate the mark price: the 150-second exponential moving average (EMA) of the difference between the Oracle price and the contract midprice; the median of the bid, ask, and last transaction prices of the Hyperliquid platform itself; and the weighted median of the perpetual midprice of several CEXs (Binance, OKX, Bybit, Mexc, Gate, etc., with weights of 3, 2, 2, 1, 1 respectively).
If any two of these sources fail, the system will supplement a median processed by a 30-second EMA as an alternative.
The responsibility of the on-chain validators is not only to update the Oracle and Mark Price regularly but also to verify the integrity of the input sources, timestamps, and deviation tolerance ranges. This mechanism forms a certain degree of "algorithmic democracy" on Hyperliquid, where even the platform and validators cannot forcibly modify the logic of the mark price, greatly enhancing the resistance to manipulation.
Given that the mark price is the "sole criterion" for determining whether a position is profitable/liquidated/cleared, "protecting" the mark price becomes the most important thing.
The "decentralized" core of Hyperliquid is to tell everyone that I cannot change the Mark Price to snipe your position, rather than something like on-chain matching or decentralized accounts...
C. Funding Rate Algorithm and Market Behavior Feedback Mechanism
The funding rate, as the key economic lever connecting the spot and contract markets in perpetual contracts, directly affects the degree of deviation between the contract price and the spot price and guides the market to self-correct. The three major platforms have shown completely different technical paths and trading philosophies in the algorithm design of the funding rate.
In terms of the funding rate algorithm, Hyperliquid has introduced a premium index (very similar to Bybit and Bitget) on the basis of Binance's impact price (order book depth) and loan interest rate model, replacing the Oracle price in the calculation to be closer to the real market situation (Bybit and Bitget both use the index price). After all, under the same depth conditions, the significance of an order book depth with a price of 1u is different from that with a price of 3u or 0.5u.
The premium index will sample every 5 seconds and calculate based on the hourly average (sampling 720 times per hour) to prevent short-term violent fluctuations (price spikes). The lending interest rate is fixed at 0.01%.
What problems or limitations does this algorithm have? Yes, it takes a relatively long time to "return" when the contract price deviates from the spot price. (Similar to Binance)
To make up for this shortcoming (Hyper does not have Binance's huge capital sedimentation and arbitrage, and the price is unlikely to return in a short time), here are three features unique to Hyperliquid: