X4: Protocol-Controlled Exchange
We briefly mentioned X4 in an earlier update; this post provides the proposal's details.
Automated market makers (AMMs) are one of the most frequently used platforms in DeFi. They provide a means for projects to list and be traded, while allowing users to earn yield by participating as liquidity providers. In addition to these functions, as an AMM is where a lot of activity happens for a project’s token, we believe that it can also be an avenue for projects to innovate and experiment.
Usually, when a pool is created, the pool creator has limited control over the pool’s functions. Adding liquidity takes in tokens and sends liquidity provider (LP) tokens to the depositor; removing liquidity burns LP tokens and sends the pool tokens to the withdrawer; buying and selling adjusts pool ratios after accounting for fees. No additional functionality can be built into this process because the pool is designed to behave in a fixed way.
With X4, we propose to build an AMM that gives pool creators and projects complete control over the functions of their pool. This means that when a pool is created, the creator can specify any custom behavior they would like on adding liquidity, removing liquidity, buying, and selling.
The examples below illustrate some of the applications this new functionality enables.
Dynamic Fees
Usually, AMMs come with fixed fees or a fixed range of choices for fees. By allowing full control of the pool, the following would be possible:
Projects can set fees to any percentage they prefer
Fees can be easily changed without requiring liquidity migration
Different fees can be charged for various actions, e.g., there could be higher fees on selling vs. buying
Fees can be dynamic and adapt based on specified parameters
This control over fees can be applied in multiple ways. For example, when a highly anticipated project is first listed on an AMM, there are usually bots that immediately purchase the tokens once trading begins. After the initial purchase, the bots would gradually sell the tokens to later buyers. By allowing a dynamic fee, projects can choose to set the fee to a higher percentage at listing and program the fee to decrease gradually over the first few hours.
Projects can additionally choose to pay liquidity providers in a single token instead of the usual mix of tokens. For example, with a GMX/USDC pool, liquidity providers receive fees in both GMX and USDC. Having control over the pool allows projects to have the fees be entirely in GMX or in USDC, if they so prefer.
Tokens that have a ‘burn on transfer’ feature could use fee customization to distribute rewards in a stablecoin; e.g., if there were an XYZ/USDC token, there could be a 2% fee on purchases and a 5% fee on sells. All of these fees could be specified to be in USDC and directed to a distribution contract.
It would also be possible to create new types of stable tokens, by having a token pool that increases the fee for selling and distributes this fee to holders and buyers if the moving average price is decreasing, while doing the opposite if the moving average price increases. Liquidity could be incentivized for multiple pools, e.g., XYZ/ETH and XYZ/USDC, which would ensure continued volume through arbitrage and continued fee distributions to incentivize token holding.
Access to all Tokens
Some tokens like GLP cannot be easily traded on an AMM because custom behavior is required for buying / selling the token. Allowing control over the pool enables more tokens to be tradeable. This would reduce the work required for project developers, as the interface for swapping with any other token is already created. Tokens with a floor price or tokens with custom curves would also be pluggable into X4.
Utilizing custom curves makes it possible to create a token that has a very deep amount of liquidity for buying, while setting a tax on selling such that its floor price increases on every buy and sell.
Custom curves would also enable stablecoin protocols to create pools that maintain stability in a way that is tailored to their needs.
Another possibility would be tokens with rewards distributed in a lottery format. For example, there can be a LOTT/USDC pool, where a percentage of each buy / sell goes into a prize pool and a percentage is distributed to token holders. Each buy within a certain window would give the buyer a probability to win the prize pool based on the amount purchased.
Greater Composability
It would be possible to have pools with yield-bearing tokens that get minted upon entering the pool and redeemed when exiting the pool.
Aggregation
One of the challenges of launching a new AMM is bootstrapping the initial liquidity. There would need to be sufficient liquidity in a wide variety of pools in order to attract users and projects to use the AMM. To help with this, X4 should function as an aggregator and route trades not just through X4 but also through GMX swap and other AMMs such as Uniswap. This would allow for deep liquidity on all tokens and a good user experience.
Another obstacle could be the drawbacks of allowing multiple pools with the same pair, as it might be slow to find the best pool to route through. A solution to this could be to have keepers that maintain an updated list of pools and their available liquidity at various depths. This could be a fairer way of routing compared to AMMs that route trades through a fixed set of pairs, as pools that can offer better rates would be automatically considered.
With this form of routing, protocols that allow minting of their own token through some deposit can also be plugged into X4, and trades can be directly routed as a deposit and mint.
Liquidity fragmentation between pools could also be a concern, but should be a manageable one as the pools incentivized or controlled by the protocol are usually the largest source of liquidity and attract the most volume.
GMX Swap
X4 converts the AMM from a place to trade into a platform for projects to build more of their protocol on, or even their entire protocol. This would allow for new types of tokens and protocols to be created, taking advantage of the trading activity that will occur in the pools while being capital efficient by having the main functionalities built into the trading pools. For simple fee customizations, templates can be created and audited for projects to use. Having custom templates to use a constant product formula as the base of the pool, or having pools that utilize the concentrated liquidity option of Uniswap V3, would also be possible.
The platform would provide a service to projects by having a ready-to-use swap interface, liquidity, volume, and fee tracking, as well as integrations with charting and utility providers. It would thereby free developers to focus on other aspects of their protocol.
In relation to GMX, X4 can be branded as GMX Swap. GMX currently has a swap function; this would be an upgrade to it, allowing for more tokens to be traded with better rates. The swap function can also be moved out of the “Trade” page into its own “Swap” page, for ease of use.
A protocol fee can be programmed into the pools, but we propose to set this to zero at the start to allow projects to easily onboard and utilize the platform. There will not be any new token, and GMX will be the governing token of this platform.
Aside from the improvements in swap trading, GMX would also benefit from increased visibility if new or existing projects choose to deploy or create a pool that connects to their contracts. This could increase swap volumes and increase users of the leverage trading platform. It would also be possible to have GMX and GLP be easily selectable as a base pair, increasing the liquidity available for both tokens.
PvP AMM
The PvP AMM is a separate proposal from the Protocol Controlled Exchange above. It is included here as it should be considered as one of the possible things that could be worked on.
There have been quite a few different models used for leverage trading. Some of these models are:
GLP: liquidity providers are required; the pool takes on the PnL of traders
Synthetic platforms: token stakers take on the PnL of traders
vAMM: no liquidity providers required; has an insurance fund to maintain solvency
Each of these models has its own pros and cons, and we believe it is worth continuing to experiment with these different trade-offs in this space.
We propose building a PvP AMM that matches traders against each other while optionally allowing liquidity providers to participate.
The protocol would work as follows:
Any trader can open a long/short trade at the current spot price of the asset
Traders pay a funding fee based on the ratio of longs vs. shorts
In this system, if the total profits and losses are negative or trend toward zero, the system is solvent and works as expected. However, if there are durations where total profits and losses are positive, the protocol has to have some mechanism to compensate for the difference. We propose to do this by having an intermediary token which we will refer to as GD.
An example of how this would work:
Alice opens an ETH long position of size $10,000. She deposits 1000 USDC as collateral; this mints 1000 GD tokens and keeps it within the pool
Bob opens an ETH short position of size $20,000. He deposits 2000 USDC as collateral; this mints 2000 GD tokens and keeps it within the pool
The pool now holds a total of 3000 USDC and 3000 GD tokens; the price of 1 GD token is 1 USDC
If the price of ETH increases by 5% and both Alice and Bob close their positions, Alice would now have 1500 GD tokens, while Bob would have 1000 GD tokens
The pool still has 3000 USDC while there are now 2500 GD tokens in existence; the price of 1 GD token is now 1.20 USDC
In this scenario, Alice has made a profit of 800 USDC vs. a profit of 500 USDC if she was using a regular trading platform; while Bob has made a loss of 800 USDC vs. a loss of 1000 USDC if he was using a regular trading platform. This happened because traders made a loss on average. With funding fees to keep sides balanced, the difference would likely be less, but the main concept remains the same.
If the price of ETH decreased by 5% instead, Alice would have 500 GD tokens; while Bob would have 3000 GD tokens. In this case, there would be 3000 USDC in the pool and 3500 GD tokens, resulting in the price of 1 GD being ~0.857. The worth of Alice’s GD tokens would be 428.50 USDC, so Alice has made a loss of 571.50 USDC, while Bob would have made a profit of 571.50 USDC.
There is an asymmetric payoff for Alice, since a 5% increase leads to a profit of 800 USDC while a 5% decrease leads to a loss of only 571.50 USDC. This should further incentivize users to take on the minority side, especially if they can hedge the position, and would help to keep the longs and shorts balanced.
Since liquidity providers or an insurance fund are not required in this model, most fees (e.g. 70%) can be distributed back to the GD token with the rest to staked GMX. If funding is mostly neutral, both longs and shorts could earn yield while taking a directional position. If funding favors one side, a user can enter a position to help balance the ratios while earning both funding fees and yield from opening/closing fees. This opens the platform up to be used not just for leverage trading, but for any user who would like to have 1x spot exposure on any listed token while earning yield, or 1x short exposure to hedge while earning yield.
The GD token can be minted by anyone at the current price without taking on a position. Fees will be distributed directly into the backing USDC pool, allowing for automatic compounding. Collateral from liquidations will further increase the USDC backing. This creates a token with a price that cannot be increased or decreased from speculation but instead is directly related to fees and average trader profits and losses. The token may be desirable to be held for hedging and usable as a base token for pairs on GMX swap.
This model allows an unbounded amount of liquidity for trading while having the system remain solvent even in black swan events. A trader could open a large position on one side without running into any caps, while other users can enter to earn the funding fees after. To prevent manipulation, it may be useful to have a small amount of price impact depending on the trade size. This price impact can be programmed to be a function of aggregated liquidity across exchanges.
If this is built and trading activity moves to this model, an optional migration path can be created for GLP tokens to be migrated to GD tokens.
GMX Improvements
The above proposals should be discussed with the community, protocol users, and other projects to refine the initial ideas and gauge demand for the products.
In addition to the above proposals, work on the core GMX product should continue. Besides the referral program, which should be launched in a few weeks, there are a few main issues that need to be discussed:
New listings
Funding rates
Maximum allowed leverage
esGMX emissions
Multiplier Point emissions
New listings
There have been quite a few suggestions for new tokens to be added to GLP. We will be compiling these suggestions and proposing a vote to expand the diversity of tokens in the GLP pool, allowing more tokens to be traded.
Funding rates
Since there currently isn’t a funding rate to incentivize the balance of longs and shorts on GMX, there is usually an imbalance between the two sides. This benefits GLP holders in the long term if the average profit and loss of traders is negative. The risk with this model is that in a black swan event, the price of GLP could underperform a similar index. While the current performance of GLP with fees factored in has outperformed a regular index, optimizing the performance further should be carefully considered.
In our view, the main concerning scenario would be if there are a large number of short positions and the prices of tokens decrease. The opposite scenario of a large number of long positions and the prices of tokens increasing is slightly less of a concern, since the price of GLP would still increase in this scenario, just not as much as the price of a similar index.
In the former scenario, one mitigation would be to increase the weightage of stablecoins if there are a large number of short positions, and to cap the maximum shorts allowed to 50% of the pool size. To increase the speed of rebalancing in this scenario, the base swap fee of 0.25% could also be reduced for a short period of time.
Maximum allowed leverage
With the removal of the 1.5% minimum price change rule, there isn’t a technical blocker for allowing a higher amount of leverage. One concern may be that we would want to protect traders from themselves, but we feel this is something that should be decided on through GMX governance. We will be creating a vote to allow for up to 50x leverage on the GMX interface.
esGMX emissions
The role of esGMX was to bootstrap liquidity for the protocol in the initial stage, and we feel it is now the right time to re-evaluate the emission rate. The amount of esGMX emissions for GLP on Avalanche is planned to be reduced from 50,000 esGMX per month to 25,000 esGMX per month. For esGMX emissions for GLP on Arbitrum, we propose to reduce the amount from 100,000 esGMX to 50,000 esGMX for April 2022, and 25,000 esGMX per month starting from May 2022.
An idea suggested by @x2dav is to have the emissions be dynamic. This would work by having a target APR for GLP. For example, we could target an APR of 35% for April 2022 and 25% starting from May 2022. If the ETH / AVAX APR is 20% for a week in May, then there would be 5% of esGMX emissions. If the ETH / AVAX APR is 25% or higher, then there would not be any esGMX emissions. The amount of esGMX emissions should also be capped to the maximum proposed emission rate, which would be 25,000 esGMX per chain per month.
Multiplier Point emissions
The Multiplier Points have functioned to reward long-term holders of GMX by boosting the ETH and AVAX rewards of stakers. We want to maintain this mechanism while planning for the long term, to ensure that new participants do not feel overly diluted by earlier holders. One possible change would be to reduce the base APR of Multiplier Points from 100% to 50%, and to have a distribution pool that comes from burnt Multiplier Points. When a user unstakes GMX, a proportional amount of Multiplier Points are burnt. These burnt Multiplier Points can be redirected into the Multiplier Point pool to be distributed over 365 days.
This means that if there is a large number of users unstaking, the Multiplier Point APR would increase. This change isn’t something that needs to be implemented immediately but is worth discussing to ensure a healthy protocol for the long run.
Concluding Thoughts
We will be creating governance forum posts to discuss the above proposals. With these improvements, we aim to continue working towards making GMX the best place for swaps and leveraged trading.
We are grateful to everyone who has helped to work on the project, from ecosystem contributors to community members helping with partnerships and marketing and to all holders. We look forward to further discussing these ideas and continuing to grow the platform.
Connect with us
Website: https://gmx.io/
Twitter: https://twitter.com/GMX_IO
Telegram: https://t.me/GMX_IO
Announcements: https://t.me/GMX_Announcements
Discord: https://discord.gg/H5PeQru3Aa
Github: https://github.com/gmx-io
Disclaimer
The information, content, and materials provided here are for general informational purposes only and do not constitute financial or investment advice, nor a legally binding agreement.
Note that discussions and voting involving contributors may occur on GMX DAO social media platforms, but contributors are independent actors, and nothing discussed or proposed should be understood as an obligation for an individual contributor to act.
Please conduct your own research and consult with appropriate professionals before making any decisions based on the information provided on this website.