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 factorsutils/— fee calculations, price impact, swap routing, position sizing, number formatting, error parsing, and other computation helperstypes/— type-only entrypoints for SDK configs, markets, tokens, orders, positions, fees, price candles, trade flows, referrals, TWAP, trade history, and Subsquid schema types
Additional public utility subpaths are available for lower-level integrations, including @gmx-io/sdk/utils/orderTransactions, @gmx-io/sdk/utils/express, @gmx-io/sdk/utils/subaccount, @gmx-io/sdk/utils/rpc, @gmx-io/sdk/utils/signer, @gmx-io/sdk/utils/metrics, @gmx-io/sdk/utils/multichain, @gmx-io/sdk/utils/gas/*, and @gmx-io/sdk/utils/twap/uiFeeReceiver. These are lower-level building blocks used by SDK v2 order, subaccount, GMX Account, and gas flows; prefer GmxApiSdk from @gmx-io/sdk/v2 unless you need to compose those primitives directly. To group the parts of a TWAP order, pass each order's data list and UI fee receiver (order.data and order.uiFeeReceiver on an SDK v1 Order) to decodeOrderTwapParams(dataList, uiFeeReceiver) from @gmx-io/sdk/utils/twap/uiFeeReceiver. It returns OrderDataListMetadata with the twapId and numberOfParts that the parts share, or undefined when the order isn't part of a TWAP order. The SDK v2 Order Examples page documents the primary transaction request and response types that wrap these utilities.
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 API reference modules that are covered manually. Some low-level SDK v2 utility subpaths are intentionally documented through the SDK v2 guide until they need standalone reference pages.