GMX V2.X: Zero Slippage, Max Liquidity, Unlimited Open Interest, Virtual Order Book

Objective

To outline a comprehensive strategy for integrating zero slippage from GMX V1 and unlimited OI capacity from order book into GMX V2, while maintaining optimal risk management. This proposal aims to:

  1. Explain the benefits and necessity of this integration for GMX’s competitiveness.

  2. Demonstrate how to achieve these improvements primarily through risk parameter adjustments, with minimal technical changes.

  3. Introduce innovative concepts like post-position price impact and net OI calculations to optimize trading costs and liquidity utilization.

  4. Align GMX’s trading mechanism more closely with traditional order book while leveraging its unique advantages.

  5. Ultimately position GMX as the most cost-effective and liquidity-rich trading platform for traders, while enhancing profitability for liquidity providers.

Background

GMX face three main challenges in competing with CEXs:

  1. Less Asset Diversity: GMX is expanding its tradable assets through multi-oracle support and GLV development. Chainlink is accelerating data-stream deployment, with recent and upcoming listings including wstETH, USDe, ZRO, DOT, ORDI, STX, SUI, APE, MEME, FLOKI, BONK, ILV, MKR, TIA, SNX, APT, LDO, GRT, ONDO, TRX, and STRK.

  2. Less OI Capacity: GMX V2 currently limits OI directly by GM pool amount, significantly constraining its capacity compared to order book system offering unlimited OI.

  3. Higher Trading Costs: GMX V2 has higher trading costs than CEXs due to borrowing fees and higher price impact for medium and smaller trades. The current price impact mechanism in GMX results in significantly higher trading costs in all markets except BTC and ETH, compared to competitors.

To address these challenges, GMX needs to realign its trading mechanism parameters with traditional, well-tested order book system while maintaining its unique liquidity provision strategy. Key parameters include Order Fee, Borrowing Fee, Funding Fee, and Price Impact, which form the core of GMX V2’s risk management framework.

Mechanism

Perp DEXs are typically categorized into order book system (e.g., Hyperliquid) and trader-LP system (e.g., GMX). However, this distinction may not be entirely accurate as both types use matching-based trading mechanism but differ in their liquidity provision strategies. For instance, Hyperliquid utilizes a closed-source market-making strategy, whereas GMX adopts an open-source trader-LP strategy for liquidity provision.

GMX’s unique approach aims to offer the best of both systems. The key to GMX’s success lies in optimizing its risk parameters to balance trader benefits with LP protections. These parameters need to be carefully adjusted to:

  1. Minimize trading costs while preventing market manipulation.

  2. Maximize available liquidity and OI capacity without increasing LP risk.

  3. Ensure market stability through effective long-short OI balance mechanism.

By fine-tuning these parameters, GMX can potentially outperform both traditional order book system and other trader-LP system in terms of liquidity depth, trading costs, and risk management.

GMX V1 GMX V2 Order Book
Slippage None Price Impact Slippage
Funding Fee None Adaptive Funding Fee Funding Fee (8hr)
Borrowing Fee Borrowing Fee Borrowing Fee None
Max OI Long Pool Amount BTC, ETH, etc. Pool Amount Long * OI Reserve Factor Long +∞
Max OI Short Pool Amount USD(s) Pool Amount Short * OI Reserve Factor Short +∞
Available Liquidity Long Pool Amount Long - OI Amount Long Pool Amount Long * OI Reserve Factor Long - OI Amount Long Depends on MM Strategy
Available Liquidity Short Pool Amount Short - OI Amount Short Pool Amount Short * OI Reserve Factor Short - OI Amount Short Depends on MM Strategy
ADL Conditions Pending profits exceed the market’s configured threshold Pending profits exceed the market’s configured threshold Insufficient liquidity in order book to handle liquidated positions

Risk Parameters

GMX’s risk management framework is built upon four key parameters that work in concert to maintain market stability, prevent manipulation, and balance the interests of traders and LPs:

Price Impact: Simulates slippage and prevents price manipulation attacks. In GMX, this parameter is crucial for maintaining accurate asset pricing and protecting LPs from sudden market movements.

Borrowing Fee: Prevents liquidity occupation attacks through long-short hedging. This fee is unique to GMX’s trader-LP model and helps ensure efficient capital utilization.

Funding Fee: Promotes long-short OI balance by charging fees to the positive side and paying fees to the negative side, encouraging market equilibrium. GMX’s adaptive funding fee mechanism is key to maintaining sustainable market conditions.

Order Fee: Covers the basic costs of trade execution and contributes to LP returns. In GMX, this fee is carefully balanced to remain competitive while supporting the platform’s unique liquidity provision model.

These parameters are interdependent and must be carefully calibrated to optimize GMX’s performance across various market conditions.

Proposed Change

To address the challenges faced by GMX and optimize its performance, I propose the following changes:

  1. Net OI Calculation:
  • Net OI Long = max(OI Long - OI Short, 0)
  • Net OI Short = max(OI Short - OI Long, 0)
  1. New Parameters:
  • Introduce Net OI Reserve Factor Long & Short ∈ (0,1)
  • Ensure: Net OI Long < Pool Long Amount * Net OI Reserve Factor Long
  • Ensure: Net OI Short < Pool Short Amount * Net OI Reserve Factor Short
  1. ADL Trigger Conditions:
  • Retain: “Partial or full liquidation may occur when unrealized profit exceeds the market-allocated threshold.”
  • Add: “ADL will be triggered if liquidation would cause the Net OI to exceed the limit.”
  1. Price Impact Adjustment:
  • Set pre-position price impact of all markets to 0, restoring zero slippage.
  • Implement a post-position price impact mechanism that decays over time after opening a position.
  1. Gradual Parameter Adjustments:
  • Incrementally increase OI Reserve Factor.
  • Gradually reduce borrowing fee.

These changes aim to integrate zero slippage from GMX V1 and unlimited OI capacity from order book into GMX V2, while maintaining robust risk management.

GMX V2 GMX V2.X Order Book
Slippage Price Impact 0 Slippage
Funding Fee Adaptive Funding Fee Adaptive Funding Fee Funding Fee (8hr)
Borrowing Fee Borrowing Fee → 0 0
Max OI Long Pool Amount Long * OI Reserve Factor Long → +∞ +∞
Max OI Short Pool Amount Short * OI Reserve Factor Short → +∞ +∞
Available Liquidity Long Pool Amount Long * OI Reserve Factor Long - OI Amount Long Pool Amount Long * Net OI Reserve Factor Long - Net OI Amount Long Depends on MM Strategy
Available Liquidity Short Pool Amount Short * OI Reserve Factor Short - OI Amount Short Pool Amount Short * Net OI Reserve Factor Short - Net OI Amount Short Depends on MM Strategy
LP Max Exposure Pool Amount Long or Pool Amount Short Pool Amount Long or Pool Amount Short Depends on MM Strategy
ADL Conditions Pending profits exceed the market’s configured threshold Pending profits exceed the market’s configured threshold Insufficient liquidity in order book to handle liquidated positions
Liquidation results in the Net OI exceeding the limit

Post-Position Price Impact

