Remove the min price movement rule

GMX has a requirement that the mark price must move by more than 1.5% for a position to be closed in profit, this currently applies only for the first 3 hours after a position is created or increased.

This requirement has been one of the largest pain points for users and can be confusing as it is not a common requirement.

The reason for this requirement was to prevent front-running issues, mainly, because the on-chain price is used when opening and closing a position, there can be a slight delay between when the price of a token changes on other exchanges and when this price is broadcasted on-chain. If there is a difference in exchange prices and the price on GMX, then bots or traders can use that to enter either a long or short position at a more favourable price and increase their chances of profit.

An alternative to the minimum price movement rule would be to enforce a delay between a user’s intention to open a position and when the position is actually opened. For example:

  1. User sends a transaction to open a long position
  2. 1 second passes
  3. The long position is opened with the current token price

This solution was suggested by the community earlier on, but we felt we did not have enough data to be sure that this measure would be sufficient to protect liquidity providers from bots.

After analysing prices and tracking the statistics of other platforms, we feel confident enough to attempt this switch to a time delay flow.

The updated flow would be like the following:

  1. A user will send their intention to open a position on-chain, either to long or short
  2. The position will be in a pending state
  3. There will be two roles: keepers and signers
  4. Keepers will monitor blockchain logs for the intention to open positions
  5. If the log signalling to open a position is more than 5 seconds ago, the keeper will make a request to signers
  6. Signers receive the request from keepers, validates that the position is not older than e.g. 30 seconds, fetches the median price of exchanges, signs the position and the median price, then returns the signature and median price to the keeper
  7. After a keeper gathers at least 3 signatures, it will include these signatures and the prices then execute the position
  8. If the position is not older than 30 seconds and the median price provided by the 3 signers is within the acceptable slippage then the position will be confirmed with the entry price as the included median price, otherwise, the collateral will be sent back to the user
  9. Orders will also have this requirement so that it cannot be used to skip the 1 second delay

The delay will be 1 second at the start but may be adjusted between 1-5 seconds in case we notice any harmful bot activity, we will post an update if the delay is going to be changed.

Keepers and signers will be run by the team and advisors for a start, as we work on improving things, we can make it based on community votes and require explicit staking of GMX tokens to run keepers and signers.

The drawbacks of this are that in times of high volatility, it might be difficult to open a position within the specified slippage, but we believe that 5 seconds should be an acceptable amount of delay and the trade-off to remove the 1.5% rule is worth it.

These changes can be implemented without requiring a migration.

7 Likes

I dare to disagree with this proposal. It seems to me that this will bring additional dissatisfaction on the part of traders when opening a position will not guarantee real-time market price for them. In addition, trading robots will still be able to take advantage of the price gaps, as a strong move in any direction will still make it more likely that price will continue to move in the same direction, even after a 5-30 seconds.

If traders could choose between 5-second delay or 1.5% movement
what do you think they would choose?
IMHO 99% of them would choose a 5-second delay

1 Like

Long term traders better will choose 1.5% movement. In fast moving markets you can easily get 1.5% worse price for your position after 30 seconds delay. Or even worse- your initial order to open position will be discarded at all if for some reason keepers and signers fail to communicate in proper manner.

5 seconds is ok if we look from effectiveness perspective;

though, there is a big difference in user’s perception of instant trade vs 5 second delayed trade.
I always advocate for better, faster, smoother UX.

if majority of votes will approve this feature, I suggest that visually position must be opened instantly, while it should be clear that position is not finalized yet, and the price is “fetching oracle price” or something like that.

also, the concern is there might be problems in keeper to signer communication, especially in time of big volatility.
I suggest we might implement a doomswitch to automatically rollback to stable version with 1.5% if there are signs of malfunction.

3 Likes

I disagree, we are on-chain dex so people cant get instant pricing either from waiting on Metamask to waiting on either chain AVAX/ARBI to transmit the txn,

I think 1.5% is a bigger hindrance for them.
we not a CEX with an instant order book pricing either

If I understand the proposal correctly, the order will fail if the price moves too much during the 5 sec delay. So I don’t think your comment about the trading bots is valid.

I’m in favour of the proposal. Obvisouly no delay is better then a 5 sec delay. But I think 95% of traders will totally accept it. It’s much better and less frustrating then the 1,5% rule.

The doomswitch sound like a good emergency plan though!

4 Likes

Maybe first decrease this rule to 0.5% and then look forward how it effects the pool.
We do not need trader which draining the GLP pool.

