Skip to main content

Frontend Integration

The GMX protocol consists of smart contracts deployed on blockchains.

Users can interact directly with the smart contracts using blockchain explorers such as Arbiscan and SnowTrace.

The GMX frontend repository provides code to simplify contract interaction and to view protocol information and can be deployed by any community member.

A deployed instance of the GMX frontend is available at https://app.gmx.io/.

A backup instance of the GMX frontend is available at https://gmxalt.io/.

Testnet frontend

A testnet GMX frontend is available at https://test.gmx-interface.pages.dev/. Use it to test against testnet networks (Arbitrum Sepolia and Avalanche Fuji) and to access debug mode tooling.

Running a frontend

To run the GMX frontend locally, follow the instructions in the GMX frontend repository. You can also deploy it using a static hosting service such as Vercel, Netlify, or Cloudflare Pages.

GMX orders support a UI fee: you pass in a receiving address, and it receives fees when the order executes. These fees are charged on top of the base fees.

The GMX interface lets you configure a UI fee receiver and custom RPC URLs by adding environment variables to the .env file in the project root.

UI fee receiver

To configure the UI fee receiver, add VITE_APP_UI_FEE_RECEIVER to your .env file. Set it to the wallet address that receives UI fees.

VITE_APP_UI_FEE_RECEIVER=0xYourReceiverAddressHere

The interface only sets uiFeeReceiver for orders. To set it for deposits and withdrawals, you must add custom code.

Custom RPC URLs

To override the default RPC endpoints for Arbitrum, Avalanche, or Botanix, add the corresponding variable to your .env file. Each variable takes a JSON array of RPC URLs, which the interface uses as fallback endpoints.

VITE_APP_ARBITRUM_RPC_URLS=["https://arb-rpc-url-1", "https://arb-rpc-url-2"]
VITE_APP_AVALANCHE_RPC_URLS=["https://avax-rpc-url-1", "https://avax-rpc-url-2"]
VITE_APP_BOTANIX_RPC_URLS=["https://botanix-rpc-url-1", "https://botanix-rpc-url-2"]