This mechanism introduces a price impact that gradually decreases from the time of opening a position to closing it. Key features include:

  1. Parameters:
  • Initial price impact: Set by referencing the current pre-position price impact.
  • Decay time: Adjusted according to market manipulation difficulty (e.g., 10 minutes for BTC, 100 minutes for LTC).
  1. Characteristics:
  • Negative only: Does not differentiate between positive and negative impacts.
  • Time-based decay: Impact reduces over time, eventually reaching zero.
  1. Purpose:
  • Combat market manipulation risk without burdening regular traders.
  • Impose high fees on rapid open-and-close trades, typical of attack behavior.
  • Allow normal traders holding positions for a certain time to incur no cost or impact.
  1. Advantages:
  • Maintains the original intention of preventing price manipulation attacks.
  • Allows regular traders to benefit from zero slippage.
  • Exponentially increases costs for potential manipulators, rendering attacks ineffective.

This approach effectively balances market protection with trader-friendly policies, aligning with GMX’s goal of providing optimal trading conditions.

Virtual Order Book

To demonstrate the effectiveness of the proposed improvements, we introduce a Virtual Order Book for direct comparison with traditional order books:

  1. Purpose:
  • Visually represent GMX V2’s liquidity depth and pricing efficiency.
  • Enable direct comparison with traditional order book system.
  1. Key Features:
  • Displays bid and ask prices with corresponding sizes.
  • Illustrates GMX’s concentrated liquidity at the best bid and ask prices.
  • Shows narrower spreads compared to traditional order books.
  1. Comparison:
  • GMX V2.X typically shows larger sizes at the best bid and ask.
  • Traditional order books display a more gradual distribution of liquidity.
  1. Benefits:
  • Highlights GMX’s superior liquidity provision at key price points.
  • Demonstrates potential for reduced slippage and improved execution for traders.
  1. Interpretation:
  • Large sizes at best bid/ask in GMX indicate deep, immediately available liquidity.
  • Narrow spreads suggest competitive pricing and lower trading costs.

This virtual representation helps illustrate how GMX V2’s optimized mechanism can potentially outperform traditional order book system in terms of liquidity depth and pricing efficiency.

GMX V2.X BTC/USD

Price Size (USD) Total
Ask 5 66,126 0 0
Ask 4 66,125 0 0
Ask 3 66,122 0 0
Ask 2 66,121 0 0
Ask 1 66,120 49,711,079 49,711,079
Spread Spread 1 0.01%
Bid 1 66,119 54,077,348 54,077,348
Bid 2 66,117 0 0
Bid 3 66,114 0 0
Bid 4 66,110 0 0
Bid 5 66,109 0 0

Hyperliquid BTC/USD

Price Size (USD) Total
Ask 5 66,126 10,364 898,536
Ask 4 66,125 13,405 888,172
Ask 3 66,122 39,889 874,767
Ask 2 66,121 39,918 834,879
Ask 1 66,120 794,961 794,961
Spread Spread 1 0.01%
Bid 1 66,119 1,710 1,710
Bid 2 66,117 487 2,197
Bid 3 66,114 59,125 61,322
Bid 4 66,110 25,049 86,371
Bid 5 66,109 36,332 122,703

GMX V2.X ETH/USD

Price Size (USD) Total
Ask 5 3,307.3 0 0
Ask 4 3,307.2 0 0
Ask 3 3,306.9 0 0
Ask 2 3,306.8 0 0
Ask 1 3,306.7 36,444,255 36,444,255
Spread Spread 0.1 0.01%
Bid 1 3,306.6 36,436,741 36,436,741
Bid 2 3,306.5 0 0
Bid 3 3,306.4 0 0
Bid 4 3,305.9 0 0
Bid 5 3,305.8 0 0

Hyperliquid ETH/USD

Price Size (USD) Total
Ask 5 3,307.3 97,673 336,261
Ask 4 3,307.2 5,467 238,589
Ask 3 3,306.9 15,657 233,122
Ask 2 3,306.8 40,383 217,465
Ask 1 3,306.7 52,499 177,082
Spread Spread 0.1 0.01%
Bid 1 3,306.6 70,496 124,583
Bid 2 3,306.5 54,087 54,087
Bid 3 3,306.4 69,314 69,314
Bid 4 3,305.9 1,933 71,248
Bid 5 3,305.8 77,022 148,270

GMX V2.X SOL/USD

Price Size (USD) Total
Ask 5 179.18 0 0
Ask 4 179.15 0 0
Ask 3 179.14 0 0
Ask 2 179.13 0 0
Ask 1 179.12 9,518,474 9,518,474
Spread Spread 0.01 0.01%
Bid 1 179.11 9,266,321 9,266,321
Bid 2 179.10 0 0
Bid 3 179.06 0 0
Bid 4 179.04 0 0
Bid 5 179.02 0 0

Hyperliquid SOL/USD

Price Size (USD) Total
Ask 5 179.18 95,913 234,732
Ask 4 179.15 20,138 138,819
Ask 3 179.14 34,630 118,680
Ask 2 179.13 20,424 84,051
Ask 1 179.12 51,397 63,626
Spread Spread 0.01 0.01%
Bid 1 179.11 12,230 12,230
Bid 2 179.10 226 226
Bid 3 179.06 965 1,191
Bid 4 179.04 27,386 28,577
Bid 5 179.02 492 29,069

Analysis

The proposed changes offer several advantages and potential challenges:

Pros:

  1. Reduced Trading Cost:
  • Lower borrowing fee significantly decrease holding costs for traders.
  • Leverage GMX’s liquidity concentration to provide the lowest price impact/slippage in the market.
  • More precisely target potential attack behaviors with additional costs, rather than affecting all traders indiscriminately.
  1. Increased Available Liquidity:
  • Optimize the mechanism to ensure full profit payout without increasing LP risk.
  • Maximize available liquidity by changing the calculation method from Pool Amount - OI to Pool Amount - Net OI.
  • Utilize the Adaptive Funding Fee to ensure OI Balance, minimizing Net OI.
  1. Increased OI Limit:
  • Prevent liquidity reservation attacks through balanced long-short positions.
  • Enable GM Pool to handle OI far exceeding Pool Amount in balanced markets, enhancing capital efficiency.

Cons:

  1. Potential Delayed Position Closure:
  • Introduce Net OI < Pool Amount restriction to protect LPs.
  • In extreme conditions, traders may need to wait for market rebalancing before closing positions.
  • Mirrors traditional order books, where market makers may withdraw liquidity during volatility.
  1. Additional Risk of ADL:
  • Highly profitable positions may face ADL during large opposite liquidations to maintain Net OI limit.
  • Similar to order book system, where ADL is triggered when liquidity is insufficient to handle liquidated positions.

These changes aim to significantly improve GMX’s competitiveness while maintaining robust risk management.

Q&A

Q1: As a market-making strategy, would these adjustments be disadvantageous to GMX’s LPs?

A1: To assess the impact of the proposed adjustments on LPs, we must first understand GMX’s LP model and compare it with traditional market-making strategies. GMX’s LPs provide capital for the platform’s market-making strategy, with their profitability directly tied to its performance. Using a mid-sized market maker on Binance as a benchmark, we can see that VIP5 fee rates require over $1 billion monthly trading volume and more than 1000 BNB holding, with maker/taker fees at 0.8bp and 2.7bp respectively. Assuming some taker trades, we estimate an average 1bp cost for opening and closing positions.

In traditional market making on Binance, there’s an embedded expectation of -2bp on position execution due to fees. To break even, the strategy must provide at least +2bp, and for stable profitability, at least +6bp. GMX, however, offers an expected environment of +12bp*67% (+5bp for opening, +7bp for closing, and 67% to GM LP) compared to Binance’s -2bp. This means GMX’s strategy will break even as long as its expectation isn’t lower than -8bp, with stable profitability achievable at an expectation not lower than -4bp.

