@gmx-io/sdk 1.4.2 → 2.0.0-alpha-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/src/configs/dataStore.js +6 -2
- package/build/esm/src/configs/dataStore.js +3 -0
- package/build/types/src/configs/dataStore.d.ts +1 -0
- package/build/types/src/modules/markets/query-builders.d.ts +1 -1
- package/build/types/src/types/markets.d.ts +1 -0
- package/build/types/src/types/subsquid.d.ts +13 -0
- package/package.json +5 -3
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.POSITION_IMPACT_POOL_DISTRIBUTION_RATE_KEY = exports.MIN_POSITION_IMPACT_POOL_AMOUNT_KEY = exports.POSITION_IMPACT_POOL_AMOUNT_KEY = exports.LENT_POSITION_IMPACT_POOL_AMOUNT_KEY = exports.MAX_LENDABLE_IMPACT_FACTOR_FOR_WITHDRAWALS_KEY = exports.MAX_LENDABLE_IMPACT_USD_KEY = exports.MAX_LENDABLE_IMPACT_FACTOR_KEY = exports.CLAIMABLE_COLLATERAL_TIME_DIVISOR_KEY = exports.CLAIMABLE_COLLATERAL_REDUCTION_FACTOR_KEY = exports.CLAIMABLE_COLLATERAL_DELAY_KEY = exports.MAX_POSITION_IMPACT_FACTOR_FOR_LIQUIDATIONS_KEY = exports.MAX_PNL_FACTOR_FOR_TRADERS_KEY = exports.MAX_PNL_FACTOR_FOR_DEPOSITS_KEY = exports.MAX_PNL_FACTOR_FOR_WITHDRAWALS_KEY = exports.MAX_PNL_FACTOR_KEY = exports.THRESHOLD_FOR_DECREASE_FUNDING = exports.THRESHOLD_FOR_STABLE_FUNDING = exports.MAX_FUNDING_FACTOR_PER_SECOND = exports.MIN_FUNDING_FACTOR_PER_SECOND = exports.FUNDING_DECREASE_FACTOR_PER_SECOND = exports.FUNDING_INCREASE_FACTOR_PER_SECOND = exports.FUNDING_EXPONENT_FACTOR_KEY = exports.FUNDING_FACTOR_KEY = exports.TOTAL_BORROWING_KEY = exports.CUMULATIVE_BORROWING_FACTOR_KEY = exports.BORROWING_EXPONENT_FACTOR_KEY = exports.BORROWING_FACTOR_KEY = exports.NONCE_KEY = exports.MAX_OPEN_INTEREST_KEY = exports.OPEN_INTEREST_RESERVE_FACTOR_KEY = exports.RESERVE_FACTOR_KEY = exports.MAX_POOL_AMOUNT_KEY = exports.MAX_POOL_USD_FOR_DEPOSIT_KEY = exports.POOL_AMOUNT_KEY = exports.OPEN_INTEREST_IN_TOKENS_KEY = exports.OPEN_INTEREST_KEY = exports.FEE_RECEIVER_POSITION_FACTOR_KEY = exports.FEE_RECEIVER_SWAP_FACTOR_KEY = exports.FEE_RECEIVER_WITHDRAWAL_FACTOR_KEY = exports.BORROWING_FEE_RECEIVER_FACTOR_KEY = exports.FEE_RECEIVER_DEPOSIT_FACTOR_KEY = exports.WITHDRAWAL_FEE_FACTOR_KEY = exports.ATOMIC_SWAP_FEE_FACTOR_KEY = exports.SWAP_FEE_FACTOR_KEY = exports.SWAP_IMPACT_EXPONENT_FACTOR_KEY = exports.SWAP_IMPACT_FACTOR_KEY = exports.POSITION_FEE_FACTOR_KEY = exports.POSITION_IMPACT_EXPONENT_FACTOR_KEY = exports.MAX_POSITION_IMPACT_FACTOR_KEY = exports.POSITION_IMPACT_FACTOR_KEY = void 0;
|
|
4
4
|
exports.SUBACCOUNT_EXPIRES_AT = exports.ABOVE_OPTIMAL_USAGE_BORROWING_FACTOR = exports.BASE_BORROWING_FACTOR = exports.OPTIMAL_USAGE_FACTOR = exports.MAX_AUTO_CANCEL_ORDERS_KEY = exports.GLV_PER_MARKET_GAS_LIMIT = exports.GLV_WITHDRAWAL_GAS_LIMIT = exports.GLV_DEPOSIT_GAS_LIMIT = exports.GLV_SHIFT_MIN_INTERVAL = exports.GLV_SHIFT_LAST_EXECUTED_AT = exports.IS_GLV_MARKET_DISABLED = exports.GLV_MAX_MARKET_TOKEN_BALANCE_AMOUNT = exports.MIN_COLLATERAL_FACTOR_FOR_LIQUIDATION_KEY = exports.GLV_MAX_MARKET_TOKEN_BALANCE_USD = exports.SUBACCOUNT_AUTO_TOP_UP_AMOUNT = exports.SUBACCOUNT_INTEGRATION_ID = exports.SUBACCOUNT_ORDER_ACTION = exports.SUBACCOUNT_ACTION_COUNT = exports.MAX_ALLOWED_SUBACCOUNT_ACTION_COUNT = exports.SUBACCOUNT_LIST_KEY = exports.UI_FEE_FACTOR = exports.IS_MARKET_DISABLED_KEY = exports.AFFILIATE_REWARD_KEY = exports.VIRTUAL_INVENTORY_FOR_SWAPS_KEY = exports.VIRTUAL_INVENTORY_FOR_POSITIONS_KEY = exports.VIRTUAL_MARKET_ID_KEY = exports.VIRTUAL_TOKEN_ID_KEY = exports.CLAIMABLE_FUNDING_AMOUNT = exports.ACCOUNT_ORDER_LIST_KEY = exports.ORDER_LIST_KEY = exports.POSITION_LIST_KEY = exports.MARKET_LIST_KEY = exports.ESTIMATED_GAS_FEE_MULTIPLIER_FACTOR = exports.ESTIMATED_GAS_FEE_PER_ORACLE_PRICE = exports.ESTIMATED_GAS_FEE_BASE_AMOUNT_V2_1 = exports.NATIVE_TOKEN_TRANSFER_GAS_LIMIT_KEY = exports.TOKEN_TRANSFER_GAS_LIMIT_KEY = exports.SINGLE_SWAP_GAS_LIMIT_KEY = exports.SHIFT_GAS_LIMIT_KEY = exports.SWAP_ORDER_GAS_LIMIT_KEY = exports.DECREASE_ORDER_GAS_LIMIT_KEY = exports.INCREASE_ORDER_GAS_LIMIT_KEY = exports.WITHDRAWAL_GAS_LIMIT_KEY = exports.DEPOSIT_GAS_LIMIT_KEY = exports.MAX_LEVERAGE_KEY = exports.MIN_POSITION_SIZE_USD_KEY = exports.MIN_COLLATERAL_FACTOR_FOR_OPEN_INTEREST_MULTIPLIER_KEY = exports.MIN_COLLATERAL_FACTOR_KEY = exports.MIN_COLLATERAL_USD_KEY = exports.SWAP_IMPACT_POOL_AMOUNT_KEY = void 0;
|
|
5
|
-
exports.
|
|
6
|
-
exports.claimsDisabledKey = exports.claimTermsKey = exports.gaslessFeatureDisabledKey = exports.priceFeedKey = exports.multichainBalanceKey = exports.subaccountAutoTopUpAmountKey = exports.subaccountIntegrationIdKey = exports.maxLendableImpactUsdKey = exports.maxLendableImpactFactorForWithdrawalsKey = exports.maxLendableImpactFactorKey = exports.subaccountActionCountKey = exports.maxAllowedSubaccountActionCountKey = exports.subaccountListKey = exports.uiFeeFactorKey = exports.maxPoolAmountKey = exports.maxPoolUsdForDepositKey = exports.isMarketDisabledKey = exports.affiliateRewardKey = exports.virtualInventoryForPositionsKey = exports.virtualInventoryForSwapsKey = exports.virtualMarketIdKey = exports.virtualTokenIdKey = exports.claimableFundingAmountKey = exports.hashedPositionKey = exports.minCollateralFactorForOpenInterest = exports.minCollateralFactorForLiquidationKey = exports.minCollateralFactorKey = exports.accountOrderListKey = exports.swapOrderGasLimitKey = exports.decreaseOrderGasLimitKey = exports.increaseOrderGasLimitKey = exports.singleSwapGasLimitKey = exports.shiftGasLimitKey = void 0;
|
|
5
|
+
exports.depositGasLimitKey = exports.orderKey = exports.swapImpactPoolAmountKey = exports.maxPositionImpactFactorForLiquidationsKey = exports.positionImpactPoolDistributionRateKey = exports.minPositionImpactPoolAmountKey = exports.positionImpactPoolAmountKey = exports.maxPnlFactorKey = exports.thresholdForDecreaseFundingKey = exports.thresholdForStableFundingKey = exports.maxFundingFactorPerSecondKey = exports.minFundingFactorPerSecondKey = exports.fundingDecreaseFactorPerSecondKey = exports.fundingIncreaseFactorPerSecondKey = exports.fundingExponentFactorKey = exports.fundingFactorKey = exports.totalBorrowingKey = exports.cumulativeBorrowingFactorKey = exports.borrowingExponentFactorKey = exports.borrowingFactorKey = exports.maxOpenInterestKey = exports.openInterestReserveFactorKey = exports.reserveFactorKey = exports.poolAmountKey = exports.openInterestInTokensKey = exports.openInterestKey = exports.withdrawalFeeFactorKey = exports.atomicSwapFeeFactorKey = exports.swapFeeFactorKey = exports.swapImpactExponentFactorKey = exports.swapImpactFactorKey = exports.positionFeeFactorKey = exports.maxPositionImpactFactorKey = exports.positionImpactExponentFactorKey = exports.positionImpactFactorKey = exports.isGlvDisabledKey = exports.glvMaxMarketTokenBalanceAmountKey = exports.glvMaxMarketTokenBalanceUsdKey = exports.glvShiftMinIntervalKey = exports.glvShiftLastExecutedAtKey = exports.subaccountExpiresAtKey = exports.USE_OPEN_INTEREST_IN_TOKENS_FOR_BALANCE = exports.GENERAL_CLAIM_FEATURE_DISABLED = exports.CLAIM_TERMS_KEY = exports.GMX_SIMULATION_ORIGIN = exports.REQUEST_EXPIRATION_TIME_KEY = exports.GELATO_RELAY_FEE_MULTIPLIER_FACTOR_KEY = exports.GASLESS_FEATURE_DISABLED_KEY = exports.PRICE_FEED_KEY = exports.MULTICHAIN_BALANCE = void 0;
|
|
6
|
+
exports.claimsDisabledKey = exports.claimTermsKey = exports.gaslessFeatureDisabledKey = exports.priceFeedKey = exports.multichainBalanceKey = exports.subaccountAutoTopUpAmountKey = exports.subaccountIntegrationIdKey = exports.maxLendableImpactUsdKey = exports.maxLendableImpactFactorForWithdrawalsKey = exports.maxLendableImpactFactorKey = exports.subaccountActionCountKey = exports.maxAllowedSubaccountActionCountKey = exports.subaccountListKey = exports.uiFeeFactorKey = exports.maxPoolAmountKey = exports.maxPoolUsdForDepositKey = exports.isMarketDisabledKey = exports.affiliateRewardKey = exports.virtualInventoryForPositionsKey = exports.virtualInventoryForSwapsKey = exports.virtualMarketIdKey = exports.virtualTokenIdKey = exports.claimableFundingAmountKey = exports.hashedPositionKey = exports.minCollateralFactorForOpenInterest = exports.minCollateralFactorForLiquidationKey = exports.minCollateralFactorKey = exports.accountOrderListKey = exports.swapOrderGasLimitKey = exports.decreaseOrderGasLimitKey = exports.increaseOrderGasLimitKey = exports.singleSwapGasLimitKey = exports.shiftGasLimitKey = exports.withdrawalGasLimitKey = void 0;
|
|
7
7
|
const hash_1 = require("../utils/hash");
|
|
8
8
|
exports.POSITION_IMPACT_FACTOR_KEY = (0, hash_1.hashString)("POSITION_IMPACT_FACTOR");
|
|
9
9
|
exports.MAX_POSITION_IMPACT_FACTOR_KEY = (0, hash_1.hashString)("MAX_POSITION_IMPACT_FACTOR");
|
|
@@ -170,6 +170,10 @@ function atomicSwapFeeFactorKey(market) {
|
|
|
170
170
|
return (0, hash_1.hashData)(["bytes32", "address"], [exports.ATOMIC_SWAP_FEE_FACTOR_KEY, market]);
|
|
171
171
|
}
|
|
172
172
|
exports.atomicSwapFeeFactorKey = atomicSwapFeeFactorKey;
|
|
173
|
+
function withdrawalFeeFactorKey(market, forBalanceWasImproved) {
|
|
174
|
+
return (0, hash_1.hashData)(["bytes32", "address", "bool"], [exports.WITHDRAWAL_FEE_FACTOR_KEY, market, forBalanceWasImproved]);
|
|
175
|
+
}
|
|
176
|
+
exports.withdrawalFeeFactorKey = withdrawalFeeFactorKey;
|
|
173
177
|
function openInterestKey(market, collateralToken, isLong) {
|
|
174
178
|
return (0, hash_1.hashData)(["bytes32", "address", "address", "bool"], [exports.OPEN_INTEREST_KEY, market, collateralToken, isLong]);
|
|
175
179
|
}
|
|
@@ -150,6 +150,9 @@ export function swapFeeFactorKey(market, forPositiveImpact) {
|
|
|
150
150
|
export function atomicSwapFeeFactorKey(market) {
|
|
151
151
|
return hashData(["bytes32", "address"], [ATOMIC_SWAP_FEE_FACTOR_KEY, market]);
|
|
152
152
|
}
|
|
153
|
+
export function withdrawalFeeFactorKey(market, forBalanceWasImproved) {
|
|
154
|
+
return hashData(["bytes32", "address", "bool"], [WITHDRAWAL_FEE_FACTOR_KEY, market, forBalanceWasImproved]);
|
|
155
|
+
}
|
|
153
156
|
export function openInterestKey(market, collateralToken, isLong) {
|
|
154
157
|
return hashData(["bytes32", "address", "address", "bool"], [OPEN_INTEREST_KEY, market, collateralToken, isLong]);
|
|
155
158
|
}
|
|
@@ -121,6 +121,7 @@ export declare function swapImpactFactorKey(market: string, isPositive: boolean)
|
|
|
121
121
|
export declare function swapImpactExponentFactorKey(market: string): string;
|
|
122
122
|
export declare function swapFeeFactorKey(market: string, forPositiveImpact: boolean): string;
|
|
123
123
|
export declare function atomicSwapFeeFactorKey(market: string): string;
|
|
124
|
+
export declare function withdrawalFeeFactorKey(market: string, forBalanceWasImproved: boolean): string;
|
|
124
125
|
export declare function openInterestKey(market: string, collateralToken: string, isLong: boolean): string;
|
|
125
126
|
export declare function openInterestInTokensKey(market: string, collateralToken: string, isLong: boolean): string;
|
|
126
127
|
export declare function poolAmountKey(market: string, token: string): string;
|
|
@@ -34,7 +34,7 @@ export declare function buildMarketsConfigsRequest(chainId: number, { marketsDat
|
|
|
34
34
|
dataStoreAddress: string;
|
|
35
35
|
}): Promise<import("../../utils/multicall").MulticallRequestConfig<{
|
|
36
36
|
[key: `${string}-dataStore`]: {
|
|
37
|
-
calls: Record<"maxFundingFactorPerSecond" | "isDisabled" | "maxLongPoolAmount" | "maxShortPoolAmount" | "maxLongPoolUsdForDeposit" | "maxShortPoolUsdForDeposit" | "reserveFactorLong" | "reserveFactorShort" | "openInterestReserveFactorLong" | "openInterestReserveFactorShort" | "maxOpenInterestLong" | "maxOpenInterestShort" | "
|
|
37
|
+
calls: Record<"maxFundingFactorPerSecond" | "isDisabled" | "maxLongPoolAmount" | "maxShortPoolAmount" | "maxLongPoolUsdForDeposit" | "maxShortPoolUsdForDeposit" | "reserveFactorLong" | "reserveFactorShort" | "openInterestReserveFactorLong" | "openInterestReserveFactorShort" | "maxOpenInterestLong" | "maxOpenInterestShort" | "borrowingFactorLong" | "borrowingFactorShort" | "borrowingExponentFactorLong" | "borrowingExponentFactorShort" | "fundingFactor" | "fundingExponentFactor" | "fundingIncreaseFactorPerSecond" | "fundingDecreaseFactorPerSecond" | "thresholdForStableFunding" | "thresholdForDecreaseFunding" | "minFundingFactorPerSecond" | "minPositionImpactPoolAmount" | "positionImpactPoolDistributionRate" | "minCollateralFactor" | "minCollateralFactorForLiquidation" | "minCollateralFactorForOpenInterestLong" | "minCollateralFactorForOpenInterestShort" | "maxPnlFactorForTradersLong" | "maxPnlFactorForTradersShort" | "positionFeeFactorForBalanceWasImproved" | "positionFeeFactorForBalanceWasNotImproved" | "positionImpactFactorPositive" | "positionImpactFactorNegative" | "maxPositionImpactFactorPositive" | "maxPositionImpactFactorNegative" | "maxPositionImpactFactorForLiquidations" | "maxLendableImpactFactor" | "maxLendableImpactFactorForWithdrawals" | "maxLendableImpactUsd" | "lentPositionImpactPoolAmount" | "positionImpactExponentFactorPositive" | "positionImpactExponentFactorNegative" | "swapFeeFactorForBalanceWasImproved" | "swapFeeFactorForBalanceWasNotImproved" | "atomicSwapFeeFactor" | "swapImpactFactorPositive" | "swapImpactFactorNegative" | "swapImpactExponentFactor" | "withdrawalFeeFactorBalanceWasImproved" | "withdrawalFeeFactorBalanceWasNotImproved" | "virtualMarketId" | "virtualLongTokenId" | "virtualShortTokenId", {
|
|
38
38
|
methodName: string;
|
|
39
39
|
params: any[];
|
|
40
40
|
}>;
|
|
@@ -386,6 +386,15 @@ export interface AccountStatsConnection {
|
|
|
386
386
|
pageInfo: PageInfo;
|
|
387
387
|
totalCount: Scalars["Int"]["output"];
|
|
388
388
|
}
|
|
389
|
+
export interface AccountVolumeStatObject {
|
|
390
|
+
__typename?: "AccountVolumeStatObject";
|
|
391
|
+
last7DaysVolume: Scalars["BigInt"]["output"];
|
|
392
|
+
last14DaysVolume: Scalars["BigInt"]["output"];
|
|
393
|
+
maxDailyVolume: Scalars["BigInt"]["output"];
|
|
394
|
+
}
|
|
395
|
+
export interface AccountVolumeWhereInput {
|
|
396
|
+
account: Scalars["String"]["input"];
|
|
397
|
+
}
|
|
389
398
|
export interface AnnualizedPerformanceObject {
|
|
390
399
|
__typename?: "AnnualizedPerformanceObject";
|
|
391
400
|
address: Scalars["String"]["output"];
|
|
@@ -7560,6 +7569,7 @@ export interface Query {
|
|
|
7560
7569
|
ordersConnection: OrdersConnection;
|
|
7561
7570
|
performanceSnapshots: Array<PerformanceSnapshots>;
|
|
7562
7571
|
periodAccountStats: Array<PeriodAccountStatObject>;
|
|
7572
|
+
periodAccountVolume: AccountVolumeStatObject;
|
|
7563
7573
|
platformStats: Array<PlatformStats>;
|
|
7564
7574
|
platformStatsById?: Maybe<PlatformStats>;
|
|
7565
7575
|
platformStatsConnection: PlatformStatsConnection;
|
|
@@ -7955,6 +7965,9 @@ export interface QueryperiodAccountStatsArgs {
|
|
|
7955
7965
|
offset?: InputMaybe<Scalars["Float"]["input"]>;
|
|
7956
7966
|
where?: InputMaybe<WhereInput>;
|
|
7957
7967
|
}
|
|
7968
|
+
export interface QueryperiodAccountVolumeArgs {
|
|
7969
|
+
where?: InputMaybe<AccountVolumeWhereInput>;
|
|
7970
|
+
}
|
|
7958
7971
|
export interface QueryplatformStatsArgs {
|
|
7959
7972
|
limit?: InputMaybe<Scalars["Int"]["input"]>;
|
|
7960
7973
|
offset?: InputMaybe<Scalars["Int"]["input"]>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gmx-io/sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha-1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -66,7 +66,9 @@
|
|
|
66
66
|
"clean:cache": "rm -rf ../.eslintcache ../tsconfig.tsbuildinfo build/**/*.tsbuildinfo",
|
|
67
67
|
"clean:lint": "rm -rf ../.eslintcache",
|
|
68
68
|
"clean:ts": "rm -rf ../tsconfig.tsbuildinfo build/**/*.tsbuildinfo",
|
|
69
|
-
"build": "rm -rf build && yarn build:subsquid && yarn build:types && yarn build:cjs && yarn build:esm && yarn clean"
|
|
69
|
+
"build": "rm -rf build && yarn build:subsquid && yarn build:types && yarn build:cjs && yarn build:esm && yarn clean",
|
|
70
|
+
"dev": "tspc -p tsconfig.esm.json --watch & tspc -p tsconfig.json --emitDeclarationOnly --watch",
|
|
71
|
+
"dev:cjs": "mkdir -p build/cjs/src && echo '{\"type\": \"commonjs\"}' > build/cjs/src/package.json && tsc -p tsconfig.cjs.json --watch"
|
|
70
72
|
},
|
|
71
73
|
"publishConfig": {
|
|
72
74
|
"access": "public"
|
|
@@ -104,7 +106,7 @@
|
|
|
104
106
|
"files": [
|
|
105
107
|
"build"
|
|
106
108
|
],
|
|
107
|
-
"packageManager": "yarn@
|
|
109
|
+
"packageManager": "yarn@4.12.0",
|
|
108
110
|
"resolutions": {
|
|
109
111
|
"viem@2.39.0": "patch:viem@npm:2.39.0#../.yarn/patches/viem-npm-2.39.0-c113f391fd"
|
|
110
112
|
}
|