An overview of the on-chain margin trading exchanges
Research and Market Insights
Mar 27, 2023
Ever since FTX went bankrupt, the crypto investors once again realized the importance of decentralization for seeking the security of their assets. With the strong demand for leveraged trading, on-chain margin trading exchanges have become an alternative option for the traders. The current daily trading volume of on-chain margin trading exchanges has exceeded $200 million, with nearly $1 billion deposited in these exchanges. This piece will cover the mechanisms and development of 3 representative on-chain margin trading exchanges.
GMX:Margin Trading Explorer
GMX is an on-chain margin trading exchange built on Arbitrum and Avalanche. Unlike the old fashioned derivatives exchange DYDX, GMX adopts a new peer-to-pool model instead of the order book model. The underlying market-making asset pool is composed of LPs (liquidity providers) and serves as counterparties to the traders. This exchange supports margin trading for four tokens including BTC, ETH, UNI, and LINK, with leverage ratios of up to 50x. Nine assets, including BTC and ETH, can be used as collateral for trading.
Under the peer-to-pool model, the price of margin trading on the exchange comes from an oracle feed (with reference to that of Binance, Coinbase, and Bitfinex), and the trader’s trading and position are both synthetically simulated. Therefore, GMX’s biggest advantage over order book exchanges is “zero slippage”. For example, the trading experience of a $10,000 position and a $1 million position on GMX is the same, without the problem of slippage and price liquidity impact, which is especially beneficial to whales. When a trader opens a position, the corresponding leveraged assets will be locked in the GLP pool. For example (as shown in Figure 1), when a trader goes long on ETH with a 5x leverage, 4 ETH will be locked in the GLP pool. Obviously the opening position that traders in GMX can take will be limited by the amount of the corresponding assets in the GLP pool. LP holders stand on the opposite side of traders throughout the process. When traders make money, LPs lose money, and vice versa.
GMX Mechanism(F1)
GLP Counterparty Mechanism(F2)
GMX has a dual token mechanism. GLP is the utility token of the exchange, with an unlimited total supply. It is also the LP token of the asset pool. Currently, about 51% of the pool is stablecoins, while the rest are BTC, ETH, UNI, and LINK. Users can mint GLP tokens with eight assets including BTC on the GMX website and can also burn GLP to redeem these eight assets. During this process, the exchange will charge transaction fees in order to adjust the actual asset composition of the GLP to the target (the exchange sets the target asset composition ratio based on the open interest of each asset position). The income of GLP holders is mainly composed of : (1) the price fluctuations of the assets in the GLP pool, (2) 70% of the exchange’s transaction fee income (paid in ETH/AVAX), and (3) the profit and loss of GMX traders.
GLP Asset Composition(F3,Source:https://app.gmx.io/#/dashboard)
As the governance token of the protocol, GMX has a maximum supply of 13.25 million. GMX stakers will receive three rewards: (1) Escrowed GMX, which is locked and linearly released in 365 days. It requires depositing the original amount of assets earned to activate linear release; (2) Multiplier Points; and (3) 30% of the exchange’s transaction fee income. The exchange introduced Escrowed GMX and Multiplier Points to reduce GMX selling pressure and attract funds for staking. Multiplier Points are points that can be obtained by staking GMX with 100% APY. Each point is equivalent to GMX in usage and can achieve 30% of the exchange’s transaction fee. However, once GMX is unstaked, the points will also be burned.
GMX uses an internal centralized price feed mechanism (which has been criticized by the market). Price Keeper is a program controlled and signed by an address owned by the GMX team, which runs on GMX servers. Keeper refers to the prices of three mainstream centralized exchanges. When the price difference between Keeper’s price feed and the Chainlink price is within the threshold, It will use Keeper’s price as trading price. However, when the price difference exceeds the threshold, a spread will be introduced into the exchange. For example, when the threshold is 2.5%, the price is 100 on Chainlink and 103 on Keeper, the trading price will be 100-103. This means that when opening a long position, the execution price will be 103, and when opening a short position, the price will be 100.
Throughout the entire GMX mechanism, LPs stand in opposition to traders, with both sides betting against each other. Therefore, the basis of making continuous profits for investors holding GLP is that traders in the market will lose money in the long run. According to the trading data (as shown in Figure 4), this is indeed the case. However, we can still find out that traders may gain sustained profits in some periods of time, especially when the market shows a trending rise. Three profit periods shown in the figure all occurred during market uptrends, which is consistent with empirical judgment. Traders tend to take long positions in a good market condition. Due to position deviation, the GLP pool may temporarily suffer some “losses” in this scenario.
Profit and loss of GMX traders on Arbitrum(F4,Source:https://stats.gmx.io/)
Looking at the performance of GLP, when transaction fees are taken into account, its performance in the bear market is far better than that of being AMM LP in BTC-USDC or ETH-USDC. GLP is more like an index fund, relying on the widespread use of the GMX to further strengthen its performance through transaction fee income,. However, as margin trading exchanges such as GMX were born during this bear market cycle, it remains to be a question that whether such peer-to-pool models can withstand market tests in a prolonged bull market environment.
GLP Performance(F5,Source:https://stats.gmx.io/ )
gTrade:Mechanism Improvement, Rapid Expansion
gTrade is a decentralized margin trading platform built on Polygon and Arbitrum. Based on peer-to-pool model, gTrade has improved its mechanism by replacing a multi-asset pool with a single-asset pool. When a trader opens a position, the corresponding assets in the pool are no longer locked, and LPs deposit DAI into the exchange vault and receive gDAI. Both deposits and withdrawals are based on the gDAI price, which follows the following formula:
gDAI Price Calculation(F6,Source:https://medium.com/gains-network/introducing-gtoken-vaults-ea98f10a49d5)
It can be found that LP mainly benefits from a portion of exchange fee income. Unlike GMX, LP in gTrade does not benefit from the price increase due to the fact that the asset pool only contains DAI. Additionally, LP is currently unable to gain traders‘ losses, which will be temporarily stored as a safety cushion in the treasury to resist significant market fluctuations that may occur in the future. When traders make profit, the amount of DAI in the pool will decrease, resulting in corresponding losses for LP. This creates a risk-reward asymmetry for gTrade LP at the moment.
After using a single-asset pool, the exchange’s tradable assets are no longer limited by the underlying asset pool. gTrade supports 90 assets for trading, including forex, stocks, stock indexes, commodities. (in comparison, GMX only supports four trading assets, all of which are cryptocurrencies). Based on trading data, there is actually a significant demand for trading beyond cryptocurrencies, particularly for forex. On gTrade, the open positions and trading volume of forex are equal to or even higher than those of cryptocurrencies. With a wider range of tradable assets, the exchange’s trading volume has significantly been increased and is catching up with GMX.
GNS protocol’s open positions and trading volume.(F7,Source:https://dune.com/unionepro/Everthing-Gains-Network)
The exchange mainly adjusts the long-short offsets and excessive leverage through the fees such as funding fees and rollover fees. The funding fee is directly related to the open interest difference between long and short positions and the volatility of the trading pair (see Figure 8). The rollover fee is continuously charged for the margin of the positions.
Funding fee Calculation(F8,Source:https://medium.com/gains-network/gtrade-v6-1-in-depth-b06c0b93fad1)
However, the current regulatory mechanisms are not ideal. For three trading pairs listed below, there are significant differences in open interest between long and short. Once the market undergoes a big price movement, it will cause significant fluctuations in the asset pool.
Long and short positions of BTC/USD
Long and short positions of some trading pairs(F9,Source:https://dune.com/unionepro/gains-network-gtrade-stats-of-a-single-pair)
As the governance token of gTrade, the total supply of GNS is limited to 100 million, with a current circulating supply of approximately 30 million. The token is currently in a low inflation phase. GNS staker can achieve a portion of the exchange’s transaction fee. When the collateralization ratio of the exchange vault exceeds 100%, the GNS burning and repurchase mechanism will be launched, using approximately 1% to 3% of traders’ losses to repurchase and burn GNS tokens. When the collateralization ratio falls below 100%, the exchnage may mint GNS to ensure the safety.
Openleverage:Conservative model, trading experience needs improvement
Openleverage is a multi-chain margin trading platform that currently supports BSC, KCC (Kucoin chain), ETH, and Arbitrum. The team members are mainly from well-known investment banks and hedge funds. In addition, the project has been selected for the fourth phase of Binance MVB (Most Valuable Builder) incubation program, and has received strategic investment from Binance Labs, as well as support from top centralized exchanges and VCs.
Investors and partners(F10,Source:https://openleverage.finance/)
The exchange can list a wide range of trading pairs. As long as the token has a liquidity pool on Dex, it can theoretically be margin traded on Openleverage, including small-cap altcoins which are not tradable in many centralized exchanges. This is mainly due to the use of a built-in lending market and external Dex liquidity to achieve margin trading.
Openleverage mechanism(F11,Source:https://docs.openleverage.finance/main/protocol-overview/how-openleverage-work)
The exchange has two types of users, Suppliers and Traders. Each asset in each trading pair has its own separate asset pool. This means that asset pools for the same token but different trading pairs are also independent of each other. Additionally, anyone can create asset pools on Openleverage. For example, the FEI-USDC trading pair, users can separately create FEI and USDC pools, and Suppliers can deposit FEI or USDC into these two pools to earn lending interest and token rewards. Traders can borrow assets from these pools to open positions on Dex. When a Trader wants to take a long position on FEI, they can borrow USDC from the USDC pool to buy FEI on Dex. When they want to short FEI, they borrow FEI and sell it on Dex. When they need to close their position, they repay the loan by buying or selling the corresponding asset on Dex.
As Openleverage uses real positions (unlike GMX and gTrade), traders of the exchange will face several losses during the process due to the liquidity of the assets on Dex. These losses include: (1) Openleverage’s 0-0.22% fee charging; (2) Dex’s 0.1%-0.3% fee charging; (3) loan interest, which depends on the asset utilization rate in the asset pool; (4) Dex’s poor trading depth and high slippage, which is different from GMX and GNS. Additionally, the number of positions that traders can take is limited by the size of the lending pool and Dex liquidity pool. While sacrificing user’s experience, Openleverage achieves security in its mechanism by only building a lending market and borrowing liquidity from external DEXs. In extreme market conditions, apart from the liquidation risk brought by low liquidity slippage, LPs of the exchange will not suffer significant losses due to a big rise of the asset price. This model is usually welcomed by DEXs because it activates their trading activity and brings more transaction fee income to Dex LPs. Currently, Openleverage has been integrated with top DEX such as Pancakeswap and 1inch.
The governance token is OLE, with a total supply of 1 billion. By staking OLE-BUSD LP tokens, users will get xOLE, and holders can receive 30% of the exchange’s transaction fee income, additional OLE rewards, and transaction bonuses for lending and trading.
Summary:
In terms of mechanism, GMX and GNS both adopt a peer-to-pool model but in different ways. GMX sets up a multi-asset pool to match the trading order with the assets in the pool, which could guarantee the settlement of traders’ profits. However, GNS establishes a single-asset pool to largely increase the capital efficiency but expose the LPs’ positions to higher risk. Openleverage, on the other hand, has chosen a more conservative mechanism by only building a segregated lending pool and borrowing liquidity externally, with LPs not taking on the risk of traders’ wins or losses, only earning lending interest. But with a trading experience significantly inferior to the former two, its trading volume and open interest are limited by the underlying lending pool and Dex liquidity, resulting in a slower growth.
The margin trading is always an important part of the cryptocurrency market, according to the data that the daily spot trading volume of BTC on Binance is only half of that of BTC perpetual contracts. Such highly potential and rigid demand brings massive amounts of fees income to the exchanges. From DYDX to GMX, GNS, Openleverage, developers have been trying to achieve better trading experience, higher security and more sustainable growth through different underlying mechanisms in on-chain margin trading exchanges. In the past year, driven by exchange regulations and squeeze events, many funds have begun to migrate to decentralized accounts, and the decentralized margin trading is now absorbing the trading demands from centralized exchanges. It is believed that in the near future, decentralized margin trading will become one of the most important sectors in the DeFi world.