GMX’s strategy has an inherent positive bias as it inversely mirrors all traders’ expectations, which historical data consistently shows to be negative overall. Even without price impact and borrowing fee, GMX’s strategy holds a 10bp advantage over traditional market-making strategies. The proposed changes, aimed at reducing fees and attracting more trades, can increase the base for this expectation, providing more opportunities for the strategy to capitalize on its inherent advantage.

These adjustments are designed to be gradual, with smooth parameter adjustments to minimize impact on LPs. From a long-term perspective, attracting more volume through competitive fees can potentially increase overall profitability for LPs, even if per-trade profits might be slightly lower. By enhancing GMX’s competitiveness, these changes aim to increase market share and total trading volume, with increased volume potentially compensating for lower per-trade fees and leading to higher overall returns for LPs.

In conclusion, while these adjustments might appear to reduce certain fee-based advantages, they are likely to benefit GMX’s LPs in the long run by boosting trading volume, market share, and overall profitability. The inherent advantages of GMX’s market-making strategy, combined with its significant edge over traditional strategies, suggest that LPs will maintain a strong position even with these changes. The key lies in striking the right balance – reducing fees enough to attract more volume without unnecessarily sacrificing profitability. The proposed gradual implementation allows for fine-tuning this balance to achieve optimal results.

Q2: Giving LPs more advantages, such as price impact and borrowing fee, doesn’t that increase LPs’ profits and promote liquidity, making it better overall?

A2: While increasing price impact and borrowing fee might initially seem advantageous for LPs, a deeper analysis reveals the complexity of this issue. LP profits primarily stem from trader activity, and an extreme scenario where fees are set prohibitively high would effectively eliminate all trading, resulting in zero LP profits. This suggests an optimal point exists rather than a simple “higher fees are better” approach. The relationship between fees and trading volume is non-linear, with a local optimum beyond which higher fees suppress trading activity and reduce overall profits.

In a competitive market where GMX faces other DEXs and CEXs, fees play a crucial role in traders’ platform choices, especially given equal liquidity. While deeper liquidity can justify slightly higher fees due to better execution quality, excessively high fees negate this advantage. Different fee types, such as price impact and borrowing fee, directly affect trading costs and holding costs respectively, requiring precise calibration to find the optimal balance.

Trader behavior analysis shows that most compare overall trading costs across platforms, choosing the most cost-effective option. High fees may drive traders to other platforms, reducing GMX’s trading volume. This highlights the need to balance short-term profits per trade with long-term considerations of attracting more traders and increasing overall volume.

There’s a delicate trade-off between market share and profit margin. High fees may lead to high profit margins but could result in decreased market share, while lower fees might bring larger market share with potentially higher total profits despite lower margins. Fees must be high enough to attract and retain LPs, but if they lead to decreased trading volume, it ultimately reduces total returns for LPs.

From a risk management perspective, some fees serve to prevent market manipulation, necessitating a balance between risk management and trader attraction. Additionally, lower fees can improve market efficiency by attracting more arbitrage trades, enhancing price discovery and overall market attractiveness.

In conclusion, while higher fees might seem beneficial for LPs at first glance, the optimal strategy involves finding a balance that maximizes overall trading volume and LP returns. This requires careful consideration of market dynamics, trader behavior, and long-term platform sustainability.

Q3: Does protecting LPs’ profits while lowering traders’ fee thresholds seem contradictory?

A3: Addressing the challenge of protecting LP profits while lowering trader fee thresholds requires a nuanced approach. The GMX governance forum has seen proposals suggesting direct or indirect fee reductions through incentives. However, as Kal’s statistics on the STIP rebate demonstrate, minor fee adjustments may not significantly impact trading volume. This doesn’t invalidate fee reduction as a strategy; rather, it suggests that more substantial changes may be necessary to remain competitive in the market.

GMX’s fee structure is multifaceted, encompassing order fees, price impact, and borrowing fee, each serving specific purposes in the platform’s unique market-making model. This proposal advocates for a re-examination of GMX’s fee structure from first principles, focusing on three key elements: borrowing fee to prevent liquidity occupation attacks, funding fees to maintain long-short balance, and price impact to deter market manipulation.

The borrowing fee, while effective against liquidity occupation attacks, could be replaced by shifting from absolute to relative position limits. This change would maintain risk control while eliminating the need for borrowing fee, reducing holding costs for traders, and increasing OI capacity. It would also benefit arbitrage traders seeking predictable returns by removing the uncertainty introduced by fluctuating borrowing fee.

Funding fees, crucial for long-short balance, have evolved from their absence in GMX V1 to an adaptive mechanism in V2. This progression has addressed long-short imbalances and enabled more stable arbitrage strategies. The adaptive funding fee, mimicking the 8-hour funding fee in centralized exchanges, is essential for maintaining market equilibrium.

Price impact serves as a defense against manipulation, particularly in a zero-slippage environment. The existing order fees on both CEXs and GMX provide a buffer against certain types of attacks. By concentrating liquidity, GMX can offer zero slippage within a specific range while maintaining protection against manipulation.

This improved mechanism allows for a reduction in overall trader fees without compromising order fees or LP profitability. By refining these elements, GMX can create a more efficient, secure, and attractive trading environment for all participants.

Q4: How does the post-position price impact mechanism affect price manipulation attackers?

A4: The post-position price impact mechanism serves as a crucial safeguard against market manipulation while preserving the benefits of zero slippage for legitimate traders. To understand its effectiveness, let’s first consider a scenario without this mechanism, assuming zero slippage, to evaluate potential attack strategies and their associated costs.

Chaoslabs has provided price impact parameters for GMX V2, which closely align with our own calculations based on Binance’s liquidity. Using these parameters as a benchmark, we can explore the costs and feasibility of potential attacks.



Example 1:
An attacker goes long on $10M of BTC/USD on GMX and then launches a $10M attack on Binance's BTC/USD, causing BTC/USD to move 15bp instantly. The opening price on GMX deviates from the initial price by 7.5bp, and the attacker's closing process is symmetric, with the closing price also deviating by 7.5bp from the initial price. The attacker's loss on Binance would be 10M * (3bp + 3bp + 15bp) = 10M * 21bp. The cost on GMX would be 10M * (1bp (spread) + 5bp + 7bp) = 10M * 13bp. Thus, the total attack cost is 10M * 34bp, while the profit is 10M * 15bp, resulting in a net loss of 10M * 19bp. The attack would not happen.

Example 2:
An attacker goes long on $10M of BTC/USD on GMX and then launches a $20M attack on Binance's BTC/USD, causing BTC/USD to move 30bp instantly. The opening price on GMX deviates from the initial price by 15bp, and the attacker's closing process is symmetric, with the closing price also deviating by 15bp from the initial price. The attacker's loss on Binance would be 20M * (3bp + 3bp + 30bp) = 20M * 36bp. The cost on GMX would be 10M * (1bp (spread) + 5bp + 7bp) = 10M * 13bp. Thus, the total attack cost is 10M * 85bp, while the profit is 10M * 30bp, resulting in a net loss of 10M * 55bp. The attack would not happen.

An attacker launches a $10M attack on Binance’s BTC/USD and would need to hold a $105M position on GMX to break even. If the attacker launches a $20M attack on Binance’s BTC/USD, they would need to hold a $42.35M position on GMX to break even. If an attacker were to target the BTC/USD market, they would need funds at this scale to significantly impact the market, assuming massive risk exposure, and complete the operation under ideal market conditions to avoid escalating risk levels. This straightforward analysis illustrates the difficulty of market manipulation purely based on order fees. In other words, order fees alone effectively deter most potential attacks on GMX’s BTC/USD market.

