@gmx-io/sdk 0.0.1-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.
Files changed (237) hide show
  1. package/LICENSE +40 -0
  2. package/README.md +79 -0
  3. package/build/abis/CustomErrors.json +3254 -0
  4. package/build/abis/DataStore.json +1440 -0
  5. package/build/abis/ERC721.json +442 -0
  6. package/build/abis/EventEmitter.json +2065 -0
  7. package/build/abis/ExchangeRouter.json +1598 -0
  8. package/build/abis/GMT.json +522 -0
  9. package/build/abis/GlpManager.json +592 -0
  10. package/build/abis/GlvReader.json +1425 -0
  11. package/build/abis/GlvRouter.json +613 -0
  12. package/build/abis/GmxMigrator.json +657 -0
  13. package/build/abis/GovToken.json +1121 -0
  14. package/build/abis/MintableBaseToken.json +696 -0
  15. package/build/abis/Multicall.json +333 -0
  16. package/build/abis/OrderBook.json +1997 -0
  17. package/build/abis/OrderBookReader.json +111 -0
  18. package/build/abis/OrderExecutor.json +122 -0
  19. package/build/abis/PositionManager.json +1165 -0
  20. package/build/abis/PositionRouter.json +2030 -0
  21. package/build/abis/Reader.json +355 -0
  22. package/build/abis/ReaderV2.json +630 -0
  23. package/build/abis/ReferralStorage.json +507 -0
  24. package/build/abis/RewardReader.json +86 -0
  25. package/build/abis/RewardRouter.json +769 -0
  26. package/build/abis/RewardTracker.json +918 -0
  27. package/build/abis/Router-v2.json +605 -0
  28. package/build/abis/Router.json +605 -0
  29. package/build/abis/SubaccountRouter.json +648 -0
  30. package/build/abis/SyntheticsReader.json +4577 -0
  31. package/build/abis/SyntheticsRouter.json +77 -0
  32. package/build/abis/Timelock.json +1737 -0
  33. package/build/abis/Token.json +345 -0
  34. package/build/abis/Treasury.json +411 -0
  35. package/build/abis/UniPool.json +89 -0
  36. package/build/abis/UniswapV2.json +1 -0
  37. package/build/abis/Vault.json +3220 -0
  38. package/build/abis/VaultReader.json +87 -0
  39. package/build/abis/VaultV2.json +3019 -0
  40. package/build/abis/VaultV2b.json +3220 -0
  41. package/build/abis/Vester.json +1031 -0
  42. package/build/abis/WETH.json +320 -0
  43. package/build/abis/YieldFarm.json +599 -0
  44. package/build/abis/YieldToken.json +560 -0
  45. package/build/prebuilt/hashedMarketConfigKeys.json +3658 -0
  46. package/build/prebuilt/hashedMarketValuesKeys.json +1103 -0
  47. package/build/prebuilt/index.ts +28 -0
  48. package/build/src/abis/CustomErrors.json +3254 -0
  49. package/build/src/abis/DataStore.json +1440 -0
  50. package/build/src/abis/ERC721.json +442 -0
  51. package/build/src/abis/EventEmitter.json +2065 -0
  52. package/build/src/abis/ExchangeRouter.json +1598 -0
  53. package/build/src/abis/GMT.json +522 -0
  54. package/build/src/abis/GlpManager.json +591 -0
  55. package/build/src/abis/GlvReader.json +1424 -0
  56. package/build/src/abis/GlvRouter.json +612 -0
  57. package/build/src/abis/GmxMigrator.json +657 -0
  58. package/build/src/abis/GovToken.json +1121 -0
  59. package/build/src/abis/MintableBaseToken.json +696 -0
  60. package/build/src/abis/Multicall.json +333 -0
  61. package/build/src/abis/OrderBook.json +1997 -0
  62. package/build/src/abis/OrderBookReader.json +111 -0
  63. package/build/src/abis/OrderExecutor.json +122 -0
  64. package/build/src/abis/PositionManager.json +1165 -0
  65. package/build/src/abis/PositionRouter.json +2030 -0
  66. package/build/src/abis/Reader.json +355 -0
  67. package/build/src/abis/ReaderV2.json +630 -0
  68. package/build/src/abis/ReferralStorage.json +507 -0
  69. package/build/src/abis/RewardReader.json +86 -0
  70. package/build/src/abis/RewardRouter.json +769 -0
  71. package/build/src/abis/RewardTracker.json +918 -0
  72. package/build/src/abis/Router-v2.json +605 -0
  73. package/build/src/abis/Router.json +605 -0
  74. package/build/src/abis/SubaccountRouter.json +648 -0
  75. package/build/src/abis/SyntheticsReader.json +4577 -0
  76. package/build/src/abis/SyntheticsRouter.json +77 -0
  77. package/build/src/abis/Timelock.json +1737 -0
  78. package/build/src/abis/Token.json +345 -0
  79. package/build/src/abis/Treasury.json +411 -0
  80. package/build/src/abis/UniPool.json +89 -0
  81. package/build/src/abis/UniswapV2.json +1 -0
  82. package/build/src/abis/Vault.json +3220 -0
  83. package/build/src/abis/VaultReader.json +87 -0
  84. package/build/src/abis/VaultV2.json +3019 -0
  85. package/build/src/abis/VaultV2b.json +3220 -0
  86. package/build/src/abis/Vester.json +1031 -0
  87. package/build/src/abis/WETH.json +320 -0
  88. package/build/src/abis/YieldFarm.json +599 -0
  89. package/build/src/abis/YieldToken.json +560 -0
  90. package/build/src/configs/batch.d.ts +6 -0
  91. package/build/src/configs/batch.js +51 -0
  92. package/build/src/configs/chains.d.ts +37 -0
  93. package/build/src/configs/chains.js +90 -0
  94. package/build/src/configs/contracts.d.ts +2 -0
  95. package/build/src/configs/contracts.js +218 -0
  96. package/build/src/configs/dataStore.d.ts +149 -0
  97. package/build/src/configs/dataStore.js +276 -0
  98. package/build/src/configs/factors.d.ts +20 -0
  99. package/build/src/configs/factors.js +21 -0
  100. package/build/src/configs/markets.d.ts +8 -0
  101. package/build/src/configs/markets.js +528 -0
  102. package/build/src/configs/subgraph.d.ts +3 -0
  103. package/build/src/configs/subgraph.js +3 -0
  104. package/build/src/configs/tokens.d.ts +89 -0
  105. package/build/src/configs/tokens.js +1269 -0
  106. package/build/src/index.d.ts +44 -0
  107. package/build/src/index.js +245 -0
  108. package/build/src/modules/accounts/accounts.d.ts +5 -0
  109. package/build/src/modules/accounts/accounts.js +36 -0
  110. package/build/src/modules/accounts/accounts.spec.d.ts +1 -0
  111. package/build/src/modules/accounts/accounts.spec.js +7 -0
  112. package/build/src/modules/base.d.ts +9 -0
  113. package/build/src/modules/base.js +15 -0
  114. package/build/src/modules/markets/index.d.ts +26 -0
  115. package/build/src/modules/markets/index.js +339 -0
  116. package/build/src/modules/markets/markets.spec.d.ts +1 -0
  117. package/build/src/modules/markets/markets.spec.js +38 -0
  118. package/build/src/modules/markets/query-builders.d.ts +40 -0
  119. package/build/src/modules/markets/query-builders.js +379 -0
  120. package/build/src/modules/markets/types.d.ts +42 -0
  121. package/build/src/modules/markets/types.js +1 -0
  122. package/build/src/modules/oracle.d.ts +31 -0
  123. package/build/src/modules/oracle.js +53 -0
  124. package/build/src/modules/orders/orders.d.ts +60 -0
  125. package/build/src/modules/orders/orders.js +270 -0
  126. package/build/src/modules/orders/orders.spec.d.ts +1 -0
  127. package/build/src/modules/orders/orders.spec.js +16 -0
  128. package/build/src/modules/orders/transactions/cancelOrdersTxn.d.ts +6 -0
  129. package/build/src/modules/orders/transactions/cancelOrdersTxn.js +15 -0
  130. package/build/src/modules/orders/transactions/createDecreaseOrderTxn.d.ts +32 -0
  131. package/build/src/modules/orders/transactions/createDecreaseOrderTxn.js +98 -0
  132. package/build/src/modules/orders/transactions/createIncreaseOrderTxn.d.ts +77 -0
  133. package/build/src/modules/orders/transactions/createIncreaseOrderTxn.js +164 -0
  134. package/build/src/modules/orders/transactions/createSwapOrderTxn.d.ts +16 -0
  135. package/build/src/modules/orders/transactions/createSwapOrderTxn.js +97 -0
  136. package/build/src/modules/orders/transactions/createWrapOrUnwrapTxn.d.ts +6 -0
  137. package/build/src/modules/orders/transactions/createWrapOrUnwrapTxn.js +13 -0
  138. package/build/src/modules/orders/transactions/updateOrderTxn.d.ts +23 -0
  139. package/build/src/modules/orders/transactions/updateOrderTxn.js +44 -0
  140. package/build/src/modules/orders/utils.d.ts +248 -0
  141. package/build/src/modules/orders/utils.js +151 -0
  142. package/build/src/modules/positions/positions.d.ts +48 -0
  143. package/build/src/modules/positions/positions.js +563 -0
  144. package/build/src/modules/positions/positions.spec.d.ts +1 -0
  145. package/build/src/modules/positions/positions.spec.js +25 -0
  146. package/build/src/modules/tokens/tokens.d.ts +26 -0
  147. package/build/src/modules/tokens/tokens.js +132 -0
  148. package/build/src/modules/tokens/tokens.spec.d.ts +1 -0
  149. package/build/src/modules/tokens/tokens.spec.js +19 -0
  150. package/build/src/modules/trades/trades.d.ts +48 -0
  151. package/build/src/modules/trades/trades.js +390 -0
  152. package/build/src/modules/trades/trades.spec.d.ts +1 -0
  153. package/build/src/modules/trades/trades.spec.js +14 -0
  154. package/build/src/prebuilt/hashedMarketConfigKeys.json +3658 -0
  155. package/build/src/prebuilt/hashedMarketValuesKeys.json +1103 -0
  156. package/build/src/prebuilt/index.d.ts +14 -0
  157. package/build/src/prebuilt/index.js +9 -0
  158. package/build/src/types/amounts.d.ts +223 -0
  159. package/build/src/types/amounts.js +17 -0
  160. package/build/src/types/fees.d.ts +34 -0
  161. package/build/src/types/fees.js +1 -0
  162. package/build/src/types/markets.d.ts +143 -0
  163. package/build/src/types/markets.js +1 -0
  164. package/build/src/types/orders.d.ts +74 -0
  165. package/build/src/types/orders.js +33 -0
  166. package/build/src/types/positions.d.ts +53 -0
  167. package/build/src/types/positions.js +1 -0
  168. package/build/src/types/referrals.d.ts +124 -0
  169. package/build/src/types/referrals.js +9 -0
  170. package/build/src/types/sdk.d.ts +32 -0
  171. package/build/src/types/sdk.js +1 -0
  172. package/build/src/types/sidecarOrders.d.ts +54 -0
  173. package/build/src/types/sidecarOrders.js +1 -0
  174. package/build/src/types/syntheticsEvents.d.ts +88 -0
  175. package/build/src/types/syntheticsEvents.js +1 -0
  176. package/build/src/types/tokens.d.ts +89 -0
  177. package/build/src/types/tokens.js +1 -0
  178. package/build/src/types/trade.d.ts +223 -0
  179. package/build/src/types/trade.js +17 -0
  180. package/build/src/types/tradeHistory.d.ts +107 -0
  181. package/build/src/types/tradeHistory.js +8 -0
  182. package/build/src/utils/LruCache.d.ts +10 -0
  183. package/build/src/utils/LruCache.js +45 -0
  184. package/build/src/utils/bigmath.d.ts +7 -0
  185. package/build/src/utils/bigmath.js +23 -0
  186. package/build/src/utils/buildUrl.d.ts +1 -0
  187. package/build/src/utils/buildUrl.js +5 -0
  188. package/build/src/utils/callContract.d.ts +17 -0
  189. package/build/src/utils/callContract.js +133 -0
  190. package/build/src/utils/common.d.ts +2 -0
  191. package/build/src/utils/common.js +2 -0
  192. package/build/src/utils/fees/estimateOraclePriceCount.d.ts +6 -0
  193. package/build/src/utils/fees/estimateOraclePriceCount.js +19 -0
  194. package/build/src/utils/fees/executionFee.d.ts +59 -0
  195. package/build/src/utils/fees/executionFee.js +108 -0
  196. package/build/src/utils/fees/index.d.ts +29 -0
  197. package/build/src/utils/fees/index.js +89 -0
  198. package/build/src/utils/fees/priceImpact.d.ts +75 -0
  199. package/build/src/utils/fees/priceImpact.js +287 -0
  200. package/build/src/utils/graphqlFetcher.d.ts +1 -0
  201. package/build/src/utils/graphqlFetcher.js +18 -0
  202. package/build/src/utils/hash.d.ts +5 -0
  203. package/build/src/utils/hash.js +35 -0
  204. package/build/src/utils/marketKeysAndConfigs.d.ts +66 -0
  205. package/build/src/utils/marketKeysAndConfigs.js +257 -0
  206. package/build/src/utils/markets.d.ts +40 -0
  207. package/build/src/utils/markets.js +129 -0
  208. package/build/src/utils/multicall.d.ts +64 -0
  209. package/build/src/utils/multicall.js +116 -0
  210. package/build/src/utils/numbers.d.ts +9 -0
  211. package/build/src/utils/numbers.js +30 -0
  212. package/build/src/utils/objects.d.ts +18 -0
  213. package/build/src/utils/objects.js +30 -0
  214. package/build/src/utils/orders.d.ts +28 -0
  215. package/build/src/utils/orders.js +178 -0
  216. package/build/src/utils/positions.d.ts +60 -0
  217. package/build/src/utils/positions.js +133 -0
  218. package/build/src/utils/prices.d.ts +15 -0
  219. package/build/src/utils/prices.js +34 -0
  220. package/build/src/utils/referrals.d.ts +2 -0
  221. package/build/src/utils/referrals.js +27 -0
  222. package/build/src/utils/simulateExecuteOrder.d.ts +16 -0
  223. package/build/src/utils/simulateExecuteOrder.js +143 -0
  224. package/build/src/utils/slidingWindowFallbackSwitcher.d.ts +24 -0
  225. package/build/src/utils/slidingWindowFallbackSwitcher.js +40 -0
  226. package/build/src/utils/subgraph.d.ts +21 -0
  227. package/build/src/utils/subgraph.js +72 -0
  228. package/build/src/utils/swapStats.d.ts +35 -0
  229. package/build/src/utils/swapStats.js +197 -0
  230. package/build/src/utils/test.d.ts +2 -0
  231. package/build/src/utils/test.js +24 -0
  232. package/build/src/utils/tokens.d.ts +18 -0
  233. package/build/src/utils/tokens.js +64 -0
  234. package/build/src/utils/trade.d.ts +10 -0
  235. package/build/src/utils/trade.js +32 -0
  236. package/build/tsconfig.tsbuildinfo +1 -0
  237. package/package.json +96 -0
