Skip to main content

Useful modules

The GMX SDK exports constants, types, and utility functions that you can import directly without going through the GmxSdk class. These exports are organized into three top-level categories:

  • configs/ — chain IDs, contract addresses, token metadata, market parameters, oracle keeper URLs, and fee factors
  • utils/ — fee calculations, price impact, swap routing, position sizing, number formatting, error parsing, and other computation helpers
  • types/ — type-only entrypoints for SDK configs, markets, tokens, orders, positions, fees, price candles, trade flows, referrals, TWAP, trade history, and Subsquid schema types

Use these exports to implement custom logic or to pre-compute values before passing them to SDK methods. Import any export directly from its module path, for example:

import { getOracleKeeperUrl } from "@gmx-io/sdk/configs/oracleKeeper";
import { getFundingFactorPerPeriod } from "@gmx-io/sdk/utils/fees";
import { formatUsd } from "@gmx-io/sdk/utils/numbers";
import type { MarketsInfoData } from "@gmx-io/sdk/types/markets";

See the sub-pages in this section for the full API reference for each module.