However, our goal is to introduce zero slippage across all markets, including smaller ones where manipulation might be easier. Relying solely on order fees for protection becomes problematic in these cases, as raising fees high enough to prevent manipulation would also burden legitimate traders with excessive costs.

The current pre-position price impact mechanism can address this issue but at the cost of affecting all traders indiscriminately. This is where the post-position price impact mechanism proves its value. By analyzing the attacker’s weaknesses, particularly their need for immediate position closure, we can design a more targeted defense.

The post-position price impact mechanism imposes a high initial cost that rapidly decays over time. This approach exploits the fundamental difference between attackers and normal traders – the holding time. Almost no legitimate trader holds a position for just a few seconds, while this is precisely what an attacker needs to do.

By setting the initial post-position price impact higher than the potential attack profit and implementing a linear decay rate, we create a situation where the attack cost quickly exceeds any potential profit. This effectively neutralizes the threat of price manipulation attacks while allowing normal traders to enjoy the significant advantage of zero slippage and the freedom to close positions at will.

However, this mechanism still has a potential loophole where attackers might use two addresses—one to open the attack position and another to immediately open an opposing position to avoid the impact of closing. This method would nearly double the attack cost but could still potentially make the attack profitable. This shifts the focus to handling hedged positions, which the previously suggested gradually reduced borrowing fee could completely resolve.

Therefore, to further enhance protection, maintaining a certain borrowing fee is advisable. The combination of post-position price impact and borrowing fee creates a robust defense against various attack vectors while preserving the zero-slippage feature that benefits legitimate traders.

In conclusion, the post-position price impact mechanism offers a sophisticated solution to the challenge of providing zero slippage across all markets without compromising security. It leverages the time factor to create an asymmetric advantage against potential attackers, significantly enhancing GMX’s ability to offer an attractive, low-cost trading environment while maintaining strong protections against market manipulation.

Q5: If we were to compare GMX’s market-making strategy with other market-making strategies in the market that do not have additional mechanism buffs, what would happen?

A5: I believe using the example of Hyperliquid will make it easier to understand. Let’s break it down into HLP, HLP Liquidator, HLP Strategy A, and HLP Strategy B. The effect of ordinary market-making strategies in the market corresponds to HLP Strategy A + HLP Strategy B. We can see the overall performance, where the total loss is $1,281,256. However, HLP still performs well, with a total profit of $32,849,870.




We can even further analyze the recent 30-day performance of Hyperliquid.




During the recent 30 days, HLP Strategy had a total profit of $593,356, and HLP Liquidator had a total profit of $84,127. This means that the platform as a whole collected $3,217,003 in fees, with an average daily accrued fee of $107,233.

The overall expectation of GMX’s market-making strategy is positive. Combined with the superior mechanism enhancements, this is the reason GM has consistently outperformed the benchmark over the long term. This clearly illustrates the fundamental difference between a market-making strategy with mechanism enhancements and traditional market-making strategies.

Q6: Having ample liquidity even in extreme situations is a selling point of GMX. If the net OI calculation method is used, there is a small probability that some positions may not be closed in a timely manner in extreme situations. How should this issue be addressed?

A6: Addressing the small probability of delayed position closure in extreme situations while maintaining ample liquidity is a delicate balance that requires a nuanced approach. This issue touches on the core of GMX’s value proposition and requires careful consideration.

Firstly, it’s important to recognize that having ample liquidity even in extreme situations may be a key selling point for GMX. However, we need to define what constitutes an effective selling point. Features that benefit the majority of users most of the time are more valuable than those that only come into play in rare, extreme scenarios. Zero slippage, which benefits all users in every trade, is a prime example of an effective selling point.

The proposed net OI calculation method introduces a small possibility that some positions may not be closed immediately in extreme market conditions. While this might seem like a drawback, it’s crucial to put it into perspective. In traditional order book system, there are often situations where the OI greatly exceeds the total liquidity of the order book, leading to scenarios where immediate position closure is not possible. Therefore, GMX’s approach, even with this small risk, is not out of line with established market practices.

Moreover, the probability of such situations occurring is actually quite low. If we still maintain borrowing fee, for example, a 100M pool facilitating 200M of OI would generate significant APR even with a small borrowing rate per trader. This would incentivize more deposits, making the scenario where net OI exceeds the pool size even less likely.

To address this issue comprehensively, we can implement several strategies:

  1. Utilize ADL (Auto-Deleveraging) mechanisms for extreme situations, similar to traditional trading system. This provides a clear protocol for managing liquidity in stress scenarios.
  2. Allow for higher OI to incentivize more deposits, thereby reducing the likelihood of liquidity shortages.
  3. Implement a dynamic liquidity management system that adjusts parameters based on current market conditions and liquidity levels.
  4. Educate users about the trade-offs between higher capacity and the small risk of delayed closures in extreme conditions. Transparency about system mechanics can build trust and set appropriate expectations.
  5. Continuously monitor and adjust parameters to optimize the balance between liquidity and risk. This could involve regular stress tests and scenario analyses.
  6. Consider implementing a queueing system for position closures in extreme scenarios, ensuring fair treatment of all users.

It’s also worth noting that the benefits of this approach – potentially lower fees, higher capacity, and better capital efficiency – likely outweigh the drawbacks for the vast majority of users. The ability to handle higher OI or offer lower borrowing fee could significantly boost GMX’s competitiveness in the market.

In conclusion, while it’s important to address the small probability of delayed position closure, we shouldn’t let it overshadow the significant benefits this new approach brings. By implementing robust risk management strategies and maintaining clear communication with users, GMX can offer a superior trading experience that balances high liquidity, low costs, and manageable risks.

Conclusion

In crypto, the concept of perpetual contracts was first popularized by BitMEX in 2016. Prior to its introduction by BitMEX, the idea of perpetual contracts was initially proposed by economist Robert Shiller in 1992 for illiquid assets. Alexey Bragin also contributed to this development in 2011 by providing a prototype of perpetual contracts collateralized by cryptocurrency. This might be the most important revolutionary innovation in the derivatives sector of the crypto.

For GMX, as a pioneer in the Trader-LP model within crypto, numerous innovations and possibilities have been introduced throughout its development. The proposals above are based on first principles, suggesting a series of innovations specific to GMX’s unique market-making mechanism to fully unlock its potential. These include:

  1. Achieving zero slippage through post-position price impact to minimize trading costs.
  2. Maximizing available liquidity and handling infinite OI through net OI calculations.
  3. Aligning GMX with traditional order books through a virtual order book, which also intuitively showcases GMX’s superior liquidity.

At its core GMX provides trading services to traders just like other DEXs and CEXs. Traders care most about fees; the exchange consistently providing the most cost-effective service long-term will win. GMX combines several advantages for an irreplaceable edge: delivering unparalleled liquidity surpassing Binance-level and even all orderbook-based depth, minimizing costs for all traders, ensuring optimal trading experiences, and implementing advanced market-making strategies for LPs.

The goal is to make GMX the unequivocal choice for all traders. Although this proposal has undergone dozens of iterations, there may still be areas that have not been thoroughly considered. I will further discuss and refine this proposal with GMX Core Contributors and Chaoslabs. Additionally, I look forward to questions and feedback from the community on this proposal.

Finally, I would like to extend special thanks to community members zh robot and JJ Cycle for their active feedback and suggestions. I have always believed that GMX has been blessed with a very responsible community.

Q

5 Likes

Proposed Mechanism 0808 @chaoslabs

  1. unlimited oi

