Skip to main content

Direct URLs

The GMX frontend supports direct URLs that pre-fill trade parameters, letting you share specific trading configurations or deep-link users into a particular state.

Trade parameters

Use the /trade/:tradeType path to open the trade page with pre-selected settings. The trade type is a URL path segment, not a query parameter. All query parameters are removed from the URL after two seconds.

ParameterLocationDescriptionAccepted values
tradeTypePath segmentThe type of tradelong, short, swap (case-insensitive)
modeQuery parameterThe order modemarket, limit, stopmarket, trigger, twap (case-insensitive); tpsl is an alias for trigger
fromQuery parameterThe token used for paymentToken symbol such as eth, btc, usdc (case-insensitive)
to or marketQuery parameterThe asset to long, short, or swap toToken symbol such as eth, btc, uni (case-insensitive); to and market are interchangeable
collateralQuery parameterThe collateral assetToken symbol such as eth, usdc, usdt (case-insensitive)
poolQuery parameterThe liquidity pool for the tradePool name such as weth-usdc, btc-usdc (case-insensitive)
chainIdQuery parameterTriggers a network switch on loadNumeric chain ID such as 42161 (Arbitrum)
note

Not all order modes are available for every trade type. Stop Market is only available for long and short positions. TWAP is available for long, short, and swap trades. Swaps do not support Stop Market.

Examples

  • https://app.gmx.io/#/trade/long?mode=limit&from=eth&market=sol
  • https://app.gmx.io/#/trade/short?mode=limit&from=eth&to=btc
  • https://app.gmx.io/#/trade/short?mode=market&from=eth&to=btc&collateral=usdc
  • https://app.gmx.io/#/trade/short?mode=market&from=eth&to=sol&collateral=usdc&pool=sol-usdc

GM pools parameters

Use the /pools/details path to open a specific GM pool with a pre-selected operation and mode. The market parameter must be the pool's contract address, not a token symbol.

ParameterDescriptionAccepted values
marketThe GM or GLV pool to openContract address (hex) of the market or GLV token
operationThe deposit or withdrawal directionDeposit, Withdrawal, Shift (case-sensitive)
modeThe deposit or withdrawal modeSingle, Pair (case-sensitive)
warning

The operation and mode values are case-sensitive. Deposit, Withdrawal, Shift, Single, and Pair must be capitalized exactly as shown. Values in any other case are ignored and the page opens with its default state.

Examples

  • https://app.gmx.io/#/pools/details?market=0x450bb6774Dd8a756274E0ab4107953259d2ac541&operation=Deposit&mode=Single
  • https://app.gmx.io/#/pools/details?market=0x450bb6774Dd8a756274E0ab4107953259d2ac541&operation=Withdrawal&mode=Pair
  • https://app.gmx.io/#/pools/details?market=0x450bb6774Dd8a756274E0ab4107953259d2ac541&operation=Deposit&mode=Pair