@@ -0,0 +1,1165 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "PositionManager",
4
+ "sourceName": "contracts/core/PositionManager.sol",
5
+ "abi": [
6
+ {
7
+ "inputs": [
8
+ {
9
+ "internalType": "address",
10
+ "name": "_vault",
11
+ "type": "address"
12
+ },
13
+ {
14
+ "internalType": "address",
15
+ "name": "_router",
16
+ "type": "address"
17
+ },
18
+ {
19
+ "internalType": "address",
20
+ "name": "_weth",
21
+ "type": "address"
22
+ },
23
+ {
24
+ "internalType": "uint256",
25
+ "name": "_depositFee",
26
+ "type": "uint256"
27
+ },
28
+ {
29
+ "internalType": "address",
30
+ "name": "_orderBook",
31
+ "type": "address"
32
+ }
33
+ ],
34
+ "stateMutability": "nonpayable",
35
+ "type": "constructor"
36
+ },
37
+ {
38
+ "anonymous": false,
39
+ "inputs": [
40
+ {
41
+ "indexed": false,
42
+ "internalType": "address",
43
+ "name": "account",
44
+ "type": "address"
45
+ },
46
+ {
47
+ "indexed": false,
48
+ "internalType": "uint256",
49
+ "name": "sizeDelta",
50
+ "type": "uint256"
51
+ },
52
+ {
53
+ "indexed": false,
54
+ "internalType": "uint256",
55
+ "name": "marginFeeBasisPoints",
56
+ "type": "uint256"
57
+ },
58
+ {
59
+ "indexed": false,
60
+ "internalType": "bytes32",
61
+ "name": "referralCode",
62
+ "type": "bytes32"
63
+ },
64
+ {
65
+ "indexed": false,
66
+ "internalType": "address",
67
+ "name": "referrer",
68
+ "type": "address"
69
+ }
70
+ ],
71
+ "name": "DecreasePositionReferral",
72
+ "type": "event"
73
+ },
74
+ {
75
+ "anonymous": false,
76
+ "inputs": [
77
+ {
78
+ "indexed": false,
79
+ "internalType": "address",
80
+ "name": "account",
81
+ "type": "address"
82
+ },
83
+ {
84
+ "indexed": false,
85
+ "internalType": "uint256",
86
+ "name": "sizeDelta",
87
+ "type": "uint256"
88
+ },
89
+ {
90
+ "indexed": false,
91
+ "internalType": "uint256",
92
+ "name": "marginFeeBasisPoints",
93
+ "type": "uint256"
94
+ },
95
+ {
96
+ "indexed": false,
97
+ "internalType": "bytes32",
98
+ "name": "referralCode",
99
+ "type": "bytes32"
100
+ },
101
+ {
102
+ "indexed": false,
103
+ "internalType": "address",
104
+ "name": "referrer",
105
+ "type": "address"
106
+ }
107
+ ],
108
+ "name": "IncreasePositionReferral",
109
+ "type": "event"
110
+ },
111
+ {
112
+ "anonymous": false,
113
+ "inputs": [
114
+ {
115
+ "indexed": false,
116
+ "internalType": "address",
117
+ "name": "admin",
118
+ "type": "address"
119
+ }
120
+ ],
121
+ "name": "SetAdmin",
122
+ "type": "event"
123
+ },
124
+ {
125
+ "anonymous": false,
126
+ "inputs": [
127
+ {
128
+ "indexed": false,
129
+ "internalType": "uint256",
130
+ "name": "depositFee",
131
+ "type": "uint256"
132
+ }
133
+ ],
134
+ "name": "SetDepositFee",
135
+ "type": "event"
136
+ },
137
+ {
138
+ "anonymous": false,
139
+ "inputs": [
140
+ {
141
+ "indexed": false,
142
+ "internalType": "bool",
143
+ "name": "inLegacyMode",
144
+ "type": "bool"
145
+ }
146
+ ],
147
+ "name": "SetInLegacyMode",
148
+ "type": "event"
149
+ },
150
+ {
151
+ "anonymous": false,
152
+ "inputs": [
153
+ {
154
+ "indexed": false,
155
+ "internalType": "uint256",
156
+ "name": "increasePositionBufferBps",
157
+ "type": "uint256"
158
+ }
159
+ ],
160
+ "name": "SetIncreasePositionBufferBps",
161
+ "type": "event"
162
+ },
163
+ {
164
+ "anonymous": false,
165
+ "inputs": [
166
+ {
167
+ "indexed": true,
168
+ "internalType": "address",
169
+ "name": "account",
170
+ "type": "address"
171
+ },
172
+ {
173
+ "indexed": false,
174
+ "internalType": "bool",
175
+ "name": "isActive",
176
+ "type": "bool"
177
+ }
178
+ ],
179
+ "name": "SetLiquidator",
180
+ "type": "event"
181
+ },
182
+ {
183
+ "anonymous": false,
184
+ "inputs": [
185
+ {
186
+ "indexed": false,
187
+ "internalType": "address[]",
188
+ "name": "tokens",
189
+ "type": "address[]"
190
+ },
191
+ {
192
+ "indexed": false,
193
+ "internalType": "uint256[]",
194
+ "name": "longSizes",
195
+ "type": "uint256[]"
196
+ },
197
+ {
198
+ "indexed": false,
199
+ "internalType": "uint256[]",
200
+ "name": "shortSizes",
201
+ "type": "uint256[]"
202
+ }
203
+ ],
204
+ "name": "SetMaxGlobalSizes",
205
+ "type": "event"
206
+ },
207
+ {
208
+ "anonymous": false,
209
+ "inputs": [
210
+ {
211
+ "indexed": true,
212
+ "internalType": "address",
213
+ "name": "account",
214
+ "type": "address"
215
+ },
216
+ {
217
+ "indexed": false,
218
+ "internalType": "bool",
219
+ "name": "isActive",
220
+ "type": "bool"
221
+ }
222
+ ],
223
+ "name": "SetOrderKeeper",
224
+ "type": "event"
225
+ },
226
+ {
227
+ "anonymous": false,
228
+ "inputs": [
229
+ {
230
+ "indexed": false,
231
+ "internalType": "address",
232
+ "name": "account",
233
+ "type": "address"
234
+ },
235
+ {
236
+ "indexed": false,
237
+ "internalType": "bool",
238
+ "name": "isActive",
239
+ "type": "bool"
240
+ }
241
+ ],
242
+ "name": "SetPartner",
243
+ "type": "event"
244
+ },
245
+ {
246
+ "anonymous": false,
247
+ "inputs": [
248
+ {
249
+ "indexed": false,
250
+ "internalType": "address",
251
+ "name": "referralStorage",
252
+ "type": "address"
253
+ }
254
+ ],
255
+ "name": "SetReferralStorage",
256
+ "type": "event"
257
+ },
258
+ {
259
+ "anonymous": false,
260
+ "inputs": [
261
+ {
262
+ "indexed": false,
263
+ "internalType": "bool",
264
+ "name": "shouldValidateIncreaseOrder",
265
+ "type": "bool"
266
+ }
267
+ ],
268
+ "name": "SetShouldValidateIncreaseOrder",
269
+ "type": "event"
270
+ },
271
+ {
272
+ "anonymous": false,
273
+ "inputs": [
274
+ {
275
+ "indexed": false,
276
+ "internalType": "address",
277
+ "name": "token",
278
+ "type": "address"
279
+ },
280
+ {
281
+ "indexed": false,
282
+ "internalType": "address",
283
+ "name": "receiver",
284
+ "type": "address"
285
+ },
286
+ {
287
+ "indexed": false,
288
+ "internalType": "uint256",
289
+ "name": "amount",
290
+ "type": "uint256"
291
+ }
292
+ ],
293
+ "name": "WithdrawFees",
294
+ "type": "event"
295
+ },
296
+ {
297
+ "inputs": [],
298
+ "name": "BASIS_POINTS_DIVISOR",
299
+ "outputs": [
300
+ {
301
+ "internalType": "uint256",
302
+ "name": "",
303
+ "type": "uint256"
304
+ }
305
+ ],
306
+ "stateMutability": "view",
307
+ "type": "function"
308
+ },
309
+ {
310
+ "inputs": [],
311
+ "name": "admin",
312
+ "outputs": [
313
+ {
314
+ "internalType": "address",
315
+ "name": "",
316
+ "type": "address"
317
+ }
318
+ ],
319
+ "stateMutability": "view",
320
+ "type": "function"
321
+ },
322
+ {
323
+ "inputs": [
324
+ {
325
+ "internalType": "address",
326
+ "name": "_token",
327
+ "type": "address"
328
+ },
329
+ {
330
+ "internalType": "address",
331
+ "name": "_spender",
332
+ "type": "address"
333
+ },
334
+ {
335
+ "internalType": "uint256",
336
+ "name": "_amount",
337
+ "type": "uint256"
338
+ }
339
+ ],
340
+ "name": "approve",
341
+ "outputs": [],
342
+ "stateMutability": "nonpayable",
343
+ "type": "function"
344
+ },
345
+ {
346
+ "inputs": [
347
+ {
348
+ "internalType": "address",
349
+ "name": "_collateralToken",
350
+ "type": "address"
351
+ },
352
+ {
353
+ "internalType": "address",
354
+ "name": "_indexToken",
355
+ "type": "address"
356
+ },
357
+ {
358
+ "internalType": "uint256",
359
+ "name": "_collateralDelta",
360
+ "type": "uint256"
361
+ },
362
+ {
363
+ "internalType": "uint256",
364
+ "name": "_sizeDelta",
365
+ "type": "uint256"
366
+ },
367
+ {
368
+ "internalType": "bool",
369
+ "name": "_isLong",
370
+ "type": "bool"
371
+ },
372
+ {
373
+ "internalType": "address",
374
+ "name": "_receiver",
375
+ "type": "address"
376
+ },
377
+ {
378
+ "internalType": "uint256",
379
+ "name": "_price",
380
+ "type": "uint256"
381
+ }
382
+ ],
383
+ "name": "decreasePosition",
384
+ "outputs": [],
385
+ "stateMutability": "nonpayable",
386
+ "type": "function"
387
+ },
388
+ {
389
+ "inputs": [
390
+ {
391
+ "internalType": "address[]",
392
+ "name": "_path",
393
+ "type": "address[]"
394
+ },
395
+ {
396
+ "internalType": "address",
397
+ "name": "_indexToken",
398
+ "type": "address"
399
+ },
400
+ {
401
+ "internalType": "uint256",
402
+ "name": "_collateralDelta",
403
+ "type": "uint256"
404
+ },
405
+ {
406
+ "internalType": "uint256",
407
+ "name": "_sizeDelta",
408
+ "type": "uint256"
409
+ },
410
+ {
411
+ "internalType": "bool",
412
+ "name": "_isLong",
413
+ "type": "bool"
414
+ },
415
+ {
416
+ "internalType": "address",
417
+ "name": "_receiver",
418
+ "type": "address"
419
+ },
420
+ {
421
+ "internalType": "uint256",
422
+ "name": "_price",
423
+ "type": "uint256"
424
+ },
425
+ {
426
+ "internalType": "uint256",
427
+ "name": "_minOut",
428
+ "type": "uint256"
429
+ }
430
+ ],
431
+ "name": "decreasePositionAndSwap",
432
+ "outputs": [],
433
+ "stateMutability": "nonpayable",
434
+ "type": "function"
435
+ },
436
+ {
437
+ "inputs": [
438
+ {
439
+ "internalType": "address[]",
440
+ "name": "_path",
441
+ "type": "address[]"
442
+ },
443
+ {
444
+ "internalType": "address",
445
+ "name": "_indexToken",
446
+ "type": "address"
447
+ },
448
+ {
449
+ "internalType": "uint256",
450
+ "name": "_collateralDelta",
451
+ "type": "uint256"
452
+ },
453
+ {
454
+ "internalType": "uint256",
455
+ "name": "_sizeDelta",
456
+ "type": "uint256"
457
+ },
458
+ {
459
+ "internalType": "bool",
460
+ "name": "_isLong",
461
+ "type": "bool"
462
+ },
463
+ {
464
+ "internalType": "address payable",
465
+ "name": "_receiver",
466
+ "type": "address"
467
+ },
468
+ {
469
+ "internalType": "uint256",
470
+ "name": "_price",
471
+ "type": "uint256"
472
+ },
473
+ {
474
+ "internalType": "uint256",
475
+ "name": "_minOut",
476
+ "type": "uint256"
477
+ }
478
+ ],
479
+ "name": "decreasePositionAndSwapETH",
480
+ "outputs": [],
481
+ "stateMutability": "nonpayable",
482
+ "type": "function"
483
+ },
484
+ {
485
+ "inputs": [
486
+ {
487
+ "internalType": "address",
488
+ "name": "_collateralToken",
489
+ "type": "address"
490
+ },
491
+ {
492
+ "internalType": "address",
493
+ "name": "_indexToken",
494
+ "type": "address"
495
+ },
496
+ {
497
+ "internalType": "uint256",
498
+ "name": "_collateralDelta",
499
+ "type": "uint256"
500
+ },
501
+ {
502
+ "internalType": "uint256",
503
+ "name": "_sizeDelta",
504
+ "type": "uint256"
505
+ },
506
+ {
507
+ "internalType": "bool",
508
+ "name": "_isLong",
509
+ "type": "bool"
510
+ },
511
+ {
512
+ "internalType": "address payable",
513
+ "name": "_receiver",
514
+ "type": "address"
515
+ },
516
+ {
517
+ "internalType": "uint256",
518
+ "name": "_price",
519
+ "type": "uint256"
520
+ }
521
+ ],
522
+ "name": "decreasePositionETH",
523
+ "outputs": [],
524
+ "stateMutability": "nonpayable",
525
+ "type": "function"
526
+ },
527
+ {
528
+ "inputs": [],
529
+ "name": "depositFee",
530
+ "outputs": [
531
+ {
532
+ "internalType": "uint256",
533
+ "name": "",
534
+ "type": "uint256"
535
+ }
536
+ ],
537
+ "stateMutability": "view",
538
+ "type": "function"
539
+ },
540
+ {
541
+ "inputs": [
542
+ {
543
+ "internalType": "address",
544
+ "name": "_account",
545
+ "type": "address"
546
+ },
547
+ {
548
+ "internalType": "uint256",
549
+ "name": "_orderIndex",
550
+ "type": "uint256"
551
+ },
552
+ {
553
+ "internalType": "address payable",
554
+ "name": "_feeReceiver",
555
+ "type": "address"
556
+ }
557
+ ],
558
+ "name": "executeDecreaseOrder",
559
+ "outputs": [],
560
+ "stateMutability": "nonpayable",
561
+ "type": "function"
562
+ },
563
+ {
564
+ "inputs": [
565
+ {
566
+ "internalType": "address",
567
+ "name": "_account",
568
+ "type": "address"
569
+ },
570
+ {
571
+ "internalType": "uint256",
572
+ "name": "_orderIndex",
573
+ "type": "uint256"
574
+ },
575
+ {
576
+ "internalType": "address payable",
577
+ "name": "_feeReceiver",
578
+ "type": "address"
579
+ }
580
+ ],
581
+ "name": "executeIncreaseOrder",
582
+ "outputs": [],
583
+ "stateMutability": "nonpayable",
584
+ "type": "function"
585
+ },
586
+ {
587
+ "inputs": [
588
+ {
589
+ "internalType": "address",
590
+ "name": "_account",
591
+ "type": "address"
592
+ },
593
+ {
594
+ "internalType": "uint256",
595
+ "name": "_orderIndex",
596
+ "type": "uint256"
597
+ },
598
+ {
599
+ "internalType": "address payable",
600
+ "name": "_feeReceiver",
601
+ "type": "address"
602
+ }
603
+ ],
604
+ "name": "executeSwapOrder",
605
+ "outputs": [],
606
+ "stateMutability": "nonpayable",
607
+ "type": "function"
608
+ },
609
+ {
610
+ "inputs": [
611
+ {
612
+ "internalType": "address",
613
+ "name": "",
614
+ "type": "address"
615
+ }
616
+ ],
617
+ "name": "feeReserves",
618
+ "outputs": [
619
+ {
620
+ "internalType": "uint256",
621
+ "name": "",
622
+ "type": "uint256"
623
+ }
624
+ ],
625
+ "stateMutability": "view",
626
+ "type": "function"
627
+ },
628
+ {
629
+ "inputs": [],
630
+ "name": "gov",
631
+ "outputs": [
632
+ {
633
+ "internalType": "address",
634
+ "name": "",
635
+ "type": "address"
636
+ }
637
+ ],
638
+ "stateMutability": "view",
639
+ "type": "function"
640
+ },
641
+ {
642
+ "inputs": [],
643
+ "name": "inLegacyMode",
644
+ "outputs": [
645
+ {
646
+ "internalType": "bool",
647
+ "name": "",
648
+ "type": "bool"
649
+ }
650
+ ],
651
+ "stateMutability": "view",
652
+ "type": "function"
653
+ },
654
+ {
655
+ "inputs": [
656
+ {
657
+ "internalType": "address[]",
658
+ "name": "_path",
659
+ "type": "address[]"
660
+ },
661
+ {
662
+ "internalType": "address",
663
+ "name": "_indexToken",
664
+ "type": "address"
665
+ },
666
+ {
667
+ "internalType": "uint256",
668
+ "name": "_amountIn",
669
+ "type": "uint256"
670
+ },
671
+ {
672
+ "internalType": "uint256",
673
+ "name": "_minOut",
674
+ "type": "uint256"
675
+ },
676
+ {
677
+ "internalType": "uint256",
678
+ "name": "_sizeDelta",
679
+ "type": "uint256"
680
+ },
681
+ {
682
+ "internalType": "bool",
683
+ "name": "_isLong",
684
+ "type": "bool"
685
+ },
686
+ {
687
+ "internalType": "uint256",
688
+ "name": "_price",
689
+ "type": "uint256"
690
+ }
691
+ ],
692
+ "name": "increasePosition",
693
+ "outputs": [],
694
+ "stateMutability": "nonpayable",
695
+ "type": "function"
696
+ },
697
+ {
698
+ "inputs": [],
699
+ "name": "increasePositionBufferBps",
700
+ "outputs": [
701
+ {
702
+ "internalType": "uint256",
703
+ "name": "",
704
+ "type": "uint256"
705
+ }
706
+ ],
707
+ "stateMutability": "view",
708
+ "type": "function"
709
+ },
710
+ {
711
+ "inputs": [
712
+ {
713
+ "internalType": "address[]",
714
+ "name": "_path",
715
+ "type": "address[]"
716
+ },
717
+ {
718
+ "internalType": "address",
719
+ "name": "_indexToken",
720
+ "type": "address"
721
+ },
722
+ {
723
+ "internalType": "uint256",
724
+ "name": "_minOut",
725
+ "type": "uint256"
726
+ },
727
+ {
728
+ "internalType": "uint256",
729
+ "name": "_sizeDelta",
730
+ "type": "uint256"
731
+ },
732
+ {
733
+ "internalType": "bool",
734
+ "name": "_isLong",
735
+ "type": "bool"
736
+ },
737
+ {
738
+ "internalType": "uint256",
739
+ "name": "_price",
740
+ "type": "uint256"
741
+ }
742
+ ],
743
+ "name": "increasePositionETH",
744
+ "outputs": [],
745
+ "stateMutability": "payable",
746
+ "type": "function"
747
+ },
748
+ {
749
+ "inputs": [
750
+ {
751
+ "internalType": "address",
752
+ "name": "",
753
+ "type": "address"
754
+ }
755
+ ],
756
+ "name": "isLiquidator",
757
+ "outputs": [
758
+ {
759
+ "internalType": "bool",
760
+ "name": "",
761
+ "type": "bool"
762
+ }
763
+ ],
764
+ "stateMutability": "view",
765
+ "type": "function"
766
+ },
767
+ {
768
+ "inputs": [
769
+ {
770
+ "internalType": "address",
771
+ "name": "",
772
+ "type": "address"
773
+ }
774
+ ],
775
+ "name": "isOrderKeeper",
776
+ "outputs": [
777
+ {
778
+ "internalType": "bool",
779
+ "name": "",
780
+ "type": "bool"
781
+ }
782
+ ],
783
+ "stateMutability": "view",
784
+ "type": "function"
785
+ },
786
+ {
787
+ "inputs": [
788
+ {
789
+ "internalType": "address",
790
+ "name": "",
791
+ "type": "address"
792
+ }
793
+ ],
794
+ "name": "isPartner",
795
+ "outputs": [
796
+ {
797
+ "internalType": "bool",
798
+ "name": "",
799
+ "type": "bool"
800
+ }
801
+ ],
802
+ "stateMutability": "view",
803
+ "type": "function"
804
+ },
805
+ {
806
+ "inputs": [
807
+ {
808
+ "internalType": "address",
809
+ "name": "_account",
810
+ "type": "address"
811
+ },
812
+ {
813
+ "internalType": "address",
814
+ "name": "_collateralToken",
815
+ "type": "address"
816
+ },
817
+ {
818
+ "internalType": "address",
819
+ "name": "_indexToken",
820
+ "type": "address"
821
+ },
822
+ {
823
+ "internalType": "bool",
824
+ "name": "_isLong",
825
+ "type": "bool"
826
+ },
827
+ {
828
+ "internalType": "address",
829
+ "name": "_feeReceiver",
830
+ "type": "address"
831
+ }
832
+ ],
833
+ "name": "liquidatePosition",
834
+ "outputs": [],
835
+ "stateMutability": "nonpayable",
836
+ "type": "function"
837
+ },
838
+ {
839
+ "inputs": [
840
+ {
841
+ "internalType": "address",
842
+ "name": "",
843
+ "type": "address"
844
+ }
845
+ ],
846
+ "name": "maxGlobalLongSizes",
847
+ "outputs": [
848
+ {
849
+ "internalType": "uint256",
850
+ "name": "",
851
+ "type": "uint256"
852
+ }
853
+ ],
854
+ "stateMutability": "view",
855
+ "type": "function"
856
+ },
857
+ {
858
+ "inputs": [
859
+ {
860
+ "internalType": "address",
861
+ "name": "",
862
+ "type": "address"
863
+ }
864
+ ],
865
+ "name": "maxGlobalShortSizes",
866
+ "outputs": [
867
+ {
868
+ "internalType": "uint256",
869
+ "name": "",
870
+ "type": "uint256"
871
+ }
872
+ ],
873
+ "stateMutability": "view",
874
+ "type": "function"
875
+ },
876
+ {
877
+ "inputs": [],
878
+ "name": "orderBook",
879
+ "outputs": [
880
+ {
881
+ "internalType": "address",
882
+ "name": "",
883
+ "type": "address"
884
+ }
885
+ ],
886
+ "stateMutability": "view",
887
+ "type": "function"
888
+ },
889
+ {
890
+ "inputs": [],
891
+ "name": "referralStorage",
892
+ "outputs": [
893
+ {
894
+ "internalType": "address",
895
+ "name": "",
896
+ "type": "address"
897
+ }
898
+ ],
899
+ "stateMutability": "view",
900
+ "type": "function"
901
+ },
902
+ {
903
+ "inputs": [],
904
+ "name": "router",
905
+ "outputs": [
906
+ {
907
+ "internalType": "address",
908
+ "name": "",
909
+ "type": "address"
910
+ }
911
+ ],
912
+ "stateMutability": "view",
913
+ "type": "function"
914
+ },
915
+ {
916
+ "inputs": [
917
+ {
918
+ "internalType": "address payable",
919
+ "name": "_receiver",
920
+ "type": "address"
921
+ },
922
+ {
923
+ "internalType": "uint256",
924
+ "name": "_amount",
925
+ "type": "uint256"
926
+ }
927
+ ],
928
+ "name": "sendValue",
929
+ "outputs": [],
930
+ "stateMutability": "nonpayable",
931
+ "type": "function"
932
+ },
933
+ {
934
+ "inputs": [
935
+ {
936
+ "internalType": "address",
937
+ "name": "_admin",
938
+ "type": "address"
939
+ }
940
+ ],
941
+ "name": "setAdmin",
942
+ "outputs": [],
943
+ "stateMutability": "nonpayable",
944
+ "type": "function"
945
+ },
946
+ {
947
+ "inputs": [
948
+ {
949
+ "internalType": "uint256",
950
+ "name": "_depositFee",
951
+ "type": "uint256"
952
+ }
953
+ ],
954
+ "name": "setDepositFee",
955
+ "outputs": [],
956
+ "stateMutability": "nonpayable",
957
+ "type": "function"
958
+ },
959
+ {
960
+ "inputs": [
961
+ {
962
+ "internalType": "address",
963
+ "name": "_gov",
964
+ "type": "address"
965
+ }
966
+ ],
967
+ "name": "setGov",
968
+ "outputs": [],
969
+ "stateMutability": "nonpayable",
970
+ "type": "function"
971
+ },
972
+ {
973
+ "inputs": [
974
+ {
975
+ "internalType": "bool",
976
+ "name": "_inLegacyMode",
977
+ "type": "bool"
978
+ }
979
+ ],
980
+ "name": "setInLegacyMode",
981
+ "outputs": [],
982
+ "stateMutability": "nonpayable",
983
+ "type": "function"
984
+ },
985
+ {
986
+ "inputs": [
987
+ {
988
+ "internalType": "uint256",
989
+ "name": "_increasePositionBufferBps",
990
+ "type": "uint256"
991
+ }
992
+ ],
993
+ "name": "setIncreasePositionBufferBps",
994
+ "outputs": [],
995
+ "stateMutability": "nonpayable",
996
+ "type": "function"
997
+ },
998
+ {
999
+ "inputs": [
1000
+ {
1001
+ "internalType": "address",
1002
+ "name": "_account",
1003
+ "type": "address"
1004
+ },
1005
+ {
1006
+ "internalType": "bool",
1007
+ "name": "_isActive",
1008
+ "type": "bool"
1009
+ }
1010
+ ],
1011
+ "name": "setLiquidator",
1012
+ "outputs": [],
1013
+ "stateMutability": "nonpayable",
1014
+ "type": "function"
1015
+ },
1016
+ {
1017
+ "inputs": [
1018
+ {
1019
+ "internalType": "address[]",
1020
+ "name": "_tokens",
1021
+ "type": "address[]"
1022
+ },
1023
+ {
1024
+ "internalType": "uint256[]",
1025
+ "name": "_longSizes",
1026
+ "type": "uint256[]"
1027
+ },
1028
+ {
1029
+ "internalType": "uint256[]",
1030
+ "name": "_shortSizes",
1031
+ "type": "uint256[]"
1032
+ }
1033
+ ],
1034
+ "name": "setMaxGlobalSizes",
1035
+ "outputs": [],
1036
+ "stateMutability": "nonpayable",
1037
+ "type": "function"
1038
+ },
1039
+ {
1040
+ "inputs": [
1041
+ {
1042
+ "internalType": "address",
1043
+ "name": "_account",
1044
+ "type": "address"
1045
+ },
1046
+ {
1047
+ "internalType": "bool",
1048
+ "name": "_isActive",
1049
+ "type": "bool"
1050
+ }
1051
+ ],
1052
+ "name": "setOrderKeeper",
1053
+ "outputs": [],
1054
+ "stateMutability": "nonpayable",
1055
+ "type": "function"
1056
+ },
1057
+ {
1058
+ "inputs": [
1059
+ {
1060
+ "internalType": "address",
1061
+ "name": "_account",
1062
+ "type": "address"
1063
+ },
1064
+ {
1065
+ "internalType": "bool",
1066
+ "name": "_isActive",
1067
+ "type": "bool"
1068
+ }
1069
+ ],
1070
+ "name": "setPartner",
1071
+ "outputs": [],
1072
+ "stateMutability": "nonpayable",
1073
+ "type": "function"
1074
+ },
1075
+ {
1076
+ "inputs": [
1077
+ {
1078
+ "internalType": "address",
1079
+ "name": "_referralStorage",
1080
+ "type": "address"
1081
+ }
1082
+ ],
1083
+ "name": "setReferralStorage",
1084
+ "outputs": [],
1085
+ "stateMutability": "nonpayable",
1086
+ "type": "function"
1087
+ },
1088
+ {
1089
+ "inputs": [
1090
+ {
1091
+ "internalType": "bool",
1092
+ "name": "_shouldValidateIncreaseOrder",
1093
+ "type": "bool"
1094
+ }
1095
+ ],
1096
+ "name": "setShouldValidateIncreaseOrder",
1097
+ "outputs": [],
1098
+ "stateMutability": "nonpayable",
1099
+ "type": "function"
1100
+ },
1101
+ {
1102
+ "inputs": [],
1103
+ "name": "shouldValidateIncreaseOrder",
1104
+ "outputs": [
1105
+ {
1106
+ "internalType": "bool",
1107
+ "name": "",
1108
+ "type": "bool"
1109
+ }
1110
+ ],
1111
+ "stateMutability": "view",
1112
+ "type": "function"
1113
+ },
1114
+ {
1115
+ "inputs": [],
1116
+ "name": "vault",
1117
+ "outputs": [
1118
+ {
1119
+ "internalType": "address",
1120
+ "name": "",
1121
+ "type": "address"
1122
+ }
1123
+ ],
1124
+ "stateMutability": "view",
1125
+ "type": "function"
1126
+ },
1127
+ {
1128
+ "inputs": [],
1129
+ "name": "weth",
1130
+ "outputs": [
1131
+ {
1132
+ "internalType": "address",
1133
+ "name": "",
1134
+ "type": "address"
1135
+ }
1136
+ ],
1137
+ "stateMutability": "view",
1138
+ "type": "function"
1139
+ },
1140
+ {
1141
+ "inputs": [
1142
+ {
1143
+ "internalType": "address",
1144
+ "name": "_token",
1145
+ "type": "address"
1146
+ },
1147
+ {
1148
+ "internalType": "address",
1149
+ "name": "_receiver",
1150
+ "type": "address"
1151
+ }
1152
+ ],
1153
+ "name": "withdrawFees",
1154
+ "outputs": [],
1155
+ "stateMutability": "nonpayable",
1156
+ "type": "function"
1157
+ },
1158
+ {
1159
+ "stateMutability": "payable",
1160
+ "type": "receive"
1161
+ }
1162
+ ],
1163
+ "linkReferences": {},
1164
+ "deployedLinkReferences": {}
1165
+ }