Skip to main content

Changelog

1.5.0-alpha-13 — April 24, 2026

This release updates generated market and token metadata for new Arbitrum energy markets and includes a swap-routing fallback fix.

  • Added Arbitrum SDK config entries for WTIOIL/USD, BRENTOIL/USD, and NATGAS/USD markets and their synthetic index tokens.
  • Added searchAliases to token config metadata so integrations can expose alternate ticker search terms such as CL and BZ.
  • Added market-hours leverage config through @gmx-io/sdk/configs/marketHours, including MARKET_HOURS_MARKETS and MarketHoursConfig.
  • Fixed a swap-routing fallback case so route selection handles zero-output candidates correctly.

1.5.0-alpha-12 — April 24, 2026

This release updates API host configuration and adds helpers for restoring encrypted subaccount keys.

  • Updated the Arbitrum Sepolia API URL returned by getApiUrl(421614). Test hosts can change between alpha releases, so integrations should use getApiUrl(chainId) instead of hardcoding the host.
  • generateSubaccount(mainSigner) now returns an AES-encrypted privateKey value.
  • Added decryptSubaccountPrivateKey(encryptedPrivateKey, mainAccountAddress) and createSubaccountSignerFromConfig(encryptedPrivateKey, mainAccountAddress) to @gmx-io/sdk/utils/subaccount.

1.5.0-alpha-11 — April 23, 2026

This release improves API peer handling and custom HTTP client injection for GmxApiSdk.

  • Exported HttpClientWithFallback and the IHttp type from @gmx-io/sdk/v2.
  • Added the api constructor option to GmxApiSdk, letting integrations inject a custom HTTP client instead of using the default HttpClientWithFallback.
  • GmxApiSdk uses the configured API peer list by default and can fail over between peer hosts for server or network errors.

1.5.0-alpha-10 — April 14, 2026

This release adds order submission, one-click-trading subaccounts, wallet helpers, and a signer abstraction to GmxApiSdk, and migrates the SDK's API hosts to the new peer-region deployment.

  • Added order submission, edit, and cancellation to GmxApiSdk in @gmx-io/sdk/v2. executeExpressOrder(request, signer) prepares, signs, and submits an order in one call via the GMX API and Gelato relay. Integrations that manage their own signing UX can use the manual prepareOrder → signOrder → submitOrder flow. prepareEditOrder, prepareCancelOrder, prepareCollateral, and fetchOrderStatus round out the order lifecycle. SDK v1 and direct contracts remain available for RPC-based integrations.
  • Added one-click-trading (1CT) subaccount support to GmxApiSdk. generateSubaccount(mainSigner) deterministically derives a subaccount from the main signer's signature, activateSubaccount(mainSigner, { expiresInSeconds?, maxAllowedCount? }) signs a SubaccountApproval and stores it, and clearSubaccount() removes it. Once active, executeExpressOrder signs with the subaccount automatically. The lower-level helpers fetchSubaccountStatus, prepareSubaccountApproval, and signSubaccountApproval are also exposed, alongside subaccountAddress, hasActiveSubaccount, and subaccountApprovalMessage getters.
  • Added wallet helpers to GmxApiSdk: fetchWalletBalances({ address }), fetchAllowances({ address, spender }), and buildApproveTransaction(params) for building ERC-20 approval calldata.
  • Added a signer abstraction. IAbstractSigner is the interface GmxApiSdk methods accept for signing, and PrivateKeySigner is a built-in implementation for server-side integrations. Both are exported from @gmx-io/sdk/v2.
  • Migrated mainnet API base URLs in @gmx-io/sdk/configs/api to the new peer pair https://{chain}.gmxapi.io/v1 and https://{chain}.gmxapi.ai/v1 for Arbitrum, Avalanche, Botanix, and MegaETH. getApiUrl(chainId) returns the default peer, and getApiFallbackUrls(chainId) returns the additional peer list.

1.5.0-alpha-9 — March 25, 2026

This release expands GmxApiSdk with staking-power and buyback reads.

  • Added fetchStakingPower(params) to GmxApiSdk in @gmx-io/sdk/v2. This method wraps /staking/power and returns StakingPowerResponse.
  • Added fetchBuybackWeeklyStats() to GmxApiSdk in @gmx-io/sdk/v2. This method wraps /buyback/weekly-stats and returns BuybackWeeklyStatsResponse.
  • Added the matching @gmx-io/sdk/v2 type exports for staking-power and buyback responses.

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 GMX 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 GMX 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 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 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 API.
  • Added isApiSupported(chainId) to @gmx-io/sdk/configs/api. Returns true for chains that have a GMX 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.