Trading on V2
GMX is a decentralized exchange allowing trading without the need for a username or password. The platform uses a price feed based on an aggregate of exchanges which reduces the risk of liquidations from temporary wicks.
On the Trade page click on "V2" in the trading bar to select V2.
Adding a Wallet
If you do not have a wallet yet, you can use Rabby.
Connecting your Wallet
After you have a wallet, you can connect your wallet by pressing the "Connect Wallet" button on the Trade page.
If you see the message: "Your wallet is not connected to Arbitrum / Avalanche", click on "Add Arbitrum" or "Add Avalanche" to add the Arbitrum / Avalanche network to your wallet.
Alternatively, you can manually add the network:
Since GMX is a decentralized exchange, querying of data and submitting of transactions is done through an RPC URL.
There may be times when the RPC URL is not as responsive as it should be, during these times you may notice data being slow to load or not loading on your page. It is also possible to hit the rate limit with the public Arbitrum RPC URL (https://arb1.arbitrum.io/rpc) which would result in 429 errors.
To continue using the exchange during these times you can use a backup URL or switch the RPC URL in the network settings of your wallet and the page should load faster after.
A list of RPC URLs and their statuses can be found on Chainlist.
You will need to have ETH in your Arbitrum account or AVAX in your Avalanche account to start trading.
You can buy ETH directly on Arbitrum or AVAX on Avalanche from the options listed under "Buy ETH" or "Buy AVAX" (depending on the connected network) on the Buy page.
Alternatively, if you have ETH or AVAX on other networks, you can transfer them to Arbitrum or Avalanche from any of the options under "Transfer ETH" or "Transfer AVAX" on the Buy page.
GMX supports both swaps and leverage trading. For swaps, click on the "Swap" tab on the Trade page, this will open the interface to swap tokens.
For leverage trading, please see the below sections for more information.
Opening a Position
Click on "Long" or "Short" on the Trade page depending on which side you would like to open a leverage position on.
- Earns a profit if the token's price goes up
- Makes a loss if the token's price goes down
- Earns a profit if the token's price goes down
- Makes a loss if the token's price goes up
After selecting your side, key in the amount you want to pay and the leverage you want to use.
Below the swap box you would see the "Exit Price", which is the price that is used to calculate profits if you open and then immediately close a position. The exit price will change with the price of the token you are longing or shorting.
Selecting a Market
You can select a market by changing the token that you'd like to Long or Short.
Selecting a Pool
Multiple pools may be available for your selected market, for example, there may be an ETH-USDC and ETH-USDT pool. You can select which pool you'd like to trade in depending on which collateral you prefer to be backing your positions.
Selecting a Collateral
Multiple types of collateral may be available for your selected market, for example, in the ETH-USDC market, you can choose whether your position's collateral is stored as ETH or USDC.
Examples of how this could be used:
Long ETH with ETH as collateral: You would have be long ETH from your long position as well as from your ETH collateral. It is possible to e.g. open a 0.1 ETH long position for a small amount of ETH while using 1 ETH as collateral for a total of 1.1 ETH exposure.
Long ETH with USDC as collateral: You would be long ETH only from your long position. This could be useful if switching frequently between longing and shorting.
Short ETH with ETH as collateral: This could be useful for delta neutral strategies to earn funding fees. For example, if funding is such that longs pay shorts, then a 1 ETH short position could be opened with 1 ETH as collateral.
Short ETH with USDC as collateral: This could be useful if switching frequently between longing and shorting.
Note that if opening a long position with a non-stablecoin as collateral, your liquidation price may change as the price of your collateral changes.
Limit orders can be created by selecting the "Limit" option after selecting whether you would like to open a long or short.
After creating a limit order, it will appear in under the "Orders" tab, you can edit the order and change the trigger price if needed.
Note that limit orders are not guaranteed to execute, this can occur in a few situations including but not exclusive to:
- The mark price which is an aggregate of exchange prices did not reach the specified price
- The mark price was reached but there may not be sufficient liquidity to execute the order
- The mark price was reached but executing the order would result in a position which exceeds the current max leverage
After opening a trade, you would be able to view it under your Positions list, you can also click on "Edit" to deposit or withdraw collateral, this allows you to manage your leverage and liquidation price.
Closing a Position
You can close a position partially or completely by clicking on the "Close" button in the position row. Closing a position will realise pending profits / losses proportional to the percentage of the position that is closed.
For long positions, profits are paid in the asset you are longing, e.g. if you long ETH your profits will be in ETH.
For short positions, profits will be paid out in the same stablecoin that you used to open the position, e.g. USDC or USDT.
You can customize the token to be received by changing the "Receive" token in the "Close Position" menu. Note that this may perform a swap from your profit token to the token you select if needed, the swap fees will be shown in the "Close Position" menu.
The amount of profit and loss for a position, excluding changes in your collateral's value, will be proportional to your position size. For example, if you open a long ETH position of size 10,000 USD and if the price of ETH increases by 10%, the position would have a profit of 1000 USD, if the price of ETH decreases by 10%, the position would have a loss of 1000 USD.
If a short position was opened instead, then if the price of ETH decreased by 10% the position would have a profit of 1000 USD, if the price of ETH increased by 10%, the position would have a loss of 1000 USD.
Leverage for a position is displayed as (position size) / (position collateral). If you'd like to display the leverage as (position size + PnL) / (position collateral) instead, you can customise this in the "Settings" menu by clicking on the "..." icon at the top right of the page.
Stop-Loss / Take-Profit Orders
You can set stop-loss and take-profit orders by clicking on the "..." button in the position row and selecting the "Trigger Close" option.
After creating a trigger order, it will appear in your position's row as well as under the "Orders" tab, you can edit the order and change the trigger price if needed.
If you close a position manually, the associated trigger orders will remain open, you would need to cancel them manually if you do not want the order to be active when opening future positions.
Note that orders are not guaranteed to execute, this can occur in a few situations including but not exclusive to:
- The mark price which is an aggregate of exchange prices did not reach the specified price
Additionally, trigger orders are market orders and are not guaranteed to execute at the trigger price.
If an ETH long position is opened and the position size is larger than the collateral value, then there would be a price at which the position's loss amount is very close to the collateral value.
This is referred to as the Liquidation Price and is calculated as the price at which the (collateral - losses - fees) is less than 1% of your position's size. If the token's price crosses this point then the position will be automatically closed.
The price used to calculate whether a position is liquidatable is based on the oracle price and after factoring in a capped negative price impact. This price does not factor in positive price impact and negative price impact is capped to 1%. When the position is liquidated the actual positive and negative price impact is applied to close the position.
Due to borrowing and funding fees your liquidation price will change over time, especially if you use a leverage that is more than 10x and have the position open for more than a few days, so it is important to monitor your liquidation price.
Collateral can be deposited using the "Edit" button in the position row, this will help to improve the liquidation price and reduce the risk of liquidation.
When a position is liquidated, any collateral remaining after deducting losses and fees would be returned to your account.
Market Types and ADL
Two types of markets are possible in GMX V2.
Fully backed markets
An example of a fully back market would be an ETH perp market backed by ETH-USDC where the open interest is limited to be less than the total amount of ETH and USDC tokens in the pool.
For example, if there is 1000 ETH and 1 million USDC in the pool and the max long open interest is limited to 900 ETH and the max short open interest is limited to be 900k USDC, then all profits can always be fully backed regardless of the price of ETH.
An example of a synthetic market would be a DOGE perp market backed by ETH-USDC. While the max long open interest could be limited to a fraction of the amount of ETH tokens, it may be possible for the profits of long positions to exceed the worth of the tokens in the pool.
For example, if there is 1000 ETH and 1 million USDC in the pool and the max long DOGE open interest is limited to 300 ETH, but the price of DOGE increases 10x while the price of ETH increases only by 2x, in this case the pending profits would exceed the worth of the ETH in the pool.
To avoid this scenario, ADL (Auto-Deleveraging) may take place. When the pending profits exceed the market's configured threshold, profitable positions may be partially or fully closed. This helps to ensure that markets are always solvent and all profits at the time of closing can be fully paid.
Fees and Rebates
Open / Close Fees
The trading fee to open a position is 0.05% or 0.07% of the position size, similarly there is a 0.05% or 0.07% fee when closing the position. This applies for increasing the position size of an existing position and partially decreasing a position size as well.
If the trade increases the balance of longs and shorts then the fee would be 0.05%, otherwise the fee would be 0.07%.
The fees for a normal swap are 0.05% or 0.07% of the swap amount.
If the trade increases the balance of tokens in the pool then the fee would be 0.05%, otherwise the fee would be 0.07%.
The fees for stablecoin swaps are 0.005% and 0.02% of the swap amount.
If the trade increases the balance of tokens in the stablecoin pool then the fee would be 0.005%, otherwise the fee would be 0.02%.
There may be a positive or negative price impact for increasing / decreasing positions and for swaps.
If the trade improves the long / short balance or tokens in the pool then there would be a positive price impact, otherwise there would be a negative price impact.
For increasing / decreasing positions, a positive price impact would result in an entry / exit price that is more favourable for your position, e.g. if opening a long position with a positive price impact, the position's entry price would be lower. A negative price impact would result in a entry / exit price that is less favourable, e.g. if opening a long position with a negative price impact, the position's entry price would be higher.
For swaps, a positive price impact would increase the amount of tokens received while a negative price impact would decrease the amount of tokens received.
The price impact values can be viewed on the interface when making a trade.
There may be positive or negative funding fees while a position is open. If there are more longs than shorts then longs would pay a funding fee to shorts, if there are more shorts than longs then shorts would pay a funding fee to longs.
The funding fee rate can be viewed on the interface when making a trade. Note that the rate will change over time based on the balance of longs and shorts.
If you receive positive funding fees for your position, these fees can be claimed by using the "Claim" button in the "Claimable Funding" box of the Trade page.
Some markets may have an adaptive funding rate, this will be indicated when hovering over the funding rate of a market.
Markets with adaptive funding will have a funding rate that gradually adjusts over time based on the long and short ratio.
For example, if the total long open interest is larger than the short open interest then the funding rate that longs pay shorts will gradually increase until the difference between the long and short open interest is below a certain threshold or an upper limit is reached, at which time the funding rate will remain constant.
If in this scenario more shorts are opened or longs are closed such that there are now more shorts than longs then the funding rate that longs pay shorts will gradually decrease until the difference between the long and short open interest is below a certain threshold.
If there remains more shorts than longs then the funding rate will gradually adjust in the other direction such that shorts will pay longs a funding rate that gradually increases until the difference between the long and short open interest is below a certain threshold or an upper limit is reached.
To avoid a scenario where liquidity is fully reserved by a user opening equal long and short positions for a small cost, there is a borrowing fee for open positions. If there are more longs than shorts then longs would pay the borrowing fee, if there are more shorts than longs then shorts would pay the borrowing fee. This borrowing fee also helps to incentivise more liquidity to be added in the event that all liquidity is reserved for positions.
The borrowing fee rate can be viewed on the interface when making a trade. Note that the rate will change over time based on the pool utilization percentage.
There are two transactions involved in opening / closing a position:
- User sends the first transaction to request open / close / deposit collateral / withdraw collateral
- Keepers observe the blockchain for these requests then execute them
The cost of the second transaction is displayed in the confirmation box as the "Max Execution Fee". This network cost is paid to the blockchain network when the order is executed. This cost is overestimated to handle potential increases in gas price, when the order is executed, any excess execution fee is sent back to your account.
Caution should be exercised when interacting with any smart contract or blockchain application. While risks are attempted to be mitigated through testing, audits and bug bounties, there is always a risk of vulnerabilities in smart contract code.
A non-exhaustive list of risks:
- Smart contract risks
Additionally, collateral and profits may be backed by bridged or pegged tokens which may not be guaranteed to maintain peg.
In case the price of a stablecoin depegs from 1 USD:
To ensure that profits for all short positions can always be fully paid out, the contracts will pay out profits in the stablecoin based on a price of 1 USD or the current Chainlink price for the stablecoin, whichever is higher.
For swaps using the depegged stablecoin, a spread from 1 USD to the Chainlink price of the stablecoin will apply. If Chainlink Data Stream prices are used then the spread would be from the data stream and may not be to 1 USD.
If pools are imbalanced for swaps or perps, arbitraging can be done to gain a profit while helping to balance the pools.
For swaps, positive price impact can be arbitraged.
For example, in the ETH-USDC pool, if the USD value of ETH in the pool is more than the USD value of USDC in the pool, then there would be a positive price impact to swap USDC for ETH. This positive price impact would result in additional ETH being received for a USDC to ETH swap.
Pool balances can be viewed on the V2 Stats page.
For perps, positive price impact and funding fees can be arbitraged.
For example, if there are more ETH long positions than short positions then there would be a positive price impact to open ETH short positions, this would result in a better entry price than the current market price. The position would also earn funding fees while it remains open.
If in the same scenario, the ETH long positions close such that there are more shorts than longs, then there would be a positive price impact to close the long position, this would result in a better exit price than the current market price.
For markets where the index token is the same as the collateral token, e.g. using ETH collateral in the ETH perp market, delta neutral positions can be opened by using the collateral token to open a short position. Conversely, when arbitraging with long positions, a 1x long position can be opened using a stablecoin as collateral, this would lead to 1x exposure to the index token.
Note that funding will tend towards zero as the long / shorts become balanced, this should be considered when deciding on the position size to open for arbitrage.
Pool balances and funding rates per hour can be viewed on the V2 Stats page.