Skip to main content

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.

Selecting V2

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:

RPC URLs

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.

Sending Tokens

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.

Swaps

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.

Long position:

  • Earns a profit if the token's price goes up
  • Makes a loss if the token's price goes down

Short position:

  • 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.

Max Leverage

The max allowed leverage of a pool will decrease as the total open interest of the pool increases, this is to guard the pool against gaming of price impact using high leverage positions. This mainly affects markets with less liquidity but can affect high liquidity markets if the open interest is very large. The interface will show a warning if the max allowed leverage will be exceeded. Note that this only affects opening / increasing of positions, it will not affect positions that have already been opened. For closing / decreasing of positions, if the max allowed leverage would be exceeded when decreasing a position then the order can still be executed, but the collateral within the position would not be reduced.

Managing Positions

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.

Limit Orders

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
  • The mark price was reached but the max allowed leverage would be exceeded

Stop-Loss / Take-Profit Orders

Stop-loss and take-profit orders can be created by clicking on the "..." button in the position row and selecting the "Trigger Close" option, it can also be by selecting the "TP/SL" tab in the trade box.

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.

Order Execution

If a Limit / Stop-Loss / Take-Profit order's trigger price is reached, the order will attempt to be executed, if the price impact is too high and the acceptable price is not met or if there is insufficient liquidity then the order will be in a "frozen" state. Regular orders will be executed at the price closest to the trigger price, for frozen orders, they will be executed at the latest price instead. The acceptable price requirement will still apply, so frozen orders will only be executed at the latest price if the acceptable price can be met.

Liquidations

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 a certain percentage, which ranges from 0.4% to 1%, depending on the market and pool settings, 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 it does not factor in any negative or positive price impact. 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 is not static. Especially if you use leverage greater than 10x and have the position open for more than a few days, it's crucial to actively 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.

Synthetic markets

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%.

Swap Fees

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%.

Price Impact

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.

Price Impact Rebates

Under normal circumstances, the long and short open interest should be mostly equal and price impact should be minimal.

However, it is possible in times of volatility for the long and short open interest to be imbalanced leading to a high price impact.

Price impact rebates help to reduce the effect of this. Each market has a maximum price impact as a guideline; if a trade is closed with a price impact higher than this percentage then the additional impact would become claimable after approximately 10 days.

For example, if the maximum price impact for a market is 1% and a trade is closed with 3% negative price impact, then the collateral equivalent to 2% negative price impact would be claimable after a few days on the interface.

The purpose of having a delay of a few days is to guard against price manipulation attempts. In the case of a price manipulation attempt, rebates should be reviewed and only applied to accounts that were not involved in the price manipulation.

Note that this rebate only applies to closing / decreasing of positions; for opening / increasing of positions there is no maximum price impact. For market increase orders, the price impact would be shown on the interface so that users can decide if the impact is acceptable. For limit orders the acceptable price including any price impact must be met for the order to be executed.

Funding Fees

There may be positive or negative funding fees while a position is open.

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.

Adaptive Funding

Funding rates gradually adjust 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.

Borrowing Fees

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.

Execution Fee

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, the excess execution fee is sent back to your account. The amount of overestimation can be configured using the "Settings" menu in the top right corner of the page.

One-Click Trading

One-Click trading can be enabled through the account menu in the top right of the interface.

Enabling this feature allows trading without requiring a wallet signing popup for each trade.

Safety features:

  • Funds from decreasing positions, closing positions, swaps can only be sent back to your wallet account
  • Trades can only be created without a signing popup up to the maximum authorized number, e.g. if you authorize 10 allowed actions, then after 10 trades a wallet signing popup is necessary to re-authorize the next 10 trades

Risks:

  • This feature works by generating a subaccount that is stored locally on your browser, if your browser is compromised then the key could leak and a malicious user could create trades with high price impact in an attempt to profit from the compromise
  • The maximum authorized number of trades would still apply, so even in a compromise, a malicious user can only create trades up to the previously authorized number

This feature can be disabled at anytime by clicking "Deactivate" in the One-Click Trading settings menu.

Trading Risks

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
  • Liquidations
  • ADLs

Additionally, collateral and profits may be backed by bridged or pegged tokens which may not be guaranteed to maintain peg.

Stablecoin Pricing

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.

Arbitraging

If pools are imbalanced for swaps or perps, arbitraging can be done to gain a profit while helping to balance the pools.

Swaps

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.

Perps

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.

Direct URLs

The GMX frontend supports direct URLs that pre-fill parameters, enabling users to share specific trading configurations.

Trade Parameters

tradeType

  • The type of trade
  • Allowed Values: long, short, swap

mode

  • The mode of the trade
  • Allowed Values: limit, market, trigger and tpsl

from

  • The token used for payment in the trade
  • Allowed Values: Valid token symbol supported by the platform such as eth, btc, usdc, etc.

to or market

  • The asset to long, short or swap to
  • Allowed Values: Valid token symbol supported by the platform such as eth, btc, uni, etc.
collateral
  • The asset used as collateral for the trade
  • Allowed Values: Valid token symbol supported by the platform such as eth, usdc, usdt, etc,
pool
  • The liquidity pool where the trade is executed
  • Allowed Values: Valid pool name/address supported by the platform such as weth-usdc, btc-usdc, etc.

Examples:

GM Pools Parameters

operation

  • Whether to buy or sell GM tokens
  • Allowed Values: buy or sell

market

  • The market to buy GM tokens for
  • Allowed Values: Valid market name supported by the platform such as eth, btc, swap-only etc. swap-only is used for listing the swap only markets for GMX v2.

pools

  • The pool to buy GM token for
  • Allowed Values: Valid pool name such as btc-usdc, usdc-dai, arb-usdc, etc.

mode

  • The trade mode
  • Allowed Values: single or pair
from
  • Token used for payment to buy GM tokens
  • Allowed Values: Valid token symbol supported by the platform such as btc, eth, usdc, etc.
to

GLP Parameters

operation

  • Whether to buy or sell GLP
  • Allowed Values: buy or sell
from
  • The token used for payment to buy GLP
  • Allowed Values: Valid token symbol supported by the platform such as btc, eth, usdc, etc.
to
  • The token to be received when selling GLP
  • Allowed Values: Valid token symbol supported by the platform such as btc, usdc, usdt, etc.

Examples: