Skip to main content

Changelog

1.5.0-alpha-8 — March 11, 2026

This release expands the GmxApiSdk read surface to cover more GMX HTTP endpoints and exports the matching typed response helpers.

  • Added fetchMarkets(), fetchMarketsTickers(params), fetchTokens(), fetchPairs(), fetchRates(params), fetchApy(params), fetchPerformanceAnnualized(params), and fetchPerformanceSnapshots(params) to GmxApiSdk in @gmx-io/sdk/v2.
  • Added the matching @gmx-io/sdk/v2 type exports for APY, market tickers, pairs, rates, and performance responses.

1.5.0-alpha-7 — March 9, 2026

This release improves TypeScript type resolution for projects that consume the SDK in CommonJS mode.

  • Added typesVersions mappings to @gmx-io/sdk so TypeScript resolves subpath types correctly when moduleResolution is set to "node" or "node10" in tsconfig.json. Projects using "bundler" or "node16" module resolution already resolve types through the exports field and are unaffected.
  • Covers the root client entrypoints (@gmx-io/sdk, @gmx-io/sdk/v1, @gmx-io/sdk/v2) as well as config, ABI, utility, prebuilt, and type-only subpaths.
  • No runtime SDK API methods changed in this release. The update is packaging and type-resolution focused.

1.5.0-alpha-6 — March 9, 2026

This release adds OHLCV reads to GmxApiSdk and renames address-filtered API SDK params to match the underlying REST API.

  • Added fetchOhlcv(params) to GmxApiSdk in @gmx-io/sdk/v2. This method wraps fetchApiOhlcv and returns OhlcvCandle[] from /prices/ohlcv.
  • Renamed fetchPositionsInfo(params) and fetchOrders(params) params from account to address. The underlying fetchApiPositionsInfo and fetchApiOrders helpers now use address as well.
  • Added OhlcvCandle and OhlcvParams exports in @gmx-io/sdk/v2, plus the @gmx-io/sdk/types/prices subpath export for price candle types.

1.5.0-alpha-5 — February 28, 2026

This release fixes a potential negative pool amount edge case in position price impact calculations.

  • getPriceImpactForPosition in @gmx-io/sdk/utils/fees now accepts an optional fallbackToZero option. When enabled, negative pool amounts are clamped to zero instead of producing invalid results.
  • getContractPositionDynamicFees in @gmx-io/sdk/utils/positions uses fallbackToZero: true when calling getPriceImpactForPosition internally, preventing errors from negative pool states.

1.5.0-alpha-4 — February 13, 2026

This release adds five new synthetic markets on Arbitrum and expands the GmxApiSdk class with positions and orders support.

  • Added fetchPositionsInfo(params) and fetchOrders(params) methods to GmxApiSdk in @gmx-io/sdk/v2. These methods wrap fetchApiPositionsInfo and fetchApiOrders respectively.
  • Added five new Arbitrum markets: XAUT/USD [WBTC-USDC], LIT/USD [WETH-USDC], IP/USD [WBTC-USDC], CC/USD [WBTC-USDC], and MET/USD [WBTC-USDC]. All five index tokens are synthetic.
  • Added corresponding token configurations for XAUT, LIT (Lighter), IP (Story), CC (Canton), and MET (Meteora) on Arbitrum.

1.5.0-alpha-3 — February 13, 2026

This release introduces the GmxApiSdk client and adds REST API support for positions, orders, and fee utilities.

  • Added GmxApiSdk class exported from @gmx-io/sdk/v2. Instantiate it with a chainId to call GMX REST API endpoints directly. Provides fetchMarketsInfo() and fetchTokensData() methods. Supported on Arbitrum, Avalanche, and Arbitrum Sepolia; throws at construction time for unsupported chains.
  • Added getPositionInfo utility to @gmx-io/sdk/utils/positions. Computes a comprehensive position summary (entry price, PnL, leverage, liquidation price, net value, fees) from a raw position and market data.
  • Added getContractPositionDynamicFees to @gmx-io/sdk/utils/positions. Calculates dynamic fees (borrowing, funding, closing) for a position given the current market fee state.
  • Added fetchApiPositionsInfo to @gmx-io/sdk/utils/positions. Fetches position data from the GMX REST API instead of on-chain multicalls (available on Arbitrum, Avalanche, and Arbitrum Sepolia).
  • Added fetchApiOrders to @gmx-io/sdk/utils/orders. Fetches order data from the GMX REST API.
  • Added isApiSupported(chainId) to @gmx-io/sdk/configs/api. Returns true for chains that have a GMX REST API endpoint (Arbitrum, Avalanche, and Arbitrum Sepolia).
  • Added FLOAT_PRECISION_SQRT_DECIMALS (15) and FLOAT_PRECISION_SQRT (10n ** 15n) constants to @gmx-io/sdk/utils/numbers.