net_oi_long = max ( oi_long - oi_short, 0 )
net_oi_short = max ( oi_short - oi_long, 0 )

available_liquidity_open_long = available_liquidity_close_short = reserve_factor_net_oi_long * pool_value_long - net_oi_long

available_liquidity_open_short = available_liquidity_close_long = reserve_factor_net_oi_short * pool_value_short - net_oi_short

  1. 0 slippage

price_impact = Σprice_impact_per_trade (including open and close)

if price_impact > 0, post_position_price_impact = price_impact

if price_impact < 0, post_position_price_impact = min ( price_impact + Σborrowing_fee , 0)

only settle price impact when fully closing positions

  1. borrowing fee → unchanged

  2. funding fee → unchanged

Here is a distilled version of the proposal:

Objective: Integrate zero slippage from GMX V1 and unlimited OI capacity from order book into GMX V2, while maintaining optimal risk management.

Key challenges: Less asset diversity, less OI capacity, and higher trading costs compared to CEXs.

Solution: Adjust risk parameters (Order Fee, Borrowing Fee, Funding Fee, Price Impact) to balance trader benefits with LP protections, minimizing trading costs while preventing market manipulation, maximizing available liquidity and OI capacity without increasing LP risk.

Features:

  • Zero Slippage: Achieve price matching in all trades by introducing post-position price impact.
  • Unlimited OI Capacity: Allow unlimited open interest (OI) through virtual order book.
  • Risk Management: Fine-tune parameters to maintain market stability, prevent manipulation, and balance trader-LP interests.
  • Enhanced Liquidity: Optimize net OI calculations for better liquidity utilization.
  • Competitiveness: Position GMX as the most cost-effective and liquidity-rich trading platform.

Note that this is a condensed version of the original proposal.

2 Likes

I appreciate the time and effort that was obviously put into this. I’m just a bit concerned about decreased profitability due to lower fees considering that was an issue we’ve faced and are still facing with the transition to V2 from V1.

Additionally, with the reduction in borrowing fee going towards zero as you’ve outlined and the introduction of the zero slippage post position price impact mechanism, wouldn’t a price manipulation attack (on smaller less liquid tokens) still be possible? Assuming a trader opens a position on one wallet and opens the exact opposite position on another. Could they not just wait long enough for the price impact to be sufficiently low and then perform the attack? Considering we would have decreased borrowing fee by quite a bit the wait might not be as costly as the attack profitable.

4 Likes

Hi djjddjjd, thank you very much for raising this question. It is indeed a very important consideration.

Here, the problem and the implementation direction for measures to address these attacks are described. However, since you raised the question, I can clearly explain the implementation details.

  1. Borrowing fee → 0: The original borrowing fee was set to prevent attackers from occupying liquidity meaninglessly. After calculating the available liquidity using net OI, such meaningless occupation attacks no longer exist, so the borrowing fee is no longer necessary. Of course, the necessity and existence of the borrowing fee are not contradictory.
  2. Borrowing fee → Borrowing Fee: After introducing zero slippage and post-position price impact, a new problem arises, as mentioned above. Attackers deliberately occupy liquidity to avoid the penalty of post-position price impact. We need to charge a borrowing fee for such hedging behavior. Although it is the same parameter, the target of its function is entirely different.
  3. Assuming the borrowing fee remains unchanged, Chaoslabs only needs to estimate the decay time when the post-position price impact → 0. The estimation method is straightforward: ensure that the integral of the borrowing fee over the decay time is greater than or equal to |negative price impact| - |positive price impact| -13bp (due to the additional order fee cost introduced in GMX hedging), to ensure the attacker’s cost is strictly greater than or equal to the attack’s gain. This formula will be further refined, but it is shown here for ease of understanding.
  4. Final implementation: For traders, this means achieving certain zero slippage when opening positions, closing positions with zero slippage after holding for more than the decay time, and maintaining the borrowing fee unchanged.
1 Like

I am currently reading through the proposal but will wait for @chaoslabs and @xdev_10 to give their comments to make sure this is a feasible change.

3 Likes

post-position price impact is a smart idea, but the borrow fee could not resolve this loophole, e.g. the attacker could
Long 10M at GMX
Long 10M at Binance → price raised
Short 20M at GMX
wait until the price impact fee decay to 0
Close the Long 10M at GMX → take profit without any price impact
Close the Long 10M at Binance
Close the Short 20M at GMX → take profit without any price impact

It’s hard to cover the attacker’s profit with borrow fee even the decay time is 30 minutes

1 Like

I respect the work dedicated to describe the proposal, but I miss the calculations on how this will affect the protocol’s revenue. On the face of it this could have a very significant negative impact on generated fees both for LPs and for GMX stakers. And if these changes will increase the user base and the volume several times but in turn reduce the revenue by the same ratio, then the question is whether it is worth taking the risk with such quite extreme changes.

2 Likes

The question you mentioned makes people think deeply. How is zero slippage feasible in GLP? Does GLP face the same problem? How to avoid this attack?

1 Like

thank you for your opinion

My initial idea was to add a lender role. The lender role is the current low-leverage traders who use Eth to short Eth. They aim to earn Funding Fee and are expected to obtain about 20% of stablecoin returns annually.
lender role completely hedge the gm risk caused by opening a long position, so the size of the long oi should not be limited to the asset size of gm, and at the same time meet the 100% compliance of traders and low-risk arbitrage between lp and lenders that gmx has always adhered to.
However, adding this role should be more complicated for code development. From the perspective of rapid code development,
the proposed model can be implemented quickly. How much risk will it bring? You can see the balance of the historical gmx position opening OI. Seeing that the balance can always be maintained, I believe the risk is not big;

You mentioned the decline in GM’s income. As the scale increases, the borrowing fees of GM will remain unchanged, and the traders’ fees will also drop significantly. Moreover, the larger oi brought by the same GM will also increase GM’s transaction fees multiple times. Income, if this part of the income is increased to gradually subsidize some traders, I believe that more traders will come to gmx trading, bringing larger traders, gm, and oi scale.

1 Like

Thank you very much for raising this question. It is evident that you have a very clear understanding of the overall plan. Regarding your point that the borrow fee could not resolve this loophole, I believe it will be clearer if we consider some practical examples.

First, we need to clarify the basis of our discussion:

  1. We believe that the current price impact can protect GMX V2 from manipulation attacks, so we want to at least maintain this price impact as the basis for the post-position price impact.
  2. We know that the current negative price impact is approximately twice the positive price impact.
  3. Since there will be no positive price impact in this plan, only negative price impact, we will divide the value of the negative price impact by 2.

Accurately speaking, the negative price impact factor is equal to 2 times the positive impact factor. If the OI difference from state A to B results in a negative price impact of p, then according to the formula, the positive price impact from B to A will be 1/2 * p. This means that if you open and immediately close a position, it aligns with this 2x relationship. However, since the OI difference may change due to token price fluctuations or other users’ opening and closing actions during the time between opening and closing a position, it is difficult to maintain a strict 2x relationship, and there will be some deviation. But for the sake of discussion, we can make this assumption.

image

Let’s take the example of going long 1M BTC/USD in the SS BTC Pool. Its position price impact is -0.1%. We divide this by 2, which means -0.05% is the basis for the post-position price impact. Here, you can see that the borrowing fee is -0.0022% per hour. This means that as the borrowing fee gradually accumulates, it can cause the post-position price impact to gradually decrease to 0. If we maintain this rate, the time for the post-position price impact to decrease to 0 is 22.727 hours.

