Original source:Bytetrade LabOriginal source:
Original title: "Innovations of On-Chain Perpetual Protocols Part 1"
Original compilation: Qianwen, ChainCatcher
Original compilation: Qianwen, ChainCatcher
The aftermath of the FTX thunderstorm incident is not over, and decentralization and transparency are getting more and more attention. The migration of trading activity from CeFi to DeFi is not a question of "if", but a question of "when".
Over the past few months, perpetual contract protocols like GMX have received a lot of attention. On top of the unique design of GMX, an independent ecosystem has been developed.
Quick Facts
GMX operates entirely on-chain and uses AMM functionality to enable leveraged trading.
On GMX, traders fully understand the situation of the counterparty, which is completely different from trading on CEX
GMX differs from other perpetual contract protocols such as dydx in that it operates entirely on-chain and uses AMM functionality to enable leveraged trading.
The GLP pool consists of 50% stablecoins and 50% blue chip assets ($ETH, $BTC, $UNI and $LINK). GMX offers traders 4 token/USD trading pairs using the GLP pool.
GMX operates a dual token model: $GLP and $GMX.
$GLP is the LP’s “proof of liquidity” receipt, while $GMX is the protocol’s utility and governance token.
Trading on GMX is a zero-sum game:
If traders win, LPs lose. If traders lose, LPs win.
Key benefits of GMX:
1. Zero slippage
2. High capital efficiency
The main challenges of GMX:
1. Trading bias faced by LPs
2. Unable to balance Open Interest (OI)
3. Oracle manipulation
GMX
4. Lack of trading pairs
On GMX, traders fully understand the situation of the counterparty, which is completely different from trading on CEX. GMX differs from other perpetual contract protocols such as dydx in that it operates entirely on-chain and uses AMM functionality to enable leveraged trading.
secondary title
Single Multi-Asset Pool
Compared to other DEXs that operate with a single asset liquidity pool, liquidity providers (LPs) on GMX provide liquidity to a single multi-asset pool.
LPs provide liquidity by minting $GLP. $GLP is an asset that tracks the price movement of an underlying index. $GLP is the LP's "proof of liquidity" receipt.

The $GLP pool on Arbitrum is an index consisting of roughly 50% stablecoins ($USDC, $USDT, $FRAX, $MIM) and 50% blue chip tokens ($ETH, $BTC, $LINK, and $UNI) composition.
The graph above shows that the majority of the $GLP pool consists of USDC, $ETH, and $BTC.
$GLP can:
1. Use any underlying index asset for minting
The assets in the multi-asset pool are used for trading, and traders can take leveraged positions in any direction.
secondary title

30x long ETH example
A trader posts 1 $ETH of collateral and establishes a 30x long $ETH position on GMX. The trader secretly borrows 29 $ETH from the pool, creating a long exposure of 30 $ETH. Depending on the outcome of the transaction, the $GLP pool will be affected differently.
If the trader makes a profit, he withdraws (1+profit) $ETH from the $GLP pool.

The trade result translates into the difference in GMX's Open Interest (OI). The $GLP pool is directly affected by the outcome and direction of trades. Therefore, it is necessary to rebalance the weight of assets within the $GLP pool.
secondary title
GMX rebalances the $GLP pool through 2 methods:

1. $GLP minting/burning fee discount
As mentioned above, LPs are able to mint $GLP with any underlying index asset. Since OI determines the requirements for assets, each asset in the pool has a target weight. Therefore, GMX offers a lower $GLP minting fee and a higher $GLP burning fee, encouraging each asset to move closer to its target weight.
For ease of understanding, use an extreme example to explain the above table:
Take $UNI as an example, it has the largest proportion in the $GLP pool. By minting $GLP with $UNI, LPs can pay minimal minting fees. Conversely, minting $UNI with $GLP, LP will pay the highest minting fee.

2. Transaction fee discount
secondary title
Token Economics
GMX adopts a dual-token model: $GLP and $GMX

$GLP
secondary title
$GLP is the LP's "proof of liquidity" receipt.
To be careful of:
Holding $GLP will expose LPs to price changes in the underlying assets in the $GLP pool.
The yield earned by LPs on $GLP depends on 2 things: 1) Trading volume 2) Trader's losses

