@gmx-io/sdk 1.2.0 → 1.3.0
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/abis/ClaimHandler.json +424 -0
- package/build/cjs/src/abis/CustomErrors.json +642 -61
- package/build/cjs/src/abis/DataStore.json +25 -6
- package/build/cjs/src/abis/EventEmitter.json +1 -6
- package/build/cjs/src/abis/ExchangeRouter.json +195 -290
- package/build/cjs/src/abis/GelatoRelayRouter.json +251 -98
- package/build/cjs/src/abis/GlvReader.json +60 -3
- package/build/cjs/src/abis/GlvRouter.json +144 -86
- package/build/cjs/src/abis/GovToken.json +1 -354
- package/build/cjs/src/abis/LayerZeroProvider.json +372 -0
- package/build/cjs/src/abis/Multicall.json +134 -38
- package/build/cjs/src/abis/MultichainClaimsRouter.json +1266 -0
- package/build/cjs/src/abis/MultichainGlvRouter.json +1150 -0
- package/build/cjs/src/abis/MultichainGmRouter.json +1449 -0
- package/build/cjs/src/abis/MultichainOrderRouter.json +1820 -0
- package/build/cjs/src/abis/MultichainSubaccountRouter.json +2069 -0
- package/build/cjs/src/abis/MultichainTransferRouter.json +915 -0
- package/build/cjs/src/abis/MultichainUtils.json +133 -0
- package/build/cjs/src/abis/MultichainVault.json +275 -0
- package/build/cjs/src/abis/ReferralStorage.json +69 -19
- package/build/cjs/src/abis/RelayParams.json +85 -48
- package/build/cjs/src/abis/SmartAccount.json +28 -0
- package/build/cjs/src/abis/SubaccountGelatoRelayRouter.json +282 -148
- package/build/cjs/src/abis/SubaccountRouter.json +62 -118
- package/build/cjs/src/abis/SyntheticsReader.json +342 -474
- package/build/cjs/src/abis/SyntheticsRouter.json +1 -6
- package/build/cjs/src/abis/index.js +53 -5
- package/build/cjs/src/configs/__tests__/markets.spec.js +2 -2
- package/build/cjs/src/configs/__tests__/permits.spec.js +1 -1
- package/build/cjs/src/configs/__tests__/tokens.spec.js +2 -2
- package/build/cjs/src/configs/batch.js +60 -0
- package/build/cjs/src/configs/chains.js +41 -8
- package/build/cjs/src/configs/contracts.js +151 -39
- package/build/cjs/src/configs/dataStore.js +49 -5
- package/build/cjs/src/configs/express.js +6 -1
- package/build/cjs/src/configs/factors.js +1 -1
- package/build/cjs/src/configs/markets.js +163 -0
- package/build/cjs/src/configs/oracleKeeper.js +21 -35
- package/build/cjs/src/configs/tokens.js +272 -2
- package/build/cjs/src/index.js +3 -3
- package/build/cjs/src/modules/markets/index.js +9 -4
- package/build/cjs/src/modules/markets/query-builders.js +28 -8
- package/build/cjs/src/modules/orders/helpers.js +11 -2
- package/build/cjs/src/modules/orders/helpers.spec.js +2 -2
- package/build/cjs/src/modules/orders/orders.js +3 -3
- package/build/cjs/src/modules/orders/utils.js +4 -5
- package/build/cjs/src/modules/positions/positions.js +38 -5
- package/build/cjs/src/modules/utils/utils.js +4 -3
- package/build/cjs/src/prebuilt/hashedKinkModelMarketRatesKeys.json +186 -0
- package/build/cjs/src/prebuilt/hashedMarketConfigKeys.json +2442 -512
- package/build/cjs/src/prebuilt/hashedMarketValuesKeys.json +347 -0
- package/build/cjs/src/test/mock.js +9 -4
- package/build/cjs/src/types/subsquid.js +597 -1
- package/build/cjs/src/types/swapStrategy.js +2 -0
- package/build/cjs/src/types/trade.js +1 -0
- package/build/cjs/src/utils/LruCache.js +4 -0
- package/build/cjs/src/utils/__tests__/LruCache.spec.js +18 -0
- package/build/cjs/src/utils/__tests__/numbers.spec.js +18 -16
- package/build/cjs/src/utils/__tests__/orderTransactions/batchUtils.spec.js +0 -1
- package/build/cjs/src/utils/__tests__/orderTransactions/decreaseOrders.spec.js +8 -0
- package/build/cjs/src/utils/__tests__/orderTransactions/exchangeRouterMulticall.spec.js +40 -30
- package/build/cjs/src/utils/__tests__/orderTransactions/increaseOrders.spec.js +12 -0
- package/build/cjs/src/utils/__tests__/orderTransactions/swapOrders.spec.js +6 -0
- package/build/cjs/src/utils/__tests__/positions.spec.js +23 -6
- package/build/cjs/src/utils/__tests__/uiFeeReceiver.spec.js +10 -0
- package/build/cjs/src/utils/bigmath.js +9 -2
- package/build/cjs/src/utils/errors/parseError.js +35 -1
- package/build/cjs/src/utils/errors/transactionsErrors.js +7 -1
- package/build/cjs/src/utils/fees/executionFee.js +5 -3
- package/build/cjs/src/utils/fees/index.js +8 -6
- package/build/cjs/src/utils/fees/priceImpact.js +94 -32
- package/build/cjs/src/utils/gelatoRelay.js +5 -0
- package/build/cjs/src/utils/marketKeysAndConfigs.js +24 -4
- package/build/cjs/src/utils/markets.js +10 -3
- package/build/cjs/src/utils/numbers.js +18 -17
- package/build/cjs/src/utils/orderTransactions.js +5 -2
- package/build/cjs/src/utils/positions.js +77 -9
- package/build/cjs/src/utils/prices.js +19 -13
- package/build/cjs/src/utils/swap/__tests__/mockRouting.spec.js +1 -0
- package/build/cjs/src/utils/swap/botanixStaking.js +90 -0
- package/build/cjs/src/utils/swap/buildSwapStrategy.js +224 -0
- package/build/cjs/src/utils/swap/externalSwapPath.js +41 -0
- package/build/cjs/src/utils/swap/externalSwapQuoteByPath.js +27 -0
- package/build/cjs/src/utils/swap/swapStats.js +6 -3
- package/build/cjs/src/utils/swap/swapValues.js +250 -11
- package/build/cjs/src/utils/trade/decrease.js +470 -0
- package/build/cjs/src/utils/trade/{amounts.js → increase.js} +175 -72
- package/build/cjs/src/utils/trade/trade.js +2 -2
- package/build/cjs/src/utils/tradeHistory.js +3 -0
- package/build/cjs/src/utils/twap/uiFeeReceiver.js +9 -9
- package/build/esm/src/abis/ClaimHandler.json +424 -0
- package/build/esm/src/abis/CustomErrors.json +642 -61
- package/build/esm/src/abis/DataStore.json +25 -6
- package/build/esm/src/abis/EventEmitter.json +1 -6
- package/build/esm/src/abis/ExchangeRouter.json +195 -290
- package/build/esm/src/abis/GelatoRelayRouter.json +251 -98
- package/build/esm/src/abis/GlvReader.json +60 -3
- package/build/esm/src/abis/GlvRouter.json +144 -86
- package/build/esm/src/abis/GovToken.json +1 -354
- package/build/esm/src/abis/LayerZeroProvider.json +372 -0
- package/build/esm/src/abis/Multicall.json +134 -38
- package/build/esm/src/abis/MultichainClaimsRouter.json +1266 -0
- package/build/esm/src/abis/MultichainGlvRouter.json +1150 -0
- package/build/esm/src/abis/MultichainGmRouter.json +1449 -0
- package/build/esm/src/abis/MultichainOrderRouter.json +1820 -0
- package/build/esm/src/abis/MultichainSubaccountRouter.json +2069 -0
- package/build/esm/src/abis/MultichainTransferRouter.json +915 -0
- package/build/esm/src/abis/MultichainUtils.json +133 -0
- package/build/esm/src/abis/MultichainVault.json +275 -0
- package/build/esm/src/abis/ReferralStorage.json +69 -19
- package/build/esm/src/abis/RelayParams.json +85 -48
- package/build/esm/src/abis/SmartAccount.json +28 -0
- package/build/esm/src/abis/SubaccountGelatoRelayRouter.json +282 -148
- package/build/esm/src/abis/SubaccountRouter.json +62 -118
- package/build/esm/src/abis/SyntheticsReader.json +342 -474
- package/build/esm/src/abis/SyntheticsRouter.json +1 -6
- package/build/esm/src/abis/index.js +53 -5
- package/build/esm/src/configs/__tests__/markets.spec.js +4 -4
- package/build/esm/src/configs/__tests__/permits.spec.js +2 -2
- package/build/esm/src/configs/__tests__/tokens.spec.js +3 -3
- package/build/esm/src/configs/batch.js +61 -1
- package/build/esm/src/configs/chains.js +40 -7
- package/build/esm/src/configs/contracts.js +152 -40
- package/build/esm/src/configs/dataStore.js +37 -1
- package/build/esm/src/configs/express.js +6 -1
- package/build/esm/src/configs/factors.js +1 -1
- package/build/esm/src/configs/markets.js +164 -1
- package/build/esm/src/configs/oracleKeeper.js +20 -30
- package/build/esm/src/configs/tokens.js +271 -2
- package/build/esm/src/index.js +3 -3
- package/build/esm/src/modules/markets/index.js +9 -4
- package/build/esm/src/modules/markets/query-builders.js +28 -8
- package/build/esm/src/modules/orders/helpers.js +10 -1
- package/build/esm/src/modules/orders/helpers.spec.js +2 -2
- package/build/esm/src/modules/orders/orders.js +3 -3
- package/build/esm/src/modules/orders/utils.js +4 -5
- package/build/esm/src/modules/positions/positions.js +40 -7
- package/build/esm/src/modules/utils/utils.js +4 -3
- package/build/esm/src/prebuilt/hashedKinkModelMarketRatesKeys.json +186 -0
- package/build/esm/src/prebuilt/hashedMarketConfigKeys.json +2442 -512
- package/build/esm/src/prebuilt/hashedMarketValuesKeys.json +347 -0
- package/build/esm/src/test/mock.js +9 -4
- package/build/esm/src/types/subsquid.js +596 -0
- package/build/esm/src/types/swapStrategy.js +1 -0
- package/build/esm/src/types/trade.js +1 -0
- package/build/esm/src/utils/LruCache.js +4 -0
- package/build/esm/src/utils/__tests__/LruCache.spec.js +18 -0
- package/build/esm/src/utils/__tests__/numbers.spec.js +18 -16
- package/build/esm/src/utils/__tests__/orderTransactions/batchUtils.spec.js +0 -1
- package/build/esm/src/utils/__tests__/orderTransactions/decreaseOrders.spec.js +8 -0
- package/build/esm/src/utils/__tests__/orderTransactions/exchangeRouterMulticall.spec.js +40 -30
- package/build/esm/src/utils/__tests__/orderTransactions/increaseOrders.spec.js +12 -0
- package/build/esm/src/utils/__tests__/orderTransactions/swapOrders.spec.js +7 -1
- package/build/esm/src/utils/__tests__/positions.spec.js +23 -6
- package/build/esm/src/utils/__tests__/uiFeeReceiver.spec.js +11 -1
- package/build/esm/src/utils/bigmath.js +9 -2
- package/build/esm/src/utils/errors/parseError.js +31 -0
- package/build/esm/src/utils/errors/transactionsErrors.js +7 -1
- package/build/esm/src/utils/fees/executionFee.js +5 -3
- package/build/esm/src/utils/fees/index.js +8 -6
- package/build/esm/src/utils/fees/priceImpact.js +88 -30
- package/build/esm/src/utils/gelatoRelay.js +2 -0
- package/build/esm/src/utils/marketKeysAndConfigs.js +25 -5
- package/build/esm/src/utils/markets.js +7 -1
- package/build/esm/src/utils/numbers.js +18 -17
- package/build/esm/src/utils/orderTransactions.js +5 -2
- package/build/esm/src/utils/positions.js +75 -11
- package/build/esm/src/utils/prices.js +20 -14
- package/build/esm/src/utils/swap/__tests__/mockRouting.spec.js +1 -0
- package/build/esm/src/utils/swap/botanixStaking.js +83 -0
- package/build/esm/src/utils/swap/buildSwapStrategy.js +219 -0
- package/build/esm/src/utils/swap/externalSwapPath.js +37 -0
- package/build/esm/src/utils/swap/externalSwapQuoteByPath.js +23 -0
- package/build/esm/src/utils/swap/swapStats.js +6 -3
- package/build/esm/src/utils/swap/swapValues.js +248 -9
- package/build/esm/src/utils/trade/decrease.js +460 -0
- package/build/esm/src/utils/trade/{amounts.js → increase.js} +176 -74
- package/build/esm/src/utils/trade/trade.js +2 -2
- package/build/esm/src/utils/tradeHistory.js +3 -0
- package/build/esm/src/utils/twap/uiFeeReceiver.js +9 -9
- package/build/types/src/abis/index.d.ts +1 -1
- package/build/types/src/configs/batch.d.ts +2 -1
- package/build/types/src/configs/chains.d.ts +25 -20
- package/build/types/src/configs/contracts.d.ts +118 -8
- package/build/types/src/configs/dataStore.d.ts +20 -0
- package/build/types/src/configs/express.d.ts +1 -0
- package/build/types/src/configs/factors.d.ts +1 -1
- package/build/types/src/configs/markets.d.ts +2 -2
- package/build/types/src/configs/oracleKeeper.d.ts +2 -3
- package/build/types/src/configs/tokens.d.ts +1 -0
- package/build/types/src/index.d.ts +1 -1
- package/build/types/src/modules/base.d.ts +1 -1
- package/build/types/src/modules/markets/query-builders.d.ts +3 -2
- package/build/types/src/modules/markets/types.d.ts +2 -2
- package/build/types/src/modules/orders/utils.d.ts +6 -5
- package/build/types/src/types/fees.d.ts +1 -0
- package/build/types/src/types/markets.d.ts +10 -5
- package/build/types/src/types/orders.d.ts +1 -1
- package/build/types/src/types/positions.d.ts +26 -2
- package/build/types/src/types/sdk.d.ts +2 -2
- package/build/types/src/types/subsquid.d.ts +1562 -9
- package/build/types/src/types/swapStrategy.d.ts +33 -0
- package/build/types/src/types/tokens.d.ts +12 -0
- package/build/types/src/types/trade.d.ts +32 -7
- package/build/types/src/types/tradeHistory.d.ts +3 -0
- package/build/types/src/utils/LruCache.d.ts +1 -0
- package/build/types/src/utils/bigmath.d.ts +2 -1
- package/build/types/src/utils/errors/parseError.d.ts +11 -0
- package/build/types/src/utils/fees/executionFee.d.ts +6 -3
- package/build/types/src/utils/fees/index.d.ts +2 -2
- package/build/types/src/utils/fees/priceImpact.d.ts +33 -5
- package/build/types/src/utils/marketKeysAndConfigs.d.ts +9 -4
- package/build/types/src/utils/markets.d.ts +7 -0
- package/build/types/src/utils/multicall.d.ts +1 -1
- package/build/types/src/utils/numbers.d.ts +6 -3
- package/build/types/src/utils/orderTransactions.d.ts +6 -4
- package/build/types/src/utils/positions.d.ts +30 -0
- package/build/types/src/utils/prices.d.ts +4 -0
- package/build/types/src/utils/swap/botanixStaking.d.ts +11 -0
- package/build/types/src/utils/swap/buildSwapStrategy.d.ts +22 -0
- package/build/types/src/utils/swap/externalSwapPath.d.ts +13 -0
- package/build/types/src/utils/swap/externalSwapQuoteByPath.d.ts +6 -0
- package/build/types/src/utils/swap/swapValues.d.ts +11 -4
- package/build/types/src/utils/trade/decrease.d.ts +77 -0
- package/build/types/src/utils/trade/{amounts.d.ts → increase.d.ts} +20 -2
- package/build/types/src/utils/twap/uiFeeReceiver.d.ts +7 -7
- package/package.json +2 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Address } from "viem";
|
|
2
|
+
import { ContractsChainId } from "./chains";
|
|
2
3
|
export declare const CONTRACTS: {
|
|
3
4
|
42161: {
|
|
4
5
|
Vault: string;
|
|
@@ -52,11 +53,22 @@ export declare const CONTRACTS: {
|
|
|
52
53
|
GlvVault: string;
|
|
53
54
|
GelatoRelayRouter: string;
|
|
54
55
|
SubaccountGelatoRelayRouter: string;
|
|
56
|
+
MultichainClaimsRouter: string;
|
|
57
|
+
MultichainGlvRouter: string;
|
|
58
|
+
MultichainGmRouter: string;
|
|
59
|
+
MultichainOrderRouter: string;
|
|
60
|
+
MultichainSubaccountRouter: string;
|
|
61
|
+
MultichainTransferRouter: string;
|
|
62
|
+
MultichainVault: string;
|
|
63
|
+
LayerZeroProvider: string;
|
|
64
|
+
ChainlinkPriceFeedProvider: string;
|
|
65
|
+
ClaimHandler: string;
|
|
55
66
|
ExternalHandler: string;
|
|
56
67
|
OpenOceanRouter: string;
|
|
57
|
-
ChainlinkPriceFeedProvider: string;
|
|
58
68
|
Multicall: string;
|
|
59
69
|
ArbitrumNodeInterface: string;
|
|
70
|
+
LayerZeroEndpoint: string;
|
|
71
|
+
GelatoRelayAddress: string;
|
|
60
72
|
};
|
|
61
73
|
43114: {
|
|
62
74
|
Vault: string;
|
|
@@ -110,11 +122,22 @@ export declare const CONTRACTS: {
|
|
|
110
122
|
GlvVault: string;
|
|
111
123
|
GelatoRelayRouter: string;
|
|
112
124
|
SubaccountGelatoRelayRouter: string;
|
|
125
|
+
MultichainClaimsRouter: string;
|
|
126
|
+
MultichainGlvRouter: string;
|
|
127
|
+
MultichainGmRouter: string;
|
|
128
|
+
MultichainOrderRouter: string;
|
|
129
|
+
MultichainSubaccountRouter: string;
|
|
130
|
+
MultichainTransferRouter: string;
|
|
131
|
+
MultichainVault: string;
|
|
132
|
+
LayerZeroProvider: string;
|
|
133
|
+
ChainlinkPriceFeedProvider: string;
|
|
134
|
+
ClaimHandler: string;
|
|
113
135
|
ExternalHandler: string;
|
|
114
136
|
OpenOceanRouter: string;
|
|
115
|
-
ChainlinkPriceFeedProvider: string;
|
|
116
137
|
Multicall: string;
|
|
117
138
|
ArbitrumNodeInterface: "0x0000000000000000000000000000000000000000";
|
|
139
|
+
LayerZeroEndpoint: string;
|
|
140
|
+
GelatoRelayAddress: string;
|
|
118
141
|
};
|
|
119
142
|
3637: {
|
|
120
143
|
DataStore: string;
|
|
@@ -132,12 +155,22 @@ export declare const CONTRACTS: {
|
|
|
132
155
|
GlvVault: string;
|
|
133
156
|
GelatoRelayRouter: string;
|
|
134
157
|
SubaccountGelatoRelayRouter: string;
|
|
158
|
+
MultichainClaimsRouter: string;
|
|
159
|
+
MultichainGlvRouter: string;
|
|
160
|
+
MultichainGmRouter: string;
|
|
161
|
+
MultichainOrderRouter: string;
|
|
162
|
+
MultichainSubaccountRouter: string;
|
|
163
|
+
MultichainTransferRouter: string;
|
|
164
|
+
MultichainVault: string;
|
|
165
|
+
LayerZeroProvider: string;
|
|
166
|
+
ChainlinkPriceFeedProvider: string;
|
|
167
|
+
ClaimHandler: string;
|
|
135
168
|
ExternalHandler: string;
|
|
136
169
|
OpenOceanRouter: "0x0000000000000000000000000000000000000000";
|
|
137
|
-
ChainlinkPriceFeedProvider: string;
|
|
138
170
|
Multicall: string;
|
|
139
|
-
|
|
171
|
+
LayerZeroEndpoint: string;
|
|
140
172
|
ArbitrumNodeInterface: "0x0000000000000000000000000000000000000000";
|
|
173
|
+
GelatoRelayAddress: string;
|
|
141
174
|
Vault: "0x0000000000000000000000000000000000000000";
|
|
142
175
|
Reader: "0x0000000000000000000000000000000000000000";
|
|
143
176
|
PositionRouter: "0x0000000000000000000000000000000000000000";
|
|
@@ -225,13 +258,90 @@ export declare const CONTRACTS: {
|
|
|
225
258
|
GlvReader: string;
|
|
226
259
|
GlvRouter: string;
|
|
227
260
|
GlvVault: string;
|
|
228
|
-
GelatoRelayRouter:
|
|
229
|
-
SubaccountGelatoRelayRouter:
|
|
261
|
+
GelatoRelayRouter: string;
|
|
262
|
+
SubaccountGelatoRelayRouter: string;
|
|
263
|
+
MultichainClaimsRouter: string;
|
|
264
|
+
MultichainGlvRouter: string;
|
|
265
|
+
MultichainGmRouter: string;
|
|
266
|
+
MultichainOrderRouter: string;
|
|
267
|
+
MultichainSubaccountRouter: string;
|
|
268
|
+
MultichainTransferRouter: string;
|
|
269
|
+
MultichainVault: string;
|
|
270
|
+
LayerZeroProvider: string;
|
|
271
|
+
ChainlinkPriceFeedProvider: string;
|
|
272
|
+
ClaimHandler: string;
|
|
230
273
|
OpenOceanRouter: "0x0000000000000000000000000000000000000000";
|
|
231
274
|
ExternalHandler: string;
|
|
232
|
-
ChainlinkPriceFeedProvider: "0x0000000000000000000000000000000000000000";
|
|
233
275
|
Multicall: string;
|
|
234
276
|
ArbitrumNodeInterface: "0x0000000000000000000000000000000000000000";
|
|
277
|
+
LayerZeroEndpoint: string;
|
|
278
|
+
};
|
|
279
|
+
421614: {
|
|
280
|
+
DataStore: string;
|
|
281
|
+
EventEmitter: string;
|
|
282
|
+
ExchangeRouter: string;
|
|
283
|
+
SubaccountRouter: string;
|
|
284
|
+
DepositVault: string;
|
|
285
|
+
WithdrawalVault: string;
|
|
286
|
+
OrderVault: string;
|
|
287
|
+
ShiftVault: string;
|
|
288
|
+
SyntheticsReader: string;
|
|
289
|
+
SyntheticsRouter: string;
|
|
290
|
+
GlvReader: string;
|
|
291
|
+
GlvRouter: string;
|
|
292
|
+
GlvVault: string;
|
|
293
|
+
GelatoRelayRouter: string;
|
|
294
|
+
SubaccountGelatoRelayRouter: string;
|
|
295
|
+
MultichainClaimsRouter: string;
|
|
296
|
+
MultichainGlvRouter: string;
|
|
297
|
+
MultichainGmRouter: string;
|
|
298
|
+
MultichainOrderRouter: string;
|
|
299
|
+
MultichainSubaccountRouter: string;
|
|
300
|
+
MultichainTransferRouter: string;
|
|
301
|
+
MultichainVault: string;
|
|
302
|
+
LayerZeroProvider: string;
|
|
303
|
+
ChainlinkPriceFeedProvider: string;
|
|
304
|
+
ReferralStorage: string;
|
|
305
|
+
ClaimHandler: string;
|
|
306
|
+
Multicall: string;
|
|
307
|
+
NATIVE_TOKEN: string;
|
|
308
|
+
LayerZeroEndpoint: string;
|
|
309
|
+
ArbitrumNodeInterface: string;
|
|
310
|
+
GelatoRelayAddress: string;
|
|
311
|
+
ExternalHandler: "0x0000000000000000000000000000000000000000";
|
|
312
|
+
GLP: "0x0000000000000000000000000000000000000000";
|
|
313
|
+
GMX: "0x0000000000000000000000000000000000000000";
|
|
314
|
+
ES_GMX: "0x0000000000000000000000000000000000000000";
|
|
315
|
+
BN_GMX: "0x0000000000000000000000000000000000000000";
|
|
316
|
+
USDG: "0x0000000000000000000000000000000000000000";
|
|
317
|
+
ES_GMX_IOU: "0x0000000000000000000000000000000000000000";
|
|
318
|
+
OpenOceanRouter: "0x0000000000000000000000000000000000000000";
|
|
319
|
+
Vault: "0x0000000000000000000000000000000000000000";
|
|
320
|
+
PositionRouter: "0x0000000000000000000000000000000000000000";
|
|
321
|
+
RewardRouter: "0x0000000000000000000000000000000000000000";
|
|
322
|
+
StakedGmxTracker: "0x0000000000000000000000000000000000000000";
|
|
323
|
+
BonusGmxTracker: "0x0000000000000000000000000000000000000000";
|
|
324
|
+
FeeGmxTracker: "0x0000000000000000000000000000000000000000";
|
|
325
|
+
StakedGlpTracker: "0x0000000000000000000000000000000000000000";
|
|
326
|
+
FeeGlpTracker: "0x0000000000000000000000000000000000000000";
|
|
327
|
+
ExtendedGmxTracker: "0x0000000000000000000000000000000000000000";
|
|
328
|
+
StakedGmxDistributor: "0x0000000000000000000000000000000000000000";
|
|
329
|
+
StakedGlpDistributor: "0x0000000000000000000000000000000000000000";
|
|
330
|
+
GmxVester: "0x0000000000000000000000000000000000000000";
|
|
331
|
+
GlpVester: "0x0000000000000000000000000000000000000000";
|
|
332
|
+
AffiliateVester: "0x0000000000000000000000000000000000000000";
|
|
333
|
+
Router: "0x0000000000000000000000000000000000000000";
|
|
334
|
+
VaultReader: "0x0000000000000000000000000000000000000000";
|
|
335
|
+
Reader: "0x0000000000000000000000000000000000000000";
|
|
336
|
+
GlpManager: "0x0000000000000000000000000000000000000000";
|
|
337
|
+
RewardReader: "0x0000000000000000000000000000000000000000";
|
|
338
|
+
GlpRewardRouter: "0x0000000000000000000000000000000000000000";
|
|
339
|
+
Timelock: "0x0000000000000000000000000000000000000000";
|
|
235
340
|
};
|
|
236
341
|
};
|
|
237
|
-
|
|
342
|
+
type ExtractContractNames<T extends object> = {
|
|
343
|
+
[K in keyof T]: keyof T[K];
|
|
344
|
+
}[keyof T];
|
|
345
|
+
export type ContractName = ExtractContractNames<typeof CONTRACTS>;
|
|
346
|
+
export declare function getContract(chainId: ContractsChainId, name: ContractName): Address;
|
|
347
|
+
export {};
|
|
@@ -37,6 +37,13 @@ export declare const MAX_PNL_FACTOR_FOR_WITHDRAWALS_KEY: string;
|
|
|
37
37
|
export declare const MAX_PNL_FACTOR_FOR_DEPOSITS_KEY: string;
|
|
38
38
|
export declare const MAX_PNL_FACTOR_FOR_TRADERS_KEY: string;
|
|
39
39
|
export declare const MAX_POSITION_IMPACT_FACTOR_FOR_LIQUIDATIONS_KEY: string;
|
|
40
|
+
export declare const CLAIMABLE_COLLATERAL_DELAY_KEY: string;
|
|
41
|
+
export declare const CLAIMABLE_COLLATERAL_REDUCTION_FACTOR_KEY: string;
|
|
42
|
+
export declare const CLAIMABLE_COLLATERAL_TIME_DIVISOR_KEY: string;
|
|
43
|
+
export declare const MAX_LENDABLE_IMPACT_FACTOR_KEY: string;
|
|
44
|
+
export declare const MAX_LENDABLE_IMPACT_USD_KEY: string;
|
|
45
|
+
export declare const MAX_LENDABLE_IMPACT_FACTOR_FOR_WITHDRAWALS_KEY: string;
|
|
46
|
+
export declare const LENT_POSITION_IMPACT_POOL_AMOUNT_KEY: string;
|
|
40
47
|
export declare const POSITION_IMPACT_POOL_AMOUNT_KEY: string;
|
|
41
48
|
export declare const MIN_POSITION_IMPACT_POOL_AMOUNT_KEY: string;
|
|
42
49
|
export declare const POSITION_IMPACT_POOL_DISTRIBUTION_RATE_KEY: string;
|
|
@@ -75,8 +82,10 @@ export declare const SUBACCOUNT_LIST_KEY: string;
|
|
|
75
82
|
export declare const MAX_ALLOWED_SUBACCOUNT_ACTION_COUNT: string;
|
|
76
83
|
export declare const SUBACCOUNT_ACTION_COUNT: string;
|
|
77
84
|
export declare const SUBACCOUNT_ORDER_ACTION: string;
|
|
85
|
+
export declare const SUBACCOUNT_INTEGRATION_ID: string;
|
|
78
86
|
export declare const SUBACCOUNT_AUTO_TOP_UP_AMOUNT: string;
|
|
79
87
|
export declare const GLV_MAX_MARKET_TOKEN_BALANCE_USD: string;
|
|
88
|
+
export declare const MIN_COLLATERAL_FACTOR_FOR_LIQUIDATION_KEY: string;
|
|
80
89
|
export declare const GLV_MAX_MARKET_TOKEN_BALANCE_AMOUNT: string;
|
|
81
90
|
export declare const IS_GLV_MARKET_DISABLED: string;
|
|
82
91
|
export declare const GLV_SHIFT_LAST_EXECUTED_AT: string;
|
|
@@ -89,11 +98,14 @@ export declare const OPTIMAL_USAGE_FACTOR: string;
|
|
|
89
98
|
export declare const BASE_BORROWING_FACTOR: string;
|
|
90
99
|
export declare const ABOVE_OPTIMAL_USAGE_BORROWING_FACTOR: string;
|
|
91
100
|
export declare const SUBACCOUNT_EXPIRES_AT: string;
|
|
101
|
+
export declare const MULTICHAIN_BALANCE: string;
|
|
92
102
|
export declare const PRICE_FEED_KEY: string;
|
|
93
103
|
export declare const GASLESS_FEATURE_DISABLED_KEY: string;
|
|
94
104
|
export declare const GELATO_RELAY_FEE_MULTIPLIER_FACTOR_KEY: string;
|
|
95
105
|
export declare const REQUEST_EXPIRATION_TIME_KEY: string;
|
|
96
106
|
export declare const GMX_SIMULATION_ORIGIN: string;
|
|
107
|
+
export declare const CLAIM_TERMS_KEY: string;
|
|
108
|
+
export declare const GENERAL_CLAIM_FEATURE_DISABLED: string;
|
|
97
109
|
export declare function subaccountExpiresAtKey(account: string, subaccount: string, actionType: string): string;
|
|
98
110
|
export declare function glvShiftLastExecutedAtKey(glvAddress: string): string;
|
|
99
111
|
export declare function glvShiftMinIntervalKey(glvAddress: string): string;
|
|
@@ -142,6 +154,7 @@ export declare function decreaseOrderGasLimitKey(): string;
|
|
|
142
154
|
export declare function swapOrderGasLimitKey(): string;
|
|
143
155
|
export declare function accountOrderListKey(account: string): string;
|
|
144
156
|
export declare function minCollateralFactorKey(market: string): string;
|
|
157
|
+
export declare function minCollateralFactorForLiquidationKey(market: string): string;
|
|
145
158
|
export declare function minCollateralFactorForOpenInterest(market: string, isLong: boolean): string;
|
|
146
159
|
export declare function hashedPositionKey(account: string, market: string, collateralToken: string, isLong: boolean): string;
|
|
147
160
|
export declare function claimableFundingAmountKey(market: string, token: string, account: string): string;
|
|
@@ -158,6 +171,13 @@ export declare function uiFeeFactorKey(address: string): string;
|
|
|
158
171
|
export declare function subaccountListKey(account: string): string;
|
|
159
172
|
export declare function maxAllowedSubaccountActionCountKey(account: string, subaccount: string, actionType: string): string;
|
|
160
173
|
export declare function subaccountActionCountKey(account: string, subaccount: string, actionType: string): string;
|
|
174
|
+
export declare function maxLendableImpactFactorKey(market: string): string;
|
|
175
|
+
export declare function maxLendableImpactFactorForWithdrawalsKey(market: string): string;
|
|
176
|
+
export declare function maxLendableImpactUsdKey(market: string): string;
|
|
177
|
+
export declare function subaccountIntegrationIdKey(account: string, subaccount: string): string;
|
|
161
178
|
export declare function subaccountAutoTopUpAmountKey(account: string, subaccount: string): string;
|
|
179
|
+
export declare function multichainBalanceKey(account: string, token: string): string;
|
|
162
180
|
export declare function priceFeedKey(token: string): string;
|
|
163
181
|
export declare function gaslessFeatureDisabledKey(module: string): string;
|
|
182
|
+
export declare function claimTermsKey(distributionId: bigint): string;
|
|
183
|
+
export declare function claimsDisabledKey(distributionId: bigint): string;
|
|
@@ -7,6 +7,7 @@ export declare const DEFAULT_PERMIT_DEADLINE_DURATION: number;
|
|
|
7
7
|
export declare const DEFAULT_EXPRESS_ORDER_DEADLINE_DURATION: number;
|
|
8
8
|
export declare const MIN_GELATO_USD_BALANCE_FOR_SPONSORED_CALL: bigint;
|
|
9
9
|
export declare const MIN_RELAYER_FEE_USD: bigint;
|
|
10
|
+
export declare const EXPRESS_EXTRA_EXECUTION_FEE_BUFFER_BPS = 1000;
|
|
10
11
|
export declare function getGasPaymentTokens(chainId: number): string[];
|
|
11
12
|
export declare function getDefaultGasPaymentToken(chainId: number): string;
|
|
12
13
|
export declare function getRelayerFeeToken(chainId: number): Token;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { USD_DECIMALS, BASIS_POINTS_DIVISOR, BASIS_POINTS_DIVISOR_BIGINT, BASIS_POINTS_DECIMALS } from "../utils/numbers";
|
|
2
2
|
export declare const HIGH_PRICE_IMPACT_BPS = 80;
|
|
3
3
|
export declare const HIGH_POSITION_IMPACT_BPS = 50;
|
|
4
|
-
export declare const HIGH_COLLATERAL_IMPACT_BPS =
|
|
4
|
+
export declare const HIGH_COLLATERAL_IMPACT_BPS = 2000;
|
|
5
5
|
export declare const HIGH_SWAP_IMPACT_BPS = 50;
|
|
6
6
|
export declare const DEFAULT_ACCEPTABLE_PRICE_IMPACT_BUFFER = 30;
|
|
7
7
|
export declare const HIGH_ALLOWED_SWAP_SLIPPAGE_BPS = 20;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ContractsChainId } from "./chains";
|
|
2
2
|
export declare const SWAP_GRAPH_MAX_MARKETS_PER_TOKEN = 5;
|
|
3
3
|
export type MarketConfig = {
|
|
4
4
|
marketTokenAddress: string;
|
|
@@ -6,4 +6,4 @@ export type MarketConfig = {
|
|
|
6
6
|
longTokenAddress: string;
|
|
7
7
|
shortTokenAddress: string;
|
|
8
8
|
};
|
|
9
|
-
export declare const MARKETS: Record<
|
|
9
|
+
export declare const MARKETS: Record<ContractsChainId, Record<string, MarketConfig>>;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export declare function getOracleKeeperUrl(chainId: number
|
|
2
|
-
export declare function
|
|
3
|
-
export declare function getOracleKeeperRandomIndex(chainId: number, bannedIndexes?: number[]): number;
|
|
1
|
+
export declare function getOracleKeeperUrl(chainId: number): any;
|
|
2
|
+
export declare function getOracleKeeperFallbackUrls(chainId: number): any;
|
|
@@ -74,6 +74,7 @@ export declare function getTokensMap(chainId: number): {
|
|
|
74
74
|
export declare function getWhitelistedV1Tokens(chainId: number): Token[];
|
|
75
75
|
export declare function getVisibleV1Tokens(chainId: number): Token[];
|
|
76
76
|
export declare function isValidToken(chainId: number, address: string): boolean;
|
|
77
|
+
export declare function isValidTokenSafe(chainId: number, address: string): boolean;
|
|
77
78
|
export declare function getToken(chainId: number, address: string): Token;
|
|
78
79
|
export declare function getTokenBySymbol(chainId: number, symbol: string, { isSynthetic, version, symbolType, }?: {
|
|
79
80
|
isSynthetic?: boolean;
|
|
@@ -26,7 +26,7 @@ export declare class GmxSdk {
|
|
|
26
26
|
setAccount(account: Address): void;
|
|
27
27
|
executeMulticall<T = any>(request: MulticallRequestConfig<any>): Promise<T>;
|
|
28
28
|
callContract(address: Address, abi: Abi, method: string, params: any[], opts?: CallContractOpts): Promise<`0x${string}`>;
|
|
29
|
-
get chainId(): import("./configs/chains").
|
|
29
|
+
get chainId(): import("./configs/chains").ContractsChainId;
|
|
30
30
|
get chain(): import("viem").Chain;
|
|
31
31
|
get account(): `0x${string}`;
|
|
32
32
|
}
|
|
@@ -3,6 +3,6 @@ export declare class Module {
|
|
|
3
3
|
sdk: GmxSdk;
|
|
4
4
|
constructor(sdk: GmxSdk);
|
|
5
5
|
get oracle(): import("./oracle").Oracle;
|
|
6
|
-
get chainId(): import("../configs/chains").
|
|
6
|
+
get chainId(): import("../configs/chains").ContractsChainId;
|
|
7
7
|
get account(): `0x${string}`;
|
|
8
8
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ContractsChainId } from "../../configs/chains";
|
|
1
2
|
import { MarketsData } from "../../types/markets";
|
|
2
3
|
import { TokensData } from "../../types/tokens";
|
|
3
4
|
import type { ContractCallsConfig } from "../../utils/multicall";
|
|
@@ -5,7 +6,7 @@ export declare function buildClaimableFundingDataRequest({ marketsAddresses, mar
|
|
|
5
6
|
marketsAddresses: string[] | undefined;
|
|
6
7
|
marketsData: MarketsData | undefined;
|
|
7
8
|
account: string;
|
|
8
|
-
chainId:
|
|
9
|
+
chainId: ContractsChainId;
|
|
9
10
|
}): Record<string, ContractCallsConfig<any>>;
|
|
10
11
|
export declare function buildMarketsValuesRequest(chainId: number, { marketsAddresses, marketsData, tokensData, dataStoreAddress, syntheticsReaderAddress, }: {
|
|
11
12
|
marketsAddresses: string[] | undefined;
|
|
@@ -33,7 +34,7 @@ export declare function buildMarketsConfigsRequest(chainId: number, { marketsDat
|
|
|
33
34
|
dataStoreAddress: string;
|
|
34
35
|
}): Promise<import("../../utils/multicall").MulticallRequestConfig<{
|
|
35
36
|
[key: `${string}-dataStore`]: {
|
|
36
|
-
calls: Record<"isDisabled" | "maxLongPoolAmount" | "maxShortPoolAmount" | "maxLongPoolUsdForDeposit" | "maxShortPoolUsdForDeposit" | "longPoolAmountAdjustment" | "shortPoolAmountAdjustment" | "reserveFactorLong" | "reserveFactorShort" | "openInterestReserveFactorLong" | "openInterestReserveFactorShort" | "maxOpenInterestLong" | "maxOpenInterestShort" | "minPositionImpactPoolAmount" | "positionImpactPoolDistributionRate" | "borrowingFactorLong" | "borrowingFactorShort" | "borrowingExponentFactorLong" | "borrowingExponentFactorShort" | "fundingFactor" | "fundingExponentFactor" | "fundingIncreaseFactorPerSecond" | "fundingDecreaseFactorPerSecond" | "thresholdForStableFunding" | "thresholdForDecreaseFunding" | "minFundingFactorPerSecond" | "maxFundingFactorPerSecond" | "maxPnlFactorForTradersLong" | "maxPnlFactorForTradersShort" | "
|
|
37
|
+
calls: Record<"isDisabled" | "maxLongPoolAmount" | "maxShortPoolAmount" | "maxLongPoolUsdForDeposit" | "maxShortPoolUsdForDeposit" | "longPoolAmountAdjustment" | "shortPoolAmountAdjustment" | "reserveFactorLong" | "reserveFactorShort" | "openInterestReserveFactorLong" | "openInterestReserveFactorShort" | "maxOpenInterestLong" | "maxOpenInterestShort" | "minPositionImpactPoolAmount" | "positionImpactPoolDistributionRate" | "borrowingFactorLong" | "borrowingFactorShort" | "borrowingExponentFactorLong" | "borrowingExponentFactorShort" | "fundingFactor" | "fundingExponentFactor" | "fundingIncreaseFactorPerSecond" | "fundingDecreaseFactorPerSecond" | "thresholdForStableFunding" | "thresholdForDecreaseFunding" | "minFundingFactorPerSecond" | "maxFundingFactorPerSecond" | "maxPnlFactorForTradersLong" | "maxPnlFactorForTradersShort" | "positionFeeFactorForBalanceWasImproved" | "positionFeeFactorForBalanceWasNotImproved" | "positionImpactFactorPositive" | "positionImpactFactorNegative" | "maxPositionImpactFactorPositive" | "maxPositionImpactFactorNegative" | "maxPositionImpactFactorForLiquidations" | "maxLendableImpactFactor" | "maxLendableImpactFactorForWithdrawals" | "maxLendableImpactUsd" | "lentPositionImpactPoolAmount" | "minCollateralFactor" | "minCollateralFactorForLiquidation" | "minCollateralFactorForOpenInterestLong" | "minCollateralFactorForOpenInterestShort" | "positionImpactExponentFactor" | "swapFeeFactorForBalanceWasImproved" | "swapFeeFactorForBalanceWasNotImproved" | "atomicSwapFeeFactor" | "swapImpactFactorPositive" | "swapImpactFactorNegative" | "swapImpactExponentFactor" | "virtualMarketId" | "virtualLongTokenId" | "virtualShortTokenId", {
|
|
37
38
|
methodName: string;
|
|
38
39
|
params: any[];
|
|
39
40
|
}>;
|
|
@@ -18,7 +18,7 @@ export type MarketValues = Pick<MarketInfo, "longInterestUsd" | "shortInterestUs
|
|
|
18
18
|
/**
|
|
19
19
|
* Updates seldom
|
|
20
20
|
*/
|
|
21
|
-
export type MarketConfig = Pick<MarketInfo, "isDisabled" | "maxLongPoolUsdForDeposit" | "maxShortPoolUsdForDeposit" | "maxLongPoolAmount" | "maxShortPoolAmount" | "longPoolAmountAdjustment" | "shortPoolAmountAdjustment" | "reserveFactorLong" | "reserveFactorShort" | "openInterestReserveFactorLong" | "openInterestReserveFactorShort" | "maxOpenInterestLong" | "maxOpenInterestShort" | "minPositionImpactPoolAmount" | "positionImpactPoolDistributionRate" | "borrowingFactorLong" | "borrowingFactorShort" | "borrowingExponentFactorLong" | "borrowingExponentFactorShort" | "fundingFactor" | "fundingExponentFactor" | "fundingIncreaseFactorPerSecond" | "fundingDecreaseFactorPerSecond" | "thresholdForDecreaseFunding" | "thresholdForStableFunding" | "minFundingFactorPerSecond" | "maxFundingFactorPerSecond" | "maxPnlFactorForTradersLong" | "maxPnlFactorForTradersShort" | "minCollateralFactor" | "minCollateralFactorForOpenInterestLong" | "minCollateralFactorForOpenInterestShort" | "
|
|
21
|
+
export type MarketConfig = Pick<MarketInfo, "isDisabled" | "maxLongPoolUsdForDeposit" | "maxShortPoolUsdForDeposit" | "maxLongPoolAmount" | "maxShortPoolAmount" | "longPoolAmountAdjustment" | "shortPoolAmountAdjustment" | "reserveFactorLong" | "reserveFactorShort" | "openInterestReserveFactorLong" | "openInterestReserveFactorShort" | "maxOpenInterestLong" | "maxOpenInterestShort" | "minPositionImpactPoolAmount" | "positionImpactPoolDistributionRate" | "borrowingFactorLong" | "borrowingFactorShort" | "borrowingExponentFactorLong" | "borrowingExponentFactorShort" | "fundingFactor" | "fundingExponentFactor" | "fundingIncreaseFactorPerSecond" | "fundingDecreaseFactorPerSecond" | "thresholdForDecreaseFunding" | "thresholdForStableFunding" | "minFundingFactorPerSecond" | "maxFundingFactorPerSecond" | "maxPnlFactorForTradersLong" | "maxPnlFactorForTradersShort" | "minCollateralFactor" | "minCollateralFactorForLiquidation" | "minCollateralFactorForOpenInterestLong" | "minCollateralFactorForOpenInterestShort" | "positionFeeFactorForBalanceWasImproved" | "positionFeeFactorForBalanceWasNotImproved" | "positionImpactFactorPositive" | "positionImpactFactorNegative" | "maxPositionImpactFactorPositive" | "maxPositionImpactFactorNegative" | "maxPositionImpactFactorForLiquidations" | "maxLendableImpactFactor" | "maxLendableImpactFactorForWithdrawals" | "maxLendableImpactUsd" | "lentPositionImpactPoolAmount" | "positionImpactExponentFactor" | "swapFeeFactorForBalanceWasImproved" | "swapFeeFactorForBalanceWasNotImproved" | "swapImpactFactorPositive" | "swapImpactFactorNegative" | "swapImpactExponentFactor" | "atomicSwapFeeFactor" | "virtualMarketId" | "virtualLongTokenId" | "virtualShortTokenId">;
|
|
22
22
|
export type MarketValuesMulticallRequestConfig = MulticallRequestConfig<{
|
|
23
23
|
[key: `${string}-reader`]: {
|
|
24
24
|
calls: Record<"marketInfo" | "marketTokenPriceMax" | "marketTokenPriceMin", {
|
|
@@ -35,7 +35,7 @@ export type MarketValuesMulticallRequestConfig = MulticallRequestConfig<{
|
|
|
35
35
|
}>;
|
|
36
36
|
export type MarketConfigMulticallRequestConfig = MulticallRequestConfig<{
|
|
37
37
|
[key: `${string}-dataStore`]: {
|
|
38
|
-
calls: Record<"isDisabled" | "maxLongPoolAmount" | "maxShortPoolAmount" | "maxLongPoolUsdForDeposit" | "maxShortPoolUsdForDeposit" | "longPoolAmountAdjustment" | "shortPoolAmountAdjustment" | "reserveFactorLong" | "reserveFactorShort" | "openInterestReserveFactorLong" | "openInterestReserveFactorShort" | "maxOpenInterestLong" | "maxOpenInterestShort" | "minPositionImpactPoolAmount" | "positionImpactPoolDistributionRate" | "borrowingFactorLong" | "borrowingFactorShort" | "borrowingExponentFactorLong" | "borrowingExponentFactorShort" | "fundingFactor" | "fundingExponentFactor" | "fundingIncreaseFactorPerSecond" | "fundingDecreaseFactorPerSecond" | "thresholdForStableFunding" | "thresholdForDecreaseFunding" | "minFundingFactorPerSecond" | "maxFundingFactorPerSecond" | "maxPnlFactorForTradersLong" | "maxPnlFactorForTradersShort" | "
|
|
38
|
+
calls: Record<"isDisabled" | "maxLongPoolAmount" | "maxShortPoolAmount" | "maxLongPoolUsdForDeposit" | "maxShortPoolUsdForDeposit" | "longPoolAmountAdjustment" | "shortPoolAmountAdjustment" | "reserveFactorLong" | "reserveFactorShort" | "openInterestReserveFactorLong" | "openInterestReserveFactorShort" | "maxOpenInterestLong" | "maxOpenInterestShort" | "minPositionImpactPoolAmount" | "positionImpactPoolDistributionRate" | "borrowingFactorLong" | "borrowingFactorShort" | "borrowingExponentFactorLong" | "borrowingExponentFactorShort" | "fundingFactor" | "fundingExponentFactor" | "fundingIncreaseFactorPerSecond" | "fundingDecreaseFactorPerSecond" | "thresholdForStableFunding" | "thresholdForDecreaseFunding" | "minFundingFactorPerSecond" | "maxFundingFactorPerSecond" | "maxPnlFactorForTradersLong" | "maxPnlFactorForTradersShort" | "positionFeeFactorForBalanceWasImproved" | "positionFeeFactorForBalanceWasNotImproved" | "positionImpactFactorPositive" | "positionImpactFactorNegative" | "maxPositionImpactFactorPositive" | "maxPositionImpactFactorNegative" | "maxPositionImpactFactorForLiquidations" | "maxLendableImpactFactor" | "maxLendableImpactFactorForWithdrawals" | "maxLendableImpactUsd" | "lentPositionImpactPoolAmount" | "minCollateralFactor" | "minCollateralFactorForLiquidation" | "minCollateralFactorForOpenInterestLong" | "minCollateralFactorForOpenInterestShort" | "positionImpactExponentFactor" | "swapFeeFactorForBalanceWasImproved" | "swapFeeFactorForBalanceWasNotImproved" | "atomicSwapFeeFactor" | "swapImpactFactorPositive" | "swapImpactFactorNegative" | "swapImpactExponentFactor" | "virtualMarketId" | "virtualLongTokenId" | "virtualShortTokenId", {
|
|
39
39
|
methodName: string;
|
|
40
40
|
params: any[];
|
|
41
41
|
}>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Address } from "viem";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import type { ContractsChainId } from "../../configs/chains";
|
|
3
|
+
import type { MarketFilterLongShortDirection, MarketFilterLongShortItemData } from "../trades/trades";
|
|
4
|
+
import type { GasLimitsConfig } from "../../types/fees";
|
|
5
|
+
import type { MarketsInfoData } from "../../types/markets";
|
|
5
6
|
import { DecreasePositionSwapType, Order } from "../../types/orders";
|
|
6
7
|
import { SidecarLimitOrderEntry, SidecarSlTpOrderEntry } from "../../types/sidecarOrders";
|
|
7
|
-
import { TokensData } from "../../types/tokens";
|
|
8
|
+
import type { TokensData } from "../../types/tokens";
|
|
8
9
|
import type { MulticallResult } from "../../utils/multicall";
|
|
9
10
|
import type { GmxSdk } from "../../index";
|
|
10
11
|
export declare const getOrderExecutionFee: (sdk: GmxSdk, swapsCount: number, decreasePositionSwapType: DecreasePositionSwapType | undefined, gasLimits: GasLimitsConfig | undefined, tokensData: TokensData | undefined, gasPrice: bigint | undefined) => import("../../types/fees").ExecutionFee | undefined;
|
|
@@ -21,7 +22,7 @@ export declare function matchByMarket({ order, nonSwapRelevantDefinedFiltersLowe
|
|
|
21
22
|
chainId: number;
|
|
22
23
|
}): boolean;
|
|
23
24
|
export declare const DEFAULT_COUNT = 1000;
|
|
24
|
-
export declare function buildGetOrdersMulticall(chainId:
|
|
25
|
+
export declare function buildGetOrdersMulticall(chainId: ContractsChainId, account: string): {
|
|
25
26
|
dataStore: {
|
|
26
27
|
contractAddress: `0x${string}`;
|
|
27
28
|
abiId: "DataStore";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TokenData } from "./tokens";
|
|
1
|
+
import type { TokenData } from "./tokens";
|
|
2
2
|
export type PnlFactorType = "FOR_DEPOSITS" | "FOR_WITHDRAWALS" | "FOR_TRADERS";
|
|
3
3
|
export type MarketSdkConfig = {
|
|
4
4
|
marketToken: string;
|
|
@@ -57,6 +57,7 @@ export type MarketInfo = Market & MarketPoolTokens & {
|
|
|
57
57
|
minPositionImpactPoolAmount: bigint;
|
|
58
58
|
positionImpactPoolDistributionRate: bigint;
|
|
59
59
|
minCollateralFactor: bigint;
|
|
60
|
+
minCollateralFactorForLiquidation: bigint;
|
|
60
61
|
minCollateralFactorForOpenInterestLong: bigint;
|
|
61
62
|
minCollateralFactorForOpenInterestShort: bigint;
|
|
62
63
|
swapImpactPoolAmountLong: bigint;
|
|
@@ -69,16 +70,20 @@ export type MarketInfo = Market & MarketPoolTokens & {
|
|
|
69
70
|
shortInterestUsd: bigint;
|
|
70
71
|
longInterestInTokens: bigint;
|
|
71
72
|
shortInterestInTokens: bigint;
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
positionFeeFactorForBalanceWasImproved: bigint;
|
|
74
|
+
positionFeeFactorForBalanceWasNotImproved: bigint;
|
|
74
75
|
positionImpactFactorPositive: bigint;
|
|
75
76
|
positionImpactFactorNegative: bigint;
|
|
76
77
|
maxPositionImpactFactorPositive: bigint;
|
|
77
78
|
maxPositionImpactFactorNegative: bigint;
|
|
78
79
|
maxPositionImpactFactorForLiquidations: bigint;
|
|
80
|
+
maxLendableImpactFactor: bigint;
|
|
81
|
+
maxLendableImpactFactorForWithdrawals: bigint;
|
|
82
|
+
maxLendableImpactUsd: bigint;
|
|
83
|
+
lentPositionImpactPoolAmount: bigint;
|
|
79
84
|
positionImpactExponentFactor: bigint;
|
|
80
|
-
|
|
81
|
-
|
|
85
|
+
swapFeeFactorForBalanceWasImproved: bigint;
|
|
86
|
+
swapFeeFactorForBalanceWasNotImproved: bigint;
|
|
82
87
|
atomicSwapFeeFactor: bigint;
|
|
83
88
|
swapImpactFactorPositive: bigint;
|
|
84
89
|
swapImpactFactorNegative: bigint;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Market, MarketInfo } from "./markets";
|
|
2
|
-
import { TokenData } from "./tokens";
|
|
1
|
+
import type { Market, MarketInfo } from "./markets";
|
|
2
|
+
import type { TokenData } from "./tokens";
|
|
3
3
|
export type Position = {
|
|
4
4
|
key: string;
|
|
5
5
|
contractKey: string;
|
|
@@ -21,6 +21,23 @@ export type Position = {
|
|
|
21
21
|
positionFeeAmount: bigint;
|
|
22
22
|
traderDiscountAmount: bigint;
|
|
23
23
|
uiFeeAmount: bigint;
|
|
24
|
+
pendingImpactAmount: bigint;
|
|
25
|
+
/**
|
|
26
|
+
* Not implemented in parsing
|
|
27
|
+
*/
|
|
28
|
+
borrowingFactor?: bigint;
|
|
29
|
+
/**
|
|
30
|
+
* Not implemented in parsing
|
|
31
|
+
*/
|
|
32
|
+
fundingFeeAmountPerSize?: bigint;
|
|
33
|
+
/**
|
|
34
|
+
* Not implemented in parsing
|
|
35
|
+
*/
|
|
36
|
+
longTokenClaimableFundingAmountPerSize?: bigint;
|
|
37
|
+
/**
|
|
38
|
+
* Not implemented in parsing
|
|
39
|
+
*/
|
|
40
|
+
shortTokenClaimableFundingAmountPerSize?: bigint;
|
|
24
41
|
data: string;
|
|
25
42
|
};
|
|
26
43
|
export type PositionInfo = Position & {
|
|
@@ -44,6 +61,10 @@ export type PositionInfo = Position & {
|
|
|
44
61
|
pnlPercentage: bigint;
|
|
45
62
|
pnlAfterFees: bigint;
|
|
46
63
|
pnlAfterFeesPercentage: bigint;
|
|
64
|
+
netPriceImapctDeltaUsd: bigint;
|
|
65
|
+
priceImpactDiffUsd: bigint;
|
|
66
|
+
pendingImpactUsd: bigint;
|
|
67
|
+
closePriceImpactDeltaUsd: bigint;
|
|
47
68
|
leverage: bigint | undefined;
|
|
48
69
|
leverageWithPnl: bigint | undefined;
|
|
49
70
|
netValue: bigint;
|
|
@@ -52,6 +73,9 @@ export type PositionInfo = Position & {
|
|
|
52
73
|
pendingFundingFeesUsd: bigint;
|
|
53
74
|
pendingClaimableFundingFeesUsd: bigint;
|
|
54
75
|
};
|
|
76
|
+
export type PositionInfoLoaded = PositionInfo & {
|
|
77
|
+
marketInfo: MarketInfo;
|
|
78
|
+
};
|
|
55
79
|
export type PositionsData = {
|
|
56
80
|
[positionKey: string]: Position;
|
|
57
81
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { PublicClient, WalletClient } from "viem";
|
|
2
|
-
import {
|
|
2
|
+
import type { ContractsChainId } from "../configs/chains";
|
|
3
3
|
import type { MarketSdkConfig } from "./markets";
|
|
4
4
|
import type { Token } from "./tokens";
|
|
5
5
|
export interface GmxSdkConfig {
|
|
6
6
|
/** Chain ID */
|
|
7
|
-
chainId:
|
|
7
|
+
chainId: ContractsChainId;
|
|
8
8
|
/** Account's address */
|
|
9
9
|
account?: string;
|
|
10
10
|
/** GMX Oracle URL */
|