However, we must not forget that a 1M position is already quite large for most users, especially when it is taken from a total available liquidity of 8.6M, with 4.3M available on each side. If we consider positions of 100k or even below 10k, the price impact is usually within 0.01%. Using the same calculation method, the decay time may only be 2-3 hours, which falls within the normal holding period.

What is the essence of this trading method? It essentially assigns two characteristics to all users’ orders by default: the exposure calculated at the time of opening the position is based on the most current market conditions, while the cost is gradually spread out using a post-position, post-only iceberg order method. At the same time, users have the freedom to cancel the iceberg order and exit the position at any time.

Taking the previous example, when a user opens a 1M position, they immediately get 1M risk exposure. However, the cost of opening the position gradually trends towards the price impact of opening a 1M position over 22.727 hours, which is 0. This mechanism is impossible to achieve in an order book but can be realized in a trader-LP setup.

In conclusion, the decay time is not fixed at, say, 30 minutes. It depends on the price impact in the current system, which could be 0 (in the case of current positive price impact), shorter than 30 minutes, or longer. Overall, in a balanced long-short scenario, at least half of the users are directly provided with a zero slippage option for closing positions, while the other half have different decay times based on the size of their positions. As long as the holding period meets certain conditions, they can also achieve zero slippage when closing positions. For opening positions, all users experience zero slippage.

Moreover, this plan fully maintains the current system’s price impact feature, preventing price manipulation attacks.

The following is the Price Impact document provided by the Risk Management team at GMSOL for reference.




1 Like

Thank you, Saulius. I believe you have raised a very crucial question: what is the impact of this plan on the protocol’s revenue?

  1. Protocol revenue = volume * order fee + oi * borrowing fee
  2. The basic calculation methods for order fee and borrowing fee have not changed.
  3. The unlimited open interest plan expands the potential oi base.
  4. The 0 slippage plan expands the potential volume base.

This is a strictly positive gain, and I hope these four points should be able to answer your question.

1 Like

Thank you for the efforts made for GMX. Here are my thoughts:

  1. Essentially, we are a leverage trading platform, not a perpetual swap platform. This is because the information we trade impacts spot prices, not perpetual prices. For example, if we list pairs like YGG/LOOM, which had a 30% spot contract price difference on Binance last year, our prices would be based on spot prices, not the decoupled perpetual prices. Therefore, based on the consensus that any leverage on spot requires a borrow fee, we also need a borrow fee and cannot cancel it.
  2. We need to be friendly to GM, and zero slippage is essentially a false proposition, although it is a great gimmick. Most of the time, GLP’s zero slippage is protected by its high 0.3%*2 fee. GM does not have such high fee protection, so the amount supported for zero slippage trading should not be unlimited. Otherwise, there will definitely be arbitrage by bots. As someone in the community once said: “GMX is still too small to withstand large risks. Imagine a headline one day: ‘GMX liquidity providers were arbitraged by bots, losing hundreds of thousands of dollars.’ Such an article would be hugely damaging to us. Remember the AVAX price manipulation incident? We mitigated that by limiting the position size per account. However, on a permissionless chain, this limit can easily be bypassed by creating multiple accounts. What truly protected us was the 0.6% fee on each open/close position, making manipulation unprofitable. With GM’s lower fees, this balance could be disrupted.”
  3. We should not blindly believe that the reason for the low number of GMX trading users is that GMX cannot compete with Binance on fees. If GMX’s trading fees were lower than Binance’s, the result would not be a surge in users, but rather GM users withdrawing liquidity due to low returns. The depth of GM is our main competitive advantage over other DEX derivative platforms. Uniswap had much higher fees than Binance during V2. In V3, most trading pairs’ depth still does not match Binance’s, but Uniswap never complained about having fewer users. In fact, permissionless trading (0 KYC) naturally has a lot of user support. Matching our depth and fees to Coinbase, Kraken, etc., would be a good performance for a DEX. GMX’s marketing team should recruit as many traders as possible based on this, rather than constantly squeezing GM’s returns.
  4. In summary, I oppose the proposed zero slippage and cancellation of the borrow fee. I suggest calculating the upper limit of the amount for zero slippage by capturing the depth that mainstream exchanges achieve under fee impacts multiplied by a certain risk ratio (initially below 10%). As long as we can say “zero slippage” in promotions, it is fine. Unlimited zero slippage is too risky for GM. Additionally, consider adding certain tokens for GM (such as introducing ETHUSDC GM, testing a high fee + zero slippage model, testing Q’s suggestions, and seeing the market’s acceptance of this new model). We should treat our GMs well and cautiously, as they are our core competitive advantage as a DEX.
3 Likes

Interesting proposal, and I appreciate the effort. However, I don’t believe the risk/reward profile justifies implementing it. Here’s why:

Fees aren’t the main issue deterring users from GMX. For traders, cross-margin collateral is more significant. Familiarity (order book model) and convenience (mobile app) also matter.

Lowering fees increases vulnerability to arbitrage. This will always be a risk due to the nature of blockchain technology which can’t compete with the speed of CEX servers.

Considering the differences between OB vs. LP & central servers vs. blocks, let’s look at the ‘bigger picture’ :

We should stop comparing GMX to CEX or unregulated CEX on private chains. Though both offer leveraged products, their structures, strengths, and weaknesses differ significantly. They target different market segments, and positioning GMX as a CEX competitor is unwise.

It’s better to view GMX as a competitor to Uniswap or ‘Uni on Leverage,’ focusing on permissionless listings and customizable pools and push in that direction.

Other priorities, as listed by KR in this gov forum post, are more impactful and worthy of core team dev hours (These may already be underway; I’m not privy to GMX’s core contributor’s activities.) Along with the GLV proposal which will require follow-up and patches once live.

Implementing the proposal here might be quicker than other projects, but ‘coding’ people’s money requires thorough review, audits, and testing. So in the end it never is that simple.

I also believe GMSOL could significantly impact the GMX ecosystem and will demand full-time efforts from you and other key players. In the future, this proposal could be reassessed, implemented, and tested on GMSOL, as higher OI limits does offer value. OI hard caps was a bottleneck for GMX V1 but isn’t currently for V2 pools.

1 Like

Hi, thanks for your detailed feedback and response.

GMX has no pricing power and relies on oracle-pushed prices for various calculations. Trading on GMX does not affect spot prices or futures prices. For example, with YGG/LOOM, the trading price on GMX is not dependent on its spot price but is determined by the sampling method and weight of the Chainlink Data-Stream.

It is undeniable that borrowing fee are necessary for any leverage based on spot. However, it is important to distinguish that, although both are called borrowing fee, GMX’s borrowing fee is completely different from traditional borrowing fee. For example, with traditional spot-based borrowing fee, regardless of the asset you borrow, the fee is levied based on the asset’s value. In contrast, GMX’s borrowing fee is levied on the advantaged side based on the long-short balance, while the other side is zero. Traditional spot-based borrowing fee aim to assign a time cost to the act of borrowing assets. In contrast, GMX’s borrowing fee aim to prevent liquidity occupation attacks.

Therefore, I do not agree with your conclusions regarding GMX and borrowing fee.