1.5.0-alpha-2 — February 11, 2026

This release adds fee utilities and Solidity error decoding helpers.

  • Added getMaxNegativeImpactBps to @gmx-io/sdk/utils/fees. Converts a market's maxPositionImpactFactorNegative to basis points.
  • Added tryDecodeCustomError, decodeErrorFromViemError, and extractErrorDataFromViemError to @gmx-io/sdk/utils/errors. These functions decode custom Solidity errors from viem error objects using the GMX CustomErrors ABI.

1.3.1 — September 15, 2025

This release fixes order payload forwarding.

  • Fixed dataList not being forwarded to the on-chain order payload in createIncreaseOrder, createDecreaseOrder, and createSwapOrder. The dataList parameter (optional string[]) now defaults to [] when omitted.

1.3.0 — September 15, 2025

This release adds GMX v2.2 contract support and position impact fields.

  • Added support for GMX v2.2 contracts. Updated SyntheticsReader and ClaimHandler ABIs; added SmartAccount ABI.
  • Added pendingImpactUsd and closePriceImpactDeltaUsd fields to PositionInfo.
  • Added nextPendingImpactDeltaUsd and potentialPriceImpactDiffUsd fields to NextPositionValues.
  • Fixed position impact capping logic in getNextPositionValuesForIncreaseTrade to use nextSizeUsd instead of sizeDeltaUsd.

1.2.1 — August 25, 2025

This release fixes Botanix client initialization.

  • Fixed Botanix viem client initialization. Added Botanix to BATCH_CONFIGS (it was missing, which caused the default PublicClient to fail on Botanix). Changed batch config access to use optional chaining (?.) so an unsupported chain ID doesn't throw at client construction time.

1.2.0 — July 17, 2025

This release adds three new markets across Arbitrum and Avalanche.

  • Added market and token configurations for three new markets: PUMP/USD [WBTC-USDC] and ARB/USD [ARB-ARB] on Arbitrum, and PUMP/USD [WAVAX-USDC] on Avalanche. PUMP is a synthetic token.

1.1.0 — June 3, 2025

This release adds four new synthetic markets on Arbitrum.

  • Added market and token configurations for four new markets on Arbitrum: CRV/USD [WETH-USDC], XMR/USD [WBTC-USDC], MOODENG/USD [WBTC-USDC], and PI/USD [WBTC-USDC]. All four index tokens are synthetic.

1.0.5 — May 26, 2025

This release fixes uiFeeReceiver propagation in order creation.

  • Fixed uiFeeReceiver not being read from sdk.config.settings.uiFeeReceiverAccount in createIncreaseOrder, createDecreaseOrder, and createSwapOrder. Previously all three functions passed zeroAddress unconditionally.

1.0.3 — May 23, 2025

This release adds the isTrigger parameter and fixes order type forwarding in createDecreaseOrder.

  • Added isTrigger parameter to orders.createDecreaseOrder. When true, the order type is taken from decreaseAmounts.triggerOrderType; when false or omitted, the order type defaults to Market Decrease.
  • Fixed orderType not being forwarded correctly in orders.createDecreaseOrder.

1.0.0 — April 30, 2025

This is the initial stable release. It removes the deprecated subgraphUrl config key and adds dual ESM/CJS module support.

  • Removed subgraphUrl from GmxSdkConfig. Use subsquidUrl instead.
  • Added support for both ESM and CJS module formats. The package ships two builds: build/esm/ and build/cjs/.
  • Changed the default module format from ESM to CJS. The main entry point resolves to build/cjs/src/index.js.