Key Benefits of GMX
secondary title
1. Traders on GMX enjoy zero slippage
GMX uses custom oracles to pull prices from 3 CEXs (Binance, Coinbase, and BitFinex) to achieve "zero slippage". FTX was also among the three major CEXs before, but was replaced by Coinbase.
secondary title
2. High capital efficiency

The use of leverage enables GMX to have a very high asset utilization rate, which means higher returns for $GLP LP. During peak periods, GMX's AUM daily usage was close to 300%.

GMX's main challenges
secondary title
1. LPs may face deal skew

In a strongly trending market (bull/bear), a special OI skew can occur. In this case, traders may enter long or short unilaterally.
For example, in a bull market, most traders want to be long. When a trader takes a long position, the asset is "loaned" from the $GLP pool. Referring to the numbers above, in September 2021, the long OI is 97%. In the case of traders earning huge profits, the holdings of assets ($ETH or $BTC) in the $GLP pool may be evacuated.
It should be noted that in September 2021, GMX only has about 100 users. Therefore, transaction skewness is easily affected by larger transactions. As the number of users grows, it will be less likely to affect the overall transaction skewness of the protocol.
Conversely, in a bear market, when traders are heavily shorting the market, the GLP pool will pay out the stablecoin, while the value of other tokens in the index continues to drop. Referring to the numbers above, in November 2022, short OI peaked at 76%.
With most short traders profiting, holders of $GLP will be affected in two ways:
( 1) Loss of stable coins
Prices of underlying assets fell.

With this in mind, it's understandable that bearish skew affects holders of $GLP more than bullish skew.

All told, traders lost nearly $3 million on November 9th.

secondary title
2. Lack of OI balance
The above challenge is exacerbated by the fact that GMX has no internal mechanism for balancing OI.
GMX calculates its funding rate based on the utilization rate of the asset. Funding rates for long and short positions are always positive regardless of concentration (that is, traders always pay a rate whether they are long or short).On CEX, the funding ratefinancing rate

When the funding rate is positive, the price of the perpetual contract is higher than the spot price. Long traders pay funds to short traders. This incentivizes more traders to short the perpetual contract, bringing the perpetual contract price closer to the spot price. vice versa.
secondary title
3. Oracle manipulation
Mispricing/manipulation of oracles during periods of volatility has the potential to lead to "harmful arbitrage".
To solve this problem, GMX uses a custom oracle that retrieves the median price from 3 CEXs (Binance, Coinbase, and BitFinex). Additionally, prices are updated at the beginning of each block - ensuring that every transaction within the same block receives the same updated execution price, helping to prevent front-running.Despite the best efforts of the protocol to maintain this oracle design is still vulnerable toloophole
Influence. In September, GMX was exploited by a trader on Avalanche for approximately $565,000.
To understand this case study, we must understand several factors.
Opening long/short positions on GMX will not affect the price of CEX. This is because GMX is always a price taker, it extracts prices from CEX.
Traders who understand this mechanism perform the following steps. He starts by opening a leveraged long position in $AVAX on GMX. He then pushed up the price on CEX. When the price feed updated on GMX, he closed out his long position, taking a profit of approximately $565,000.
To address this issue, GMX temporarily issued an official cap on open interest on $AVAX. Ideally, no human intervention should be required, as transaction limits should only be limited by assets in the $GLP pool.
secondary title
For traders who are interested in trading tokens, GMX is not a good choice. Currently, both Arbitrum and Avalanche only have 4 USD trading pairs on GMX.
secondary title
About ByteTrade Lab
Headquartered in Singapore, ByteTrade Lab is backed by Heiner International Group (SIG) Asia Venture Capital Fund and a number of other leading institutional investors, including INCE Capital, BAI Capital, Sky 9 Capital and NGC Ventures, in June 2022 4000 million in Series A financing.
ByteTrade is actively building its own Web3 operating system (OS), which is based on the open blockchain-edge node-client (BEC) architecture and is a decentralized version of the original full-stack Internet protocol, which will massively integrate users And decentralized Internet applications are adopted in Web3.0 and finally return data ownership to users.


