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 an optional URL path segment, not a query parameter. If you omit it or use an unrecognized value (for example, /trade?to=btc), the trade page keeps its current trade type. About two seconds after the trade parameters are applied, the app removes mode, from, to, market, pool, and collateral from the URL. Other query parameters, such as utm_source, stay in the URL, and the ref referral parameter is removed once the referral code is stored.

Canonical GMX URLs don't include #. Legacy #/... links remain supported and are rewritten to path URLs without reloading the page.

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 load42161 (Arbitrum), 43114 (Avalanche), 4326 (MegaETH), or a GMX Account source chain: 1 (Ethereum), 8453 (Base), 56 (BNB)
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.

The chainId parameter works on any app page, not only the trade page. When a trade link includes it, the app switches networks first and then applies the trade parameters. For a GMX Account source chain, the app may also switch your GMX Account settlement chain to one that supports that source chain. Unsupported chain IDs are ignored, and the app removes chainId from the URL after handling it. If your smart wallet isn't available on the requested chain, the app shows an error message instead of switching.

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