
Previously, we made a brief reference to X4. This article provides an in-depth explanation of the proposal.
Automated market makers (AMMs) have become a go-to platform for DeFi and offer users the chance to make money by providing liquidity. Moreover, since an AMM is such a hub of activity for any project’s token, we feel it can be used as a route to explore new ideas and concepts.
When a pool is established, the creator usually only has a limited capacity to control its operations; tokens are taken in for liquidity provision, and LP tokens are given to the depositor; LP tokens are burned when liquidity is withdrawn and the pool’s tokens go to the person taking out the funds; moreover, buying and selling alters pool ratios after fees have been calculated. As this system is predetermined, it cannot be altered in any way.
X4 proposes to develop an Automated Market Maker (AMM) that would provide pool developers and projects with complete authority over how their pools work. When a pool is developed, the creator will be able to customize the functions of adding, removing, buying and selling liquidity according to their preference.
The instances listed below demonstrate some of the possibilities this new feature offers.
Dynamic Fees
Usually, Automated Market Makers (AMMs) come with predetermined fees or a limited selection of fees. With complete control over the pool, it is possible to do the following:
- Projects can set fees to any percentage they prefer
- Fees can be easily changed without requiring liquidity migration
- Different fees can be charged for different actions, e.g. there could be higher fees on selling vs buying
- Fees can be dynamic and adapt based on specified parameters
A dynamic fee can be utilized in various ways. For instance, when a much-awaited project is first launched on an AMM, there are usually bots that rapidly buy the tokens once trading initiates. After the initial purchase, these bots would slowly sell the tokens to subsequent purchasers. By permitting a dynamic fee, projects can opt to set the fee to a higher rate at launch and program it to gradually decrease over the initial few hours.
Projects can opt to pay liquidity providers with just one type of token, as opposed to the typical combination of tokens. For example, those supplying liquidity for a GMX/USDC pool will usually receive fees in both GMX and USDC. However, if desired, projects can take control over the pool and configure the fees to be paid out exclusively in either GMX or USDC.
Tokens that have a “burn on transfer” characteristic could utilize fee personalization to share out rewards in a stablecoin; for instance, if an XYZ/USDC token were present, there could be a two percent fee on purchases and five percent fee on sells. Each of these charges might be determined to be in USDC and sent to a distribution agreement.
It could be feasible to construct novel, reliable tokens by having a token reserve that increases the cost of selling and divides this fee among buyers and holders if the average price is heading downwards, while taking the opposite approach if the average price is rising. To motivate liquidity for multiple pools, such as XYZ/ETH and XYZ/USDC, arbitrage would be enabled and fees could be continually distributed to motivate token ownership.
Access to all Tokens
Certain tokens, such as GLP, cannot be conveniently transacted on an Automated Market Maker (AMM) as specialized action is needed for purchasing/selling it. Permitting control of the pool would make more tokens tradeable, thereby reducing the labor demanded of project developers since the interface for exchanging with any other token has already been formed. Tokens with a minimum price like XVIX or those with distinct curves can also be connected to X4.
By employing tailored curves, it is possible to create a token with an extremely high level of liquidity for purchasing, while imposing a levy on selling that causes its floor price to rise on each purchase and sale.
Customizable curves could also allow stablecoin protocols to generate pools that uphold equilibrium in a way that is specifically adapted to their requirements.
An alternative could be tokens with prizes allotted through a lottery system. For instance, there could be a LOTT/USDC pool where a portion of each sale and purchase is placed into the prize pool while another portion goes to token holders. Every buy within an established period would give the buyer a chance to win the jackpot based on their amount of investment.
Greater Composability
It would be feasible to create pools with yield-generating tokens that are minted upon joining the pool and redeemed when leaving the pool.
Aggregation
Bootstrapping the initial liquidity of a new AMM is a challenge. To draw in users and projects, there must be an adequate amount of liquidity across different pools. Therefore, X4 should serve as an aggregator and direct trades through not only itself but also GMX swap and other AMMs such as Uniswap. This would provide a substantial depth of liquidity on all tokens while providing an enjoyable user experience.
A potential problem may be the negatives of having various pools with a similar pair, as it could take time to locate the best pool to send through. A possible answer is to employ keepers that keep a current list of pools and their accessible liquidity at various depths. This could be more just than AMMs that route operations through a fixed set of pairs since pools which can provide superior prices would be taken into account automatically.
This routing protocol permits the creation of a personalized token by depositing into X4, whereupon trades can be conducted directly as the deposit and mint.
Fragmentation of liquidity between pools might be a worry, but likely won’t be significant since the pools incentivized or governed by the protocol generally have the highest liquidity and draw in the most trading activity.
GMX Swap
X4 transforms the AMM from a mere trading site into a platform for ventures to construct more of, or even their entire protocol on. This will enable new sorts of tokens and protocols to be created, leveraging the trading action that will take place in the pools while being cost-effective by having the main capacities incorporated into the trading pools. For elementary fee personalizations, layouts can be crafted and audited for projects to utilize. Having custom templates to apply a steady product formula as the foundation of the pool, or having pools which employ Uniswap V3’s concentrated liquidity option would also be feasible.
The platform would be a boon to projects by giving them access to an easy-to-use swap interface, keeping track of liquidity, volume, and fees and connecting them with charting and utility providers so that developers can dedicate their attention to other parts of their protocol.
GMX’s existing swap feature can be enhanced by rebranding it as GMX swap, which will enable more tokens to be exchanged at better rates. Moreover, the swapping process can be made more convenient by creating a separate “Swap” page on the “Trade” page.
Protocol fees can be embedded into the pools, though we suggest leaving this at zero to enable projects to quickly access and make use of the system. There will be no new token; GMX will remain the governing token of this platform. In addition to improvements in swap trading, GMX would also gain more exposure if either current or upcoming projects opt for deploying or creating a pool that is linked to their contracts. This could result in increased swap volumes and leverage trading platform users. Furthermore, it would be simple for GMX and GLP to be chosen as a base pair, thus raising liquidity for both tokens.
PvP AMM
This proposal stands apart from the Protocol Controlled Exchange mentioned earlier, and it should be taken into account when deciding which projects to work on in the coming months.
Various approaches have been employed in leverage trading, including but not limited to:
- GLP: liquidity providers required, 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
We believe it is worthwhile to carry on experimenting with the various advantages and disadvantages of these models.
We suggest constructing a PvP AMM that connects traders with one another and optionally grants liquidity providers the ability to join in.
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 towards 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 make up 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 is not required in this model, the majority of 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 favours 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 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, there can be an optional migration path created for GLP tokens to be migrated to GD tokens.
GMX Improvements
The above proposals should be discussed with the community as well as with protocol users and other projects to refine the initial ideas and to 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 is something that 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 for a week in May, the ETH / AVAX APR is 20%, 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 a vision of 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 discussing these ideas more and to continue growing the platform.