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
searchAliasesto 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, includingMARKET_HOURS_MARKETSandMarketHoursConfig. - 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 usegetApiUrl(chainId)instead of hardcoding the host. generateSubaccount(mainSigner)now returns an AES-encryptedprivateKeyvalue.- Added
decryptSubaccountPrivateKey(encryptedPrivateKey, mainAccountAddress)andcreateSubaccountSignerFromConfig(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
HttpClientWithFallbackand theIHttptype from@gmx-io/sdk/v2. - Added the
apiconstructor option toGmxApiSdk, letting integrations inject a custom HTTP client instead of using the defaultHttpClientWithFallback. GmxApiSdkuses 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
GmxApiSdkin@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 manualprepareOrder → signOrder → submitOrderflow.prepareEditOrder,prepareCancelOrder,prepareCollateral, andfetchOrderStatusround 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 aSubaccountApprovaland stores it, andclearSubaccount()removes it. Once active,executeExpressOrdersigns with the subaccount automatically. The lower-level helpersfetchSubaccountStatus,prepareSubaccountApproval, andsignSubaccountApprovalare also exposed, alongsidesubaccountAddress,hasActiveSubaccount, andsubaccountApprovalMessagegetters. - Added wallet helpers to
GmxApiSdk:fetchWalletBalances({ address }),fetchAllowances({ address, spender }), andbuildApproveTransaction(params)for building ERC-20 approval calldata. - Added a signer abstraction.
IAbstractSigneris the interfaceGmxApiSdkmethods accept for signing, andPrivateKeySigneris 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/apito the new peer pairhttps://{chain}.gmxapi.io/v1andhttps://{chain}.gmxapi.ai/v1for Arbitrum, Avalanche, Botanix, and MegaETH.getApiUrl(chainId)returns the default peer, andgetApiFallbackUrls(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)toGmxApiSdkin@gmx-io/sdk/v2. This method wraps/staking/powerand returnsStakingPowerResponse. - Added
fetchBuybackWeeklyStats()toGmxApiSdkin@gmx-io/sdk/v2. This method wraps/buyback/weekly-statsand returnsBuybackWeeklyStatsResponse. - Added the matching
@gmx-io/sdk/v2type 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), andfetchPerformanceSnapshots(params)toGmxApiSdkin@gmx-io/sdk/v2. - Added the matching
@gmx-io/sdk/v2type 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
typesVersionsmappings to@gmx-io/sdkso TypeScript resolves subpath types correctly whenmoduleResolutionis set to"node"or"node10"intsconfig.json. Projects using"bundler"or"node16"module resolution already resolve types through theexportsfield 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)toGmxApiSdkin@gmx-io/sdk/v2. This method wrapsfetchApiOhlcvand returnsOhlcvCandle[]from/prices/ohlcv. - Renamed
fetchPositionsInfo(params)andfetchOrders(params)params fromaccounttoaddress. The underlyingfetchApiPositionsInfoandfetchApiOrdershelpers now useaddressas well. - Added
OhlcvCandleandOhlcvParamsexports in@gmx-io/sdk/v2, plus the@gmx-io/sdk/types/pricessubpath 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.
getPriceImpactForPositionin@gmx-io/sdk/utils/feesnow accepts an optionalfallbackToZerooption. When enabled, negative pool amounts are clamped to zero instead of producing invalid results.getContractPositionDynamicFeesin@gmx-io/sdk/utils/positionsusesfallbackToZero: truewhen callinggetPriceImpactForPositioninternally, 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)andfetchOrders(params)methods toGmxApiSdkin@gmx-io/sdk/v2. These methods wrapfetchApiPositionsInfoandfetchApiOrdersrespectively. - 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
GmxApiSdkclass exported from@gmx-io/sdk/v2. Instantiate it with achainIdto call GMX API endpoints directly. ProvidesfetchMarketsInfo()andfetchTokensData()methods. Supported on Arbitrum, Avalanche, and Arbitrum Sepolia; throws at construction time for unsupported chains. - Added
getPositionInfoutility 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
getContractPositionDynamicFeesto@gmx-io/sdk/utils/positions. Calculates dynamic fees (borrowing, funding, closing) for a position given the current market fee state. - Added
fetchApiPositionsInfoto@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
fetchApiOrdersto@gmx-io/sdk/utils/orders. Fetches order data from the GMX API. - Added
isApiSupported(chainId)to@gmx-io/sdk/configs/api. Returnstruefor chains that have a GMX API endpoint (Arbitrum, Avalanche, and Arbitrum Sepolia). - Added
FLOAT_PRECISION_SQRT_DECIMALS(15) andFLOAT_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
getMaxNegativeImpactBpsto@gmx-io/sdk/utils/fees. Converts a market'smaxPositionImpactFactorNegativeto basis points. - Added
tryDecodeCustomError,decodeErrorFromViemError, andextractErrorDataFromViemErrorto@gmx-io/sdk/utils/errors. These functions decode custom Solidity errors from viem error objects using the GMXCustomErrorsABI.
1.3.1 — September 15, 2025
This release fixes order payload forwarding.
- Fixed
dataListnot being forwarded to the on-chain order payload increateIncreaseOrder,createDecreaseOrder, andcreateSwapOrder. ThedataListparameter (optionalstring[]) 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
SyntheticsReaderandClaimHandlerABIs; addedSmartAccountABI. - Added
pendingImpactUsdandclosePriceImpactDeltaUsdfields toPositionInfo. - Added
nextPendingImpactDeltaUsdandpotentialPriceImpactDiffUsdfields toNextPositionValues. - Fixed position impact capping logic in
getNextPositionValuesForIncreaseTradeto usenextSizeUsdinstead ofsizeDeltaUsd.
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 defaultPublicClientto 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
uiFeeReceivernot being read fromsdk.config.settings.uiFeeReceiverAccountincreateIncreaseOrder,createDecreaseOrder, andcreateSwapOrder. Previously all three functions passedzeroAddressunconditionally.
1.0.3 — May 23, 2025
This release adds the isTrigger parameter and fixes order type forwarding in createDecreaseOrder.
- Added
isTriggerparameter toorders.createDecreaseOrder. Whentrue, the order type is taken fromdecreaseAmounts.triggerOrderType; whenfalseor omitted, the order type defaults toMarket Decrease. - Fixed
orderTypenot being forwarded correctly inorders.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
subgraphUrlfromGmxSdkConfig. UsesubsquidUrlinstead. - Added support for both ESM and CJS module formats. The package ships two builds:
build/esm/andbuild/cjs/. - Changed the default module format from ESM to CJS. The
mainentry point resolves tobuild/cjs/src/index.js.