Although I believe directly comparing borrowing fee in this way is invalid, I think that borrowing fee should be retained in the current scheme for the following reasons:

  1. From the perspective of preventing liquidity occupation attacks, once we change the calculation of available liquidity from pool value - OI to pool value - net OI, the impact of such liquidity attacks through long-short hedging will be directly reduced to zero. In this regard, if we only need to introduce the unlimited OI scheme, since this attack method no longer exists, borrowing fee are indeed unnecessary.
  2. However, besides introducing unlimited OI, we are also attempting to introduce a zero slippage scheme. For the zero slippage + post-position price impact scheme, the potential attack method of using two accounts to perform long-short hedging to avoid post-position price impact has emerged. This is a new problem, but the solution is to restore borrowing fee.
  3. Therefore, although my conclusion is the same as yours, which is to retain borrowing fee, it went through a process of borrowing fee → 0 → borrowing fee, differing from your understanding of borrowing fee (-> 0 → borrowing fee).

I agree that we should be friendly towards GM. I suspect there is a significant misconception here: LPs may believe that lowering trader fees will lead to a decrease in their income. Undeniably, typical solutions, such as directly reducing order fees from 7bp/5bp to 5bp/3bp, or further reducing them and subsidizing with GMX or esGMX as mentioned in the forum, can be considered highly risky schemes due to a lack of deep understanding of GMX’s fee structure.

However, this scheme is fundamentally different from those as I mentioned above.

  1. Protocol revenue = volume * order fee + OI * borrowing fee
  2. The basic calculation methods for order fee and borrowing fee have not changed.
  3. The unlimited open interest plan expands the potential oi base.
  4. The zero slippage plan expands the potential volume base.

This is a strictly positive gain process.


As for the issue of price manipulation attacks you mentioned, let’s first discuss GMX V1. Its fee is 0.1% * 2 instead of 0.3% * 2. The higher fee rate in GMX V1 can indeed somewhat prevent BTC and ETH price manipulation attacks. However, for more niche markets like AVAX, it is insufficient. Thus, GMX V1 fundamentally cannot support more markets to meet industry development needs. At this point, we must introduce the price impact method to prevent price manipulation risks and support more trading markets. Our simulations of price impact also clearly show why the GMX V1 fee rate is feasible for preventing BTC and ETH price manipulation but entirely inadequate for other markets.

In this proposal, although it features zero slippage, it ensures precise application of price impact to attack behaviors rather than applying high price impact indiscriminately to all users. The combined solution of post-position price impact and borrowing fee is completely equivalent to our current pre-position price impact scheme in preventing price manipulation attacks. The specific argument is fully presented in Q4-A4, “How does the post-position price impact mechanism affect price manipulation attackers?”

Please distinguish between trading fee and order fee. The trading fee is the comprehensive trading cost, which includes the portion paid to LPs and the portion paid to holders of the opposite position. The focus of the current proposal is to maintain the portion of the trading fee paid to LPs while reducing the portion paid to holders of the opposite position, thus lowering the trading fee without changing the order fee, while still providing the same protection against attack risks.

GMX’s direct competitors are perp DEXs with the same permissionless trading characteristics and zero KYC, whether they are based on the trader-LP model or the order book model. Under the premise of sufficient liquidity, the comprehensive trading cost is the decisive factor. GMX currently meets the needs of users trading at the 1M-10M level very well, but it is at an absolute disadvantage when comparing fees for trades below 1M. However, through the reform of this proposal, which increases the cost precisely for attack behaviors rather than indiscriminately, GMX is poised to gain an advantage in trades of any size.

To reiterate, this proposal is absolutely not about blindly reducing fees at the expense of increased risk. If this proposal increased the risk of price manipulation attacks, this would certainly be reflected in the comprehensive assessment by Chaoslabs. Additionally, there is no scenario where GM LP’s earnings are squeezed, as has been thoroughly explained above. Overall, I suggest you take a closer look at the implementation process of this proposal and GMX’s fee structure, rather than interpreting the proposal literally. I hope my analysis above is helpful to you.

Hi EruditePepe, thanks for your thoughts.

The background for this proposal comes from observing extensive community feedback that directly compares trading costs, highlighting the current competition GMX faces and its disadvantages. Based on this, I have proposed a potential solution. I do not deny the importance and significance of cross-margin collateral, order book fe, and mobile apps, but I disagree with your comparative assessment here, which seems to suggest that fees are not important. In fact, we can certainly propose corresponding solutions to the issues mentioned later. However, this proposal focuses solely on the fee structure issue and its corresponding solutions.

Lower fees can indeed increase the risk of price manipulation, but this proposal is not about a literal reduction of fees, nor is it about directly removing the price impact. The explanation above details why the post-position price impact combined with the borrowing fee can fully replace the current pre-position price impact. This approach can achieve zero slippage while maintaining the same level of control over price manipulation risks.

I disagree with your assessment. Uniswap does have localized pricing power, whereas GMX has no pricing power and relies on Oracle feeds for pricing. GMX is not a direct competitor to CEXs, but when it comes to providing leveraged trading services, GMX does compete with CEXs. The core differences lie in fees and liquidity, with other factors such as trading experience and trading mechanisms being secondary.

Based on the current potential cooperation situation, both GMX and GMSOL will fully respect Chaoslabs’ recommendations. If Chaoslabs believes that the proposal can be adopted and has benefits, then both should adopt it. If Chaoslabs deems it unsuitable, the proposal will be discarded, and GMSOL will not adopt it either, as the final risk parameters are provided by Chaoslabs.

2 Likes

This post really embodies the passage above.

Intro

First and foremost, we would like to thank gmsolq for their thorough and well-researched proposal. The insights provided lay a solid foundation for addressing the current challenges faced by GMX and exploring new avenues for improvement.

In this response, we will analyze the key points outlined in the proposal regarding the implementation of net Open Interest (OI) across the GMX platform, the feasibility of introducing post-position price impact, and the potential effects of reducing borrowing rates. We will assess the advantages, disadvantages, and practical implications of these suggestions, focusing on how they align with GMX’s strategic goals and risk management framework. This response aims to provide constructive feedback and additional considerations to ensure that the proposed changes optimize the platform’s functionality while maintaining a positive user experience and robust risk management.

Net OI

The proposal suggests identifying and managing net Open Interest (OI), which is the imbalance between long and short OI, to accurately represent the pool’s market exposure and potentially enhance trading activity and liquidity provider returns. While this is accurate, it is crucial to consider its historical distribution values when setting protocol parameters, such as funding rates and reserve factors.

If there were no other implications, this would have been an excellent suggestion that could potentially lead to enhanced Open Interest (OI), increased trading activity, and, consequently, higher fees and returns for Liquidity Providers (LPs).

Although typically, OI is not limited by caps or reserve factors (RF), as demonstrated above with the largest markets on GMX - BTC and ETH - the same applies to other markets.

A similar outcome could also be achieved by significantly increasing the RF, supported by the observation that the imbalance in GMX markets is typically low, as shown below:

However, the potential for significant imbalances toward the winning side during sharp market movements could lead to substantial drawdowns for LPs. Consider the following scenario: with a pool size of $10M and an OI RF of 10x, $50M of OI is available on both sides. If the market starts dropping, causing long positions to close, and assuming $25M of long positions are closed, this leaves the pool with a delta exposure of $25M. If the drop continues, a 20% decrease would result in a $5M loss for the pool, and a 30% decrease would result in a $7.5M loss, etc.

However, limiting net OI instead of OI and restricting traders from closing their positions if they exceed the allowed net OI could result in a poor user experience. Preventing users from closing their positions, thereby taking away their control over their funds and possibly leading to greater losses, is very undesirable.

In summary, OI caps and RF have not typically limited OI growth on GMX; therefore, we do not suggest replacing them. We do not recommend adopting net OI limits instead of OI, as this could lead to significant losses for LPs and a poor user experience. However, as shown in the referenced post, we have no objection to an increase in RF. Additionally, the upcoming introduction of Risk Oracles could further reduce the likelihood of OI caps limiting the markets, with more frequent updates being implemented.