We all know and notice that the team is working hard to satisfy traders and investors. But slow steps may better than change the whole mechanism

1 Like

As I understand 5 seconds delay is absolute minimum. Most of time it will be 15-30 s. and that will cause new discomfort for traders. I never open positions from on-chain price source, instead I watch real-time prices on CEX. I never aim for price move 1.5% only- my targets are 3-5% mid term market moves. So proposal is useless and unfavorable for trader like me.

1 Like

I like this suggestion. If it is possible to revert back to 1.5% with ease, sense it works.

Does reduction require a migration?

Really great to see development on this :+1:t2:

As I see that some people disagree with this, would it be possible to let the traders choose wether they want the 1,5% movement or the 5 sec delay? Like having own account settings etc~

Cheers

2 Likes

Should be possible to add, I think there are valid points about users not wanting to wait, we will test it internally to see if the impact to user experience is noticeable, if it is, we can adjust the delay or re-work the proposal. If we launch this and traders do not like the change we can provide traders the two options.

For bot issues, the delay should make it less attractive because a bot trading on momentum would capture a larger profit on other platforms that don’t have a delay.

6 Likes

i prefer this idea to offer trader both choices if tech is possible. My understanding is in some cases, delay is worse than 1.5%.

2 Likes

Hey gang,

I’m a trader, have been using GMX for quite a while. I think 5s (as a minimum delay) is a bit steep considering that I like playing volatility and when I want a fill I want it as fast as possible, else the opportunity subsides.

That said, I’m very happy to have the option to choose between 1.5% change or time delay as it can satisfy different trading objectives for different traders.

I would be additionally content if the time delay could be reconsidered to be less impactful. I would also be okay with paying a higher trading fee in order to take a position or even having slightly steeper spread on fills for buys and sells - just throwing some ideas out.

Thanks for the awesome platform!

zuff

4 Likes

Ahh thats great to hear! I think implementing the idea of giving the traders a possibility to choose would work best because the traders can set it up as they prefer, which will eventually result in a better user experience.

2 Likes

Thank you for the feedback, 5 seconds should be the upper bound, for most trades we should be able to settle it in 1-2 seconds, will test it out to confirm.

1 Like

To update on the implementation, the current implementation flow is:

  1. User sends a request to increase / decrease position
  2. A keeper listens for these requests, fetches the latest price then sends an update to execute the position at the current median price of Binance, FTX, Bitfinex

Separate signers are not implemented currently, the main reason is because from testing it would increase the network fee by a large amount, to add 3 extra signers, the network costs on Arbitrum would be around $5 and on Avalanche around $7

The keeper is currently run by myself and has the same restrictions as the fast price feed submitter, which are that:

  1. Prices submitted must be within 2.5% of he current Chainlink price
  2. Watcher nodes are run to verify that the prices submitted match the median price, if there is any deviation, a transaction is sent to enforce a spread between the Chainlink price and the fast price, if this happens, even if invalid prices are sent a malicious user would not be able to profit by manipulating the price

To further decentralize this, we will be looking into running the keeper on Intel SGX, this is the same solution used by the Avalanche bridge, Avalanche Bridge: Secure Cross-Chain Asset Transfers Using Intel SGX | by Conor Leary | Avalanche | Medium.

The watcher is currently run by our second dev G, and xhiroz will be running a node as well.

We will be creating a technical document to detail all these and other information, should be ready next week.

2 Likes

Is there a delay in executing decrease/increase position size? I assume there is, otherwise you can abuse the system by opening a small position and increasing the size easily?

As a trader, having delayed execution where price can lead to slippage is really not acceptable. I understand that you can adjust slippage tolerance, but this would really stop my usage of the platform. Volatility is what drives trades, and if I am unable to enter or exit a position consistently, then I cannot rely on the platform.

5-30 second delay is truly too long.

What happens to stop losses? Do they trigger on time, or do they also take 5-30 seconds?

If you are planning trades that you will hold under long periods of time then this change doesn’t affect you, but neither would the 1.5% mark price movement. So I really struggle to see who this change will benefit? You can always offset the 1.5% mark price restriction by taking a short on the same instrument, which is an alternative to taking profit, but at least you can mitigate your risk this way.

Being unable to predict execution price just makes up way too much risk.

hi, the current delay is 1 second, it might change if we detect any front-running issues, will post an update if we need to change it

trigger orders have the same 1 second delay currently