Skip to main content

express

This module exports constants and helpers for Express Trading, subaccounts, and relay flows.

Exports

This module provides constants and helper functions for Express Trading integrations.

Constants

  • DEFAULT_SUBACCOUNT_EXPIRY_DURATION -- default One-Click Trading session length (7 days)
  • DEFAULT_SUBACCOUNT_MAX_ALLOWED_COUNT -- maximum allowed subaccount count (90)
  • DEFAULT_PERMIT_DEADLINE_DURATION -- default ERC-20 permit deadline (1 hour)
  • DEFAULT_EXPRESS_ORDER_DEADLINE_DURATION -- default express order deadline (1 hour)
  • EXPRESS_EXTRA_EXECUTION_FEE_BUFFER_BPS -- extra execution fee buffer in basis points (1000 bps)
import { EXPRESS_EXTRA_EXECUTION_FEE_BUFFER_BPS } from "@gmx-io/sdk/configs/express";

Helper functions

getGasPaymentTokens

getGasPaymentTokens(chainId: number): string[]

Returns the list of token addresses accepted for gas payment on the given chain. For example, on Arbitrum this returns the addresses of USDC, WETH, and USDT.

getDefaultGasPaymentToken

getDefaultGasPaymentToken(chainId: number): string

Returns the default gas payment token address for the given chain. For active chains, this is the first token in the gas payment list: USDC on Arbitrum and Avalanche, and USDM on MegaETH.

getRelayerFeeToken

getRelayerFeeToken(chainId: number): Token

Returns the wrapped native token for the given chain. The relayer fee is denominated in this token.

import { getGasPaymentTokens, getDefaultGasPaymentToken } from "@gmx-io/sdk/configs/express";

const gasTokens = getGasPaymentTokens(42161); // Arbitrum gas payment token addresses
const defaultToken = getDefaultGasPaymentToken(42161); // USDC address on Arbitrum

Use this module only if your integration exposes express or subaccount flows directly.