Post Position Price Impact

The proposal recommends implementing a post-position price impact mechanism to mitigate market manipulation while maintaining a positive trading experience for most users. To evaluate the feasibility and potential impact of this mechanism, we can begin by examining the distribution of position duration on the BTC market:

It can be seen that the median trade is 3 hours long, and the P90 is 98 hours long. Therefore, the vast majority of trades’ borrowing rates do not impose significant costs. This is important because it indicates that for most traders, the borrowing costs are minimal. Thus, implementing a post-position price impact may not effectively penalize market manipulation without imposing undue costs on regular, short-term trades.

For intuition, looking at the borrowing rates directly, the median borrowing rate over the last 3 months (on samples different from zero) was 0.0016% hourly in the BTC market, meaning that it would take ~60 hours to reach 10 bps.

The points mentioned above lead us to recommend against implementing post-position price impact, as we do not see it feasible. Unless we set a very low decay time, we cannot effectively cancel the price impact for most traders on the platform. However, a short decay time is inefficient against manipulators. They can simply incur the cost of borrowing while opening a position on both sides, as the cost is insignificant, and after the decay time has passed, conduct their manipulation. At the same time, they close the side they do not need just before the manipulation, thereby avoiding any price impact and only paying the borrowing rate, which is negligible. The attacker would have to pay 2x the open/close fees of 5/7 bps, but in smaller markets, that could still not be sufficient to prevent a manipulation. In addition, price impact helps to make the OI more balanced by penalizing trades that make it worse and incentivizing trades that improve it, which will not happen with the post-position price impact.

Since the borrowing rate also depends on utilization, and we cannot predict when an attack will occur, we would need to assume even lower borrowing rates than the median. To prevent attackers from exploiting this by holding positions on both sides and closing one after the decay time, achieving sufficient values to counteract this strategy would require an impractically long time.

Reducing Borrow Rates

The proposal advocates for gradually reducing borrowing rates to improve the trader experience and attract a broader range of users while considering the potential impact on revenue and platform competitiveness. We support this from a risk management perspective. However, as indicated above, borrowing rates are likely negligible for most traders since they do not hold positions long enough for these rates to become significant. Consequently, this change may not necessarily improve the trader experience. Moreover, it could lead to a decrease in revenue, as income from borrowing rates is substantial.

Fee Reduction

Nevertheless, it is important to mention that Chaos Labs understands and supports the desire for lower fees to make GMX more attractive to a broader range of users, leading to increased volumes.

Recent and upcoming steps to achieve lower fees include:

  1. Reduction in Price Impact: A recent recommendation was made to reduce price impact in most markets on GMX V2
  2. Introduction of the Chaos Labs Risk Oracle: This will enable price impact to be set according to live market data, including CEX liquidity. It will allow for dynamic adjustment of parameters to address current risks and significantly reduce price impact. This will also facilitate more frequent updates of the OI caps
3 Likes

Hello @chaoslabs , thank you very much for your excellent analysis. I agree with your perspectives on OI, lowering borrowing fees, and further reducing price impact by introducing a risk oracle. The only point I believe may be problematic is your analysis of post-position price impact.

Your statement that “implementing post-position price impact may not effectively penalize market manipulation” is inaccurate.

To better distinguish, let’s refer to the current mechanism as pre-position price impact, and the mechanism I proposed as post-position price impact.

Under the pre-position price impact mechanism

attack cost = open/close order fee + open/close pre-position price impact + borrowing fee

Under the post-position price impact mechanism

attack cost = open/close order fee + open/close post-position price impact + borrowing fee, where post-position price impact = pre-position price impact - borrowing fee

If the manipulator holds the position for a very short time

attack cost = open/close order fee + open/close post-position price impact + borrowing fee = open/close order fee + open/close pre-position price impact, where borrowing fee < pre-position price impact

which is strictly equal to the attack cost under the pre-position price impact mechanism.

If the manipulator holds the position for a very long time

attack cost = open/close order fee + borrowing fee >= open/close order fee + open/close pre-position price impact, where borrowing fee > pre-position price impact and post-position price impact = 0

which is strictly greater than the attack cost under the pre-position price impact mechanism.

If the manipulator opens positions on both sides, based on the above argument, the attack cost would double

long / short attack cost = long (open/close order fee + open/close post-position price impact + borrowing fee) + short (open/close order fee + open/close post-position price impact + borrowing fee)

Therefore, the above argument strictly proves that for manipulation attacks, regardless of the market, post-position price impact is equally effective as pre-position price impact. More importantly, the calculation method for price impact-related risk parameters does not need to change at all.

Under normal circumstances, borrowing fees are indeed not high. Citing your data, the median borrowing rate over the past 3 months (on samples different from zero) was 0.0016% hourly in the BTC market, meaning it would take about 60 hours to reach 10 bp, or 6 hours to offset 1 bp of price impact.

However, based on price impact calculations, in the BTC market, causing a 1 bp price impact typically requires a position of $600k, while causing a 10 bp price impact usually requires a $6m position.

So even if it indeed takes 60 hours of borrowing fees to fully offset 10bp, we shouldn’t use this extreme negative impact of 10bp to negate the positive impact on the majority of users across the entire market. For positions that can cause a 10bp impact, their post-position price impact won’t be worse than pre-position price impact, while currently, even using 1 bp as the evaluation threshold, a position size of $600k can meet the needs of most of the market, achieving zero slippage. This is necessary for greater user adoption.

Furthermore, I believe the charts on Quantiles of Absolute Price Impact doesn’t have much relevance to this issue. From the formula

trading cost = open/close order fee + open/close post-position price impact + borrowing fee

we know that the price impacts corresponding to open and close are directly added in the composition of trading costs. In reality, these two price impacts are usually in opposite directions, such as -10bp for opening and +8bp for closing, or +8bp for opening and -10bp for closing.

If we follow the statistics of absolute price impact, the position’s price impact would be 10bp and 8bp, but considering the entire lifecycle of the corresponding position,

total price impact = open price impact + close price impact

which is -10bp +8bp = +8bp - 10bp = 2bp. Therefore, if we follow the Quantiles of Net Price Impact of each position corresponding to this mechanism, we would get a more reasonable, completely different distribution. For more concentrated small net price impacts, the effect of post-position price impact would be more significant, meaning more positions could actually achieve zero slippage.

The previous analysis thoroughly discussed the upside of this mechanism, which is that it can provide an actual 0 slippage trading experience for most users in most markets while maintaining control over manipulation risk completely aligned with the current approach. Given these advantages, I believe the corresponding development cost is worthwhile.

I look forward to your further feedback.

3 Likes

Loving your work on this, Q. Had to read it a few times to fully process it, and it strongly resonates. The pre-position price impact mechanism that reserves price impact for extremely short-term traders is thought-provoking. The net OI calculations, I don’t really oversee yet, but I grasp the concept’s advantages. A visualised, virtual order book is something I’ve long felt would be a great way to illustrate GMX’s superior liquidity.

Overall, it makes for an excellent vision of further building on GMX’s foundational strengths, while still guarding against the inherent risks of AMM+Oracle-based perp design.

I spotted one minor mistake: you reference 67% of revenue going to GM LP’s, but it is actually 63%.

This changes the calculation here a tiny bit, but it doesn’t affect the overarching argument in any way: it’s worth reexamining GMX’s fee structure and price impact mechanism, to find the optimal balance that maximizes overall trading volume and LP returns. And this feels like an excellent way to approach that.

1 Like