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.
| Parameter | Location | Description | Accepted values |
|---|---|---|---|
tradeType | Path segment | The type of trade | long, short, swap (case-insensitive) |
mode | Query parameter | The order mode | market, limit, stopmarket, trigger, twap (case-insensitive); tpsl is an alias for trigger |
from | Query parameter | The token used for payment | Token symbol such as eth, btc, usdc (case-insensitive) |
to or market | Query parameter | The asset to long, short, or swap to | Token symbol such as eth, btc, uni (case-insensitive); to and market are interchangeable |
collateral | Query parameter | The collateral asset | Token symbol such as eth, usdc, usdt (case-insensitive) |
pool | Query parameter | The liquidity pool for the trade | Pool name such as weth-usdc, btc-usdc (case-insensitive) |
chainId | Query parameter | Triggers a network switch on load | 42161 (Arbitrum), 43114 (Avalanche), 4326 (MegaETH), or a GMX Account source chain: 1 (Ethereum), 8453 (Base), 56 (BNB) |
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=solhttps://app.gmx.io/trade/short?mode=limit&from=eth&to=btchttps://app.gmx.io/trade/short?mode=market&from=eth&to=btc&collateral=usdchttps://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.
| Parameter | Description | Accepted values |
|---|---|---|
market | The GM or GLV pool to open | Contract address (hex) of the market or GLV token |
operation | The deposit or withdrawal direction | Deposit, Withdrawal, Shift (case-sensitive) |
mode | The deposit or withdrawal mode | Single, Pair (case-sensitive) |
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=Singlehttps://app.gmx.io/pools/details?market=0x450bb6774Dd8a756274E0ab4107953259d2ac541&operation=Withdrawal&mode=Pairhttps://app.gmx.io/pools/details?market=0x450bb6774Dd8a756274E0ab4107953259d2ac541&operation=Deposit&mode=Pair