perps-sdk-ts 1.0.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 (117) hide show
  1. package/.claude/settings.local.json +11 -0
  2. package/CONTRACT_METHOD_FIXES.md +189 -0
  3. package/INTEGRATION_SUMMARY.md +219 -0
  4. package/OPTIMIZATION_GUIDE.md +238 -0
  5. package/README.md +384 -0
  6. package/SNAPSHOT_FIX_SUMMARY.md +161 -0
  7. package/SNAPSHOT_OPTIMIZATION_SUMMARY.md +199 -0
  8. package/dist/abis/Referral.d.ts +36 -0
  9. package/dist/abis/Referral.js +4 -0
  10. package/dist/abis/Trading.d.ts +57 -0
  11. package/dist/abis/Trading.js +742 -0
  12. package/dist/abis/erc20.d.ts +51 -0
  13. package/dist/abis/erc20.js +4 -0
  14. package/dist/abis/index.d.ts +8 -0
  15. package/dist/abis/index.js +24 -0
  16. package/dist/abis/multicall.d.ts +85 -0
  17. package/dist/abis/multicall.js +4 -0
  18. package/dist/abis/pairInfos.d.ts +77 -0
  19. package/dist/abis/pairInfos.js +4 -0
  20. package/dist/abis/pairStorage.d.ts +124 -0
  21. package/dist/abis/pairStorage.js +4 -0
  22. package/dist/abis/priceAggregator.d.ts +77 -0
  23. package/dist/abis/priceAggregator.js +4 -0
  24. package/dist/abis/tardingStorage.d.ts +97 -0
  25. package/dist/abis/tardingStorage.js +1295 -0
  26. package/dist/abis.d.ts +623 -0
  27. package/dist/abis.js +49 -0
  28. package/dist/client.d.ts +118 -0
  29. package/dist/client.js +224 -0
  30. package/dist/config.d.ts +43 -0
  31. package/dist/config.js +42 -0
  32. package/dist/crypto/spki.d.ts +55 -0
  33. package/dist/crypto/spki.js +160 -0
  34. package/dist/feed/feed_client.d.ts +68 -0
  35. package/dist/feed/feed_client.js +239 -0
  36. package/dist/index.d.ts +28 -0
  37. package/dist/index.js +87 -0
  38. package/dist/rpc/asset_parameters.d.ts +62 -0
  39. package/dist/rpc/asset_parameters.js +169 -0
  40. package/dist/rpc/blended.d.ts +23 -0
  41. package/dist/rpc/blended.js +55 -0
  42. package/dist/rpc/category_parameters.d.ts +34 -0
  43. package/dist/rpc/category_parameters.js +105 -0
  44. package/dist/rpc/delegation.d.ts +81 -0
  45. package/dist/rpc/delegation.js +180 -0
  46. package/dist/rpc/fee_parameters.d.ts +46 -0
  47. package/dist/rpc/fee_parameters.js +113 -0
  48. package/dist/rpc/multicall.d.ts +83 -0
  49. package/dist/rpc/multicall.js +117 -0
  50. package/dist/rpc/pair_info_queries.d.ts +101 -0
  51. package/dist/rpc/pair_info_queries.js +161 -0
  52. package/dist/rpc/pairs_cache.d.ts +62 -0
  53. package/dist/rpc/pairs_cache.js +240 -0
  54. package/dist/rpc/referral_operations.d.ts +67 -0
  55. package/dist/rpc/referral_operations.js +143 -0
  56. package/dist/rpc/snapshot.d.ts +49 -0
  57. package/dist/rpc/snapshot.js +162 -0
  58. package/dist/rpc/trade.d.ts +84 -0
  59. package/dist/rpc/trade.js +249 -0
  60. package/dist/rpc/trading_operations.d.ts +103 -0
  61. package/dist/rpc/trading_operations.js +295 -0
  62. package/dist/rpc/trading_parameters.d.ts +49 -0
  63. package/dist/rpc/trading_parameters.js +94 -0
  64. package/dist/signers/base.d.ts +24 -0
  65. package/dist/signers/base.js +10 -0
  66. package/dist/signers/kms.d.ts +47 -0
  67. package/dist/signers/kms.js +172 -0
  68. package/dist/signers/local.d.ts +43 -0
  69. package/dist/signers/local.js +64 -0
  70. package/dist/types.d.ts +1419 -0
  71. package/dist/types.js +245 -0
  72. package/dist/utils.d.ts +52 -0
  73. package/dist/utils.js +134 -0
  74. package/examples/advanced-queries.ts +181 -0
  75. package/examples/basic-usage.ts +78 -0
  76. package/examples/delegation-and-referrals.ts +130 -0
  77. package/examples/get-pyth-ids.ts +61 -0
  78. package/examples/kms-signer.ts +31 -0
  79. package/examples/optimized-snapshot.ts +153 -0
  80. package/examples/price-feed-with-sdk-ids.ts +97 -0
  81. package/examples/price-feed.ts +36 -0
  82. package/examples/trading-operations.ts +149 -0
  83. package/package.json +41 -0
  84. package/src/abis/Referral.ts +3 -0
  85. package/src/abis/Trading.ts +741 -0
  86. package/src/abis/erc20.ts +3 -0
  87. package/src/abis/index.ts +8 -0
  88. package/src/abis/multicall.ts +3 -0
  89. package/src/abis/pairInfos.ts +3 -0
  90. package/src/abis/pairStorage.ts +3 -0
  91. package/src/abis/priceAggregator.ts +3 -0
  92. package/src/abis/tardingStorage.ts +1294 -0
  93. package/src/abis.ts +56 -0
  94. package/src/client.ts +373 -0
  95. package/src/config.ts +62 -0
  96. package/src/crypto/spki.ts +197 -0
  97. package/src/feed/feed_client.ts +288 -0
  98. package/src/index.ts +114 -0
  99. package/src/rpc/asset_parameters.ts +217 -0
  100. package/src/rpc/blended.ts +77 -0
  101. package/src/rpc/category_parameters.ts +128 -0
  102. package/src/rpc/delegation.ts +225 -0
  103. package/src/rpc/fee_parameters.ts +150 -0
  104. package/src/rpc/multicall.ts +164 -0
  105. package/src/rpc/pair_info_queries.ts +208 -0
  106. package/src/rpc/pairs_cache.ts +268 -0
  107. package/src/rpc/referral_operations.ts +164 -0
  108. package/src/rpc/snapshot.ts +210 -0
  109. package/src/rpc/trade.ts +306 -0
  110. package/src/rpc/trading_operations.ts +378 -0
  111. package/src/rpc/trading_parameters.ts +127 -0
  112. package/src/signers/base.ts +27 -0
  113. package/src/signers/kms.ts +212 -0
  114. package/src/signers/local.ts +70 -0
  115. package/src/types.ts +410 -0
  116. package/src/utils.ts +155 -0
  117. package/tsconfig.json +18 -0
@@ -0,0 +1,1295 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const abi = [
4
+ { inputs: [], stateMutability: "nonpayable", type: "constructor" },
5
+ {
6
+ anonymous: false,
7
+ inputs: [
8
+ { indexed: false, internalType: "string", name: "name", type: "string" },
9
+ { indexed: false, internalType: "address", name: "a", type: "address" },
10
+ ],
11
+ name: "AddressUpdated",
12
+ type: "event",
13
+ },
14
+ {
15
+ anonymous: false,
16
+ inputs: [
17
+ {
18
+ indexed: false,
19
+ internalType: "address",
20
+ name: "_trader",
21
+ type: "address",
22
+ },
23
+ {
24
+ indexed: false,
25
+ internalType: "uint256",
26
+ name: "_pairIndex",
27
+ type: "uint256",
28
+ },
29
+ { indexed: false, internalType: "bool", name: "_buy", type: "bool" },
30
+ { indexed: false, internalType: "uint256", name: "fee", type: "uint256" },
31
+ ],
32
+ name: "FeesCharged",
33
+ type: "event",
34
+ },
35
+ {
36
+ anonymous: false,
37
+ inputs: [
38
+ {
39
+ indexed: false,
40
+ internalType: "address",
41
+ name: "govTreasury",
42
+ type: "address",
43
+ },
44
+ {
45
+ indexed: false,
46
+ internalType: "uint256",
47
+ name: "govFees",
48
+ type: "uint256",
49
+ },
50
+ {
51
+ indexed: false,
52
+ internalType: "address",
53
+ name: "devTreasury",
54
+ type: "address",
55
+ },
56
+ {
57
+ indexed: false,
58
+ internalType: "uint256",
59
+ name: "devFees",
60
+ type: "uint256",
61
+ },
62
+ ],
63
+ name: "FeesClaimed",
64
+ type: "event",
65
+ },
66
+ {
67
+ anonymous: false,
68
+ inputs: [
69
+ {
70
+ indexed: false,
71
+ internalType: "uint256",
72
+ name: "devAmount",
73
+ type: "uint256",
74
+ },
75
+ {
76
+ indexed: false,
77
+ internalType: "uint256",
78
+ name: "govAmount",
79
+ type: "uint256",
80
+ },
81
+ ],
82
+ name: "FeesDecremented",
83
+ type: "event",
84
+ },
85
+ {
86
+ anonymous: false,
87
+ inputs: [
88
+ { indexed: false, internalType: "uint8", name: "version", type: "uint8" },
89
+ ],
90
+ name: "Initialized",
91
+ type: "event",
92
+ },
93
+ {
94
+ anonymous: false,
95
+ inputs: [
96
+ {
97
+ indexed: false,
98
+ internalType: "uint256",
99
+ name: "orderId",
100
+ type: "uint256",
101
+ },
102
+ {
103
+ indexed: true,
104
+ internalType: "address",
105
+ name: "trader",
106
+ type: "address",
107
+ },
108
+ {
109
+ indexed: false,
110
+ internalType: "uint256",
111
+ name: "pairIndex",
112
+ type: "uint256",
113
+ },
114
+ ],
115
+ name: "MarketOpenCanceled",
116
+ type: "event",
117
+ },
118
+ {
119
+ anonymous: false,
120
+ inputs: [
121
+ { indexed: false, internalType: "string", name: "name", type: "string" },
122
+ {
123
+ indexed: false,
124
+ internalType: "uint256",
125
+ name: "value",
126
+ type: "uint256",
127
+ },
128
+ ],
129
+ name: "NumberUpdated",
130
+ type: "event",
131
+ },
132
+ {
133
+ anonymous: false,
134
+ inputs: [
135
+ { indexed: false, internalType: "string", name: "name", type: "string" },
136
+ {
137
+ indexed: false,
138
+ internalType: "uint256",
139
+ name: "pairIndex",
140
+ type: "uint256",
141
+ },
142
+ {
143
+ indexed: false,
144
+ internalType: "uint256",
145
+ name: "value",
146
+ type: "uint256",
147
+ },
148
+ ],
149
+ name: "NumberUpdatedPair",
150
+ type: "event",
151
+ },
152
+ {
153
+ anonymous: false,
154
+ inputs: [
155
+ { indexed: false, internalType: "bool", name: "_open", type: "bool" },
156
+ { indexed: false, internalType: "bool", name: "_long", type: "bool" },
157
+ {
158
+ indexed: false,
159
+ internalType: "uint256",
160
+ name: "_pairIndex",
161
+ type: "uint256",
162
+ },
163
+ {
164
+ indexed: false,
165
+ internalType: "uint256",
166
+ name: "_leveragedPos",
167
+ type: "uint256",
168
+ },
169
+ {
170
+ indexed: false,
171
+ internalType: "uint256",
172
+ name: "_price",
173
+ type: "uint256",
174
+ },
175
+ ],
176
+ name: "OIUpdated",
177
+ type: "event",
178
+ },
179
+ {
180
+ anonymous: false,
181
+ inputs: [
182
+ {
183
+ indexed: false,
184
+ internalType: "address",
185
+ name: "referrer",
186
+ type: "address",
187
+ },
188
+ {
189
+ indexed: false,
190
+ internalType: "uint256",
191
+ name: "amount",
192
+ type: "uint256",
193
+ },
194
+ ],
195
+ name: "RebateClaimed",
196
+ type: "event",
197
+ },
198
+ {
199
+ anonymous: false,
200
+ inputs: [
201
+ { indexed: false, internalType: "address", name: "a", type: "address" },
202
+ ],
203
+ name: "SupportedTokenAdded",
204
+ type: "event",
205
+ },
206
+ {
207
+ anonymous: false,
208
+ inputs: [
209
+ {
210
+ indexed: false,
211
+ internalType: "address",
212
+ name: "_trader",
213
+ type: "address",
214
+ },
215
+ {
216
+ indexed: false,
217
+ internalType: "address",
218
+ name: "_referrer",
219
+ type: "address",
220
+ },
221
+ {
222
+ indexed: false,
223
+ internalType: "uint256",
224
+ name: "_leveragedPosition",
225
+ type: "uint256",
226
+ },
227
+ {
228
+ indexed: false,
229
+ internalType: "uint256",
230
+ name: "_traderFeePostDiscount",
231
+ type: "uint256",
232
+ },
233
+ {
234
+ indexed: false,
235
+ internalType: "uint256",
236
+ name: "_startingFees",
237
+ type: "uint256",
238
+ },
239
+ {
240
+ indexed: false,
241
+ internalType: "uint256",
242
+ name: "_referrerRebate",
243
+ type: "uint256",
244
+ },
245
+ {
246
+ indexed: false,
247
+ internalType: "uint256",
248
+ name: "_pairIndex",
249
+ type: "uint256",
250
+ },
251
+ ],
252
+ name: "TradeReferred",
253
+ type: "event",
254
+ },
255
+ {
256
+ anonymous: false,
257
+ inputs: [
258
+ { indexed: false, internalType: "address", name: "a", type: "address" },
259
+ ],
260
+ name: "TradingContractAdded",
261
+ type: "event",
262
+ },
263
+ {
264
+ anonymous: false,
265
+ inputs: [
266
+ { indexed: false, internalType: "address", name: "a", type: "address" },
267
+ ],
268
+ name: "TradingContractRemoved",
269
+ type: "event",
270
+ },
271
+ {
272
+ inputs: [{ internalType: "address", name: "__trading", type: "address" }],
273
+ name: "addTradingContract",
274
+ outputs: [],
275
+ stateMutability: "nonpayable",
276
+ type: "function",
277
+ },
278
+ {
279
+ inputs: [
280
+ { internalType: "address", name: "_trader", type: "address" },
281
+ { internalType: "uint256", name: "_fees", type: "uint256" },
282
+ { internalType: "uint256", name: "_leveragedPosition", type: "uint256" },
283
+ { internalType: "bool", name: "_isPnl", type: "bool" },
284
+ { internalType: "uint256", name: "_pairIndex", type: "uint256" },
285
+ { internalType: "int256", name: "_percentProfit", type: "int256" },
286
+ { internalType: "uint256", name: "_collateral", type: "uint256" },
287
+ ],
288
+ name: "applyReferralAndPnlFee",
289
+ outputs: [
290
+ { internalType: "uint256", name: "", type: "uint256" },
291
+ { internalType: "uint256", name: "", type: "uint256" },
292
+ ],
293
+ stateMutability: "nonpayable",
294
+ type: "function",
295
+ },
296
+ {
297
+ inputs: [
298
+ { internalType: "uint256", name: "", type: "uint256" },
299
+ { internalType: "uint256", name: "", type: "uint256" },
300
+ ],
301
+ name: "blockOI",
302
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
303
+ stateMutability: "view",
304
+ type: "function",
305
+ },
306
+ {
307
+ inputs: [],
308
+ name: "callbacks",
309
+ outputs: [{ internalType: "address", name: "", type: "address" }],
310
+ stateMutability: "view",
311
+ type: "function",
312
+ },
313
+ {
314
+ inputs: [
315
+ { internalType: "uint256", name: "_devAmount", type: "uint256" },
316
+ { internalType: "uint256", name: "_govAmount", type: "uint256" },
317
+ ],
318
+ name: "claimFees",
319
+ outputs: [],
320
+ stateMutability: "nonpayable",
321
+ type: "function",
322
+ },
323
+ {
324
+ inputs: [],
325
+ name: "claimRebate",
326
+ outputs: [],
327
+ stateMutability: "nonpayable",
328
+ type: "function",
329
+ },
330
+ {
331
+ inputs: [
332
+ { internalType: "uint256", name: "_devAmount", type: "uint256" },
333
+ { internalType: "uint256", name: "_govAmount", type: "uint256" },
334
+ ],
335
+ name: "decrementFees",
336
+ outputs: [],
337
+ stateMutability: "nonpayable",
338
+ type: "function",
339
+ },
340
+ {
341
+ inputs: [],
342
+ name: "dev",
343
+ outputs: [{ internalType: "address", name: "", type: "address" }],
344
+ stateMutability: "view",
345
+ type: "function",
346
+ },
347
+ {
348
+ inputs: [],
349
+ name: "devFeesUSDC",
350
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
351
+ stateMutability: "view",
352
+ type: "function",
353
+ },
354
+ {
355
+ inputs: [
356
+ { internalType: "address", name: "trader", type: "address" },
357
+ { internalType: "uint256", name: "pairIndex", type: "uint256" },
358
+ ],
359
+ name: "firstEmptyOpenLimitIndex",
360
+ outputs: [{ internalType: "uint256", name: "index", type: "uint256" }],
361
+ stateMutability: "view",
362
+ type: "function",
363
+ },
364
+ {
365
+ inputs: [
366
+ { internalType: "address", name: "trader", type: "address" },
367
+ { internalType: "uint256", name: "pairIndex", type: "uint256" },
368
+ ],
369
+ name: "firstEmptyTradeIndex",
370
+ outputs: [{ internalType: "uint256", name: "index", type: "uint256" }],
371
+ stateMutability: "view",
372
+ type: "function",
373
+ },
374
+ {
375
+ inputs: [{ internalType: "uint256", name: "_id", type: "uint256" }],
376
+ name: "forceUnregisterPendingMarketOrder",
377
+ outputs: [],
378
+ stateMutability: "nonpayable",
379
+ type: "function",
380
+ },
381
+ {
382
+ inputs: [
383
+ { internalType: "address", name: "_trader", type: "address" },
384
+ { internalType: "uint256", name: "_pairIndex", type: "uint256" },
385
+ { internalType: "uint256", name: "_index", type: "uint256" },
386
+ ],
387
+ name: "getOpenLimitOrder",
388
+ outputs: [
389
+ {
390
+ components: [
391
+ { internalType: "address", name: "trader", type: "address" },
392
+ { internalType: "uint256", name: "pairIndex", type: "uint256" },
393
+ { internalType: "uint256", name: "index", type: "uint256" },
394
+ { internalType: "uint256", name: "positionSize", type: "uint256" },
395
+ { internalType: "bool", name: "buy", type: "bool" },
396
+ { internalType: "uint256", name: "leverage", type: "uint256" },
397
+ { internalType: "uint256", name: "tp", type: "uint256" },
398
+ { internalType: "uint256", name: "sl", type: "uint256" },
399
+ { internalType: "uint256", name: "price", type: "uint256" },
400
+ { internalType: "uint256", name: "slippageP", type: "uint256" },
401
+ { internalType: "uint256", name: "block", type: "uint256" },
402
+ { internalType: "uint256", name: "executionFee", type: "uint256" },
403
+ ],
404
+ internalType: "struct ITradingStorage.OpenLimitOrder",
405
+ name: "",
406
+ type: "tuple",
407
+ },
408
+ ],
409
+ stateMutability: "view",
410
+ type: "function",
411
+ },
412
+ {
413
+ inputs: [],
414
+ name: "getOpenLimitOrders",
415
+ outputs: [
416
+ {
417
+ components: [
418
+ { internalType: "address", name: "trader", type: "address" },
419
+ { internalType: "uint256", name: "pairIndex", type: "uint256" },
420
+ { internalType: "uint256", name: "index", type: "uint256" },
421
+ { internalType: "uint256", name: "positionSize", type: "uint256" },
422
+ { internalType: "bool", name: "buy", type: "bool" },
423
+ { internalType: "uint256", name: "leverage", type: "uint256" },
424
+ { internalType: "uint256", name: "tp", type: "uint256" },
425
+ { internalType: "uint256", name: "sl", type: "uint256" },
426
+ { internalType: "uint256", name: "price", type: "uint256" },
427
+ { internalType: "uint256", name: "slippageP", type: "uint256" },
428
+ { internalType: "uint256", name: "block", type: "uint256" },
429
+ { internalType: "uint256", name: "executionFee", type: "uint256" },
430
+ ],
431
+ internalType: "struct ITradingStorage.OpenLimitOrder[]",
432
+ name: "",
433
+ type: "tuple[]",
434
+ },
435
+ ],
436
+ stateMutability: "view",
437
+ type: "function",
438
+ },
439
+ {
440
+ inputs: [{ internalType: "address", name: "_trader", type: "address" }],
441
+ name: "getPendingOrderIds",
442
+ outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }],
443
+ stateMutability: "view",
444
+ type: "function",
445
+ },
446
+ {
447
+ inputs: [],
448
+ name: "getUsdOI",
449
+ outputs: [{ internalType: "uint256[2]", name: "", type: "uint256[2]" }],
450
+ stateMutability: "view",
451
+ type: "function",
452
+ },
453
+ {
454
+ inputs: [],
455
+ name: "gov",
456
+ outputs: [{ internalType: "address", name: "", type: "address" }],
457
+ stateMutability: "view",
458
+ type: "function",
459
+ },
460
+ {
461
+ inputs: [],
462
+ name: "govFeesUSDC",
463
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
464
+ stateMutability: "view",
465
+ type: "function",
466
+ },
467
+ {
468
+ inputs: [],
469
+ name: "govTreasury",
470
+ outputs: [{ internalType: "address", name: "", type: "address" }],
471
+ stateMutability: "view",
472
+ type: "function",
473
+ },
474
+ {
475
+ inputs: [
476
+ { internalType: "address", name: "_trader", type: "address" },
477
+ { internalType: "uint256", name: "_pairIndex", type: "uint256" },
478
+ {
479
+ internalType: "uint256",
480
+ name: "_leveragedPositionSize",
481
+ type: "uint256",
482
+ },
483
+ { internalType: "bool", name: "_usdc", type: "bool" },
484
+ { internalType: "bool", name: "_fullFee", type: "bool" },
485
+ { internalType: "bool", name: "_buy", type: "bool" },
486
+ ],
487
+ name: "handleDevGovFees",
488
+ outputs: [
489
+ { internalType: "uint256", name: "feeAfterRebate", type: "uint256" },
490
+ ],
491
+ stateMutability: "nonpayable",
492
+ type: "function",
493
+ },
494
+ {
495
+ inputs: [
496
+ { internalType: "address", name: "trader", type: "address" },
497
+ { internalType: "uint256", name: "pairIndex", type: "uint256" },
498
+ { internalType: "uint256", name: "index", type: "uint256" },
499
+ ],
500
+ name: "hasOpenLimitOrder",
501
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
502
+ stateMutability: "view",
503
+ type: "function",
504
+ },
505
+ {
506
+ inputs: [
507
+ { internalType: "uint256", name: "devFees", type: "uint256" },
508
+ { internalType: "uint256", name: "govFees", type: "uint256" },
509
+ ],
510
+ name: "incrementClosingFees",
511
+ outputs: [],
512
+ stateMutability: "nonpayable",
513
+ type: "function",
514
+ },
515
+ {
516
+ inputs: [],
517
+ name: "initialize",
518
+ outputs: [],
519
+ stateMutability: "nonpayable",
520
+ type: "function",
521
+ },
522
+ {
523
+ inputs: [{ internalType: "address", name: "", type: "address" }],
524
+ name: "isTradingContract",
525
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
526
+ stateMutability: "view",
527
+ type: "function",
528
+ },
529
+ {
530
+ inputs: [
531
+ { internalType: "uint256", name: "_pairIndex", type: "uint256" },
532
+ { internalType: "bool", name: "buy", type: "bool" },
533
+ { internalType: "uint256", name: "leveragedPos", type: "uint256" },
534
+ ],
535
+ name: "isValidOI",
536
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
537
+ stateMutability: "view",
538
+ type: "function",
539
+ },
540
+ {
541
+ inputs: [],
542
+ name: "maxOpenInterest",
543
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
544
+ stateMutability: "view",
545
+ type: "function",
546
+ },
547
+ {
548
+ inputs: [],
549
+ name: "maxPendingMarketOrders",
550
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
551
+ stateMutability: "view",
552
+ type: "function",
553
+ },
554
+ {
555
+ inputs: [],
556
+ name: "maxTradesPerPair",
557
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
558
+ stateMutability: "view",
559
+ type: "function",
560
+ },
561
+ {
562
+ inputs: [
563
+ { internalType: "uint256", name: "", type: "uint256" },
564
+ { internalType: "uint256", name: "", type: "uint256" },
565
+ ],
566
+ name: "openInterestUSDC",
567
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
568
+ stateMutability: "view",
569
+ type: "function",
570
+ },
571
+ {
572
+ inputs: [
573
+ { internalType: "address", name: "", type: "address" },
574
+ { internalType: "uint256", name: "", type: "uint256" },
575
+ { internalType: "uint256", name: "", type: "uint256" },
576
+ ],
577
+ name: "openLimitOrderIds",
578
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
579
+ stateMutability: "view",
580
+ type: "function",
581
+ },
582
+ {
583
+ inputs: [{ internalType: "uint256", name: "", type: "uint256" }],
584
+ name: "openLimitOrders",
585
+ outputs: [
586
+ { internalType: "address", name: "trader", type: "address" },
587
+ { internalType: "uint256", name: "pairIndex", type: "uint256" },
588
+ { internalType: "uint256", name: "index", type: "uint256" },
589
+ { internalType: "uint256", name: "positionSize", type: "uint256" },
590
+ { internalType: "bool", name: "buy", type: "bool" },
591
+ { internalType: "uint256", name: "leverage", type: "uint256" },
592
+ { internalType: "uint256", name: "tp", type: "uint256" },
593
+ { internalType: "uint256", name: "sl", type: "uint256" },
594
+ { internalType: "uint256", name: "price", type: "uint256" },
595
+ { internalType: "uint256", name: "slippageP", type: "uint256" },
596
+ { internalType: "uint256", name: "block", type: "uint256" },
597
+ { internalType: "uint256", name: "executionFee", type: "uint256" },
598
+ ],
599
+ stateMutability: "view",
600
+ type: "function",
601
+ },
602
+ {
603
+ inputs: [
604
+ { internalType: "address", name: "", type: "address" },
605
+ { internalType: "uint256", name: "", type: "uint256" },
606
+ ],
607
+ name: "openLimitOrdersCount",
608
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
609
+ stateMutability: "view",
610
+ type: "function",
611
+ },
612
+ {
613
+ inputs: [
614
+ { internalType: "address", name: "_trader", type: "address" },
615
+ { internalType: "uint256", name: "_pairIndex", type: "uint256" },
616
+ { internalType: "uint256", name: "_index", type: "uint256" },
617
+ ],
618
+ name: "openTrades",
619
+ outputs: [
620
+ {
621
+ components: [
622
+ { internalType: "address", name: "trader", type: "address" },
623
+ { internalType: "uint256", name: "pairIndex", type: "uint256" },
624
+ { internalType: "uint256", name: "index", type: "uint256" },
625
+ { internalType: "uint256", name: "initialPosToken", type: "uint256" },
626
+ {
627
+ internalType: "uint256",
628
+ name: "positionSizeUSDC",
629
+ type: "uint256",
630
+ },
631
+ { internalType: "uint256", name: "openPrice", type: "uint256" },
632
+ { internalType: "bool", name: "buy", type: "bool" },
633
+ { internalType: "uint256", name: "leverage", type: "uint256" },
634
+ { internalType: "uint256", name: "tp", type: "uint256" },
635
+ { internalType: "uint256", name: "sl", type: "uint256" },
636
+ { internalType: "uint256", name: "timestamp", type: "uint256" },
637
+ ],
638
+ internalType: "struct ITradingStorage.Trade",
639
+ name: "",
640
+ type: "tuple",
641
+ },
642
+ ],
643
+ stateMutability: "view",
644
+ type: "function",
645
+ },
646
+ {
647
+ inputs: [
648
+ { internalType: "address", name: "_trader", type: "address" },
649
+ { internalType: "uint256", name: "_pairIndex", type: "uint256" },
650
+ ],
651
+ name: "openTradesCount",
652
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
653
+ stateMutability: "view",
654
+ type: "function",
655
+ },
656
+ {
657
+ inputs: [
658
+ { internalType: "address", name: "_trader", type: "address" },
659
+ { internalType: "uint256", name: "_pairIndex", type: "uint256" },
660
+ { internalType: "uint256", name: "_index", type: "uint256" },
661
+ ],
662
+ name: "openTradesInfo",
663
+ outputs: [
664
+ {
665
+ components: [
666
+ {
667
+ internalType: "uint256",
668
+ name: "openInterestUSDC",
669
+ type: "uint256",
670
+ },
671
+ { internalType: "uint256", name: "tpLastUpdated", type: "uint256" },
672
+ { internalType: "uint256", name: "slLastUpdated", type: "uint256" },
673
+ { internalType: "bool", name: "beingMarketClosed", type: "bool" },
674
+ { internalType: "uint256", name: "lossProtection", type: "uint256" },
675
+ ],
676
+ internalType: "struct ITradingStorage.TradeInfo",
677
+ name: "",
678
+ type: "tuple",
679
+ },
680
+ ],
681
+ stateMutability: "view",
682
+ type: "function",
683
+ },
684
+ {
685
+ inputs: [{ internalType: "uint256", name: "_pairIndex", type: "uint256" }],
686
+ name: "pairLongOI",
687
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
688
+ stateMutability: "view",
689
+ type: "function",
690
+ },
691
+ {
692
+ inputs: [{ internalType: "uint256", name: "_pairIndex", type: "uint256" }],
693
+ name: "pairOI",
694
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
695
+ stateMutability: "view",
696
+ type: "function",
697
+ },
698
+ {
699
+ inputs: [{ internalType: "uint256", name: "_pairIndex", type: "uint256" }],
700
+ name: "pairShortOI",
701
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
702
+ stateMutability: "view",
703
+ type: "function",
704
+ },
705
+ {
706
+ inputs: [
707
+ { internalType: "uint256", name: "", type: "uint256" },
708
+ { internalType: "uint256", name: "", type: "uint256" },
709
+ ],
710
+ name: "pairTraders",
711
+ outputs: [{ internalType: "address", name: "", type: "address" }],
712
+ stateMutability: "view",
713
+ type: "function",
714
+ },
715
+ {
716
+ inputs: [{ internalType: "uint256", name: "_pairIndex", type: "uint256" }],
717
+ name: "pairTradersArray",
718
+ outputs: [{ internalType: "address[]", name: "", type: "address[]" }],
719
+ stateMutability: "view",
720
+ type: "function",
721
+ },
722
+ {
723
+ inputs: [
724
+ { internalType: "address", name: "", type: "address" },
725
+ { internalType: "uint256", name: "", type: "uint256" },
726
+ ],
727
+ name: "pairTradersId",
728
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
729
+ stateMutability: "view",
730
+ type: "function",
731
+ },
732
+ {
733
+ inputs: [
734
+ { internalType: "address", name: "", type: "address" },
735
+ { internalType: "uint256", name: "", type: "uint256" },
736
+ ],
737
+ name: "pendingMarketCloseCount",
738
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
739
+ stateMutability: "view",
740
+ type: "function",
741
+ },
742
+ {
743
+ inputs: [
744
+ { internalType: "address", name: "", type: "address" },
745
+ { internalType: "uint256", name: "", type: "uint256" },
746
+ ],
747
+ name: "pendingMarketOpenCount",
748
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
749
+ stateMutability: "view",
750
+ type: "function",
751
+ },
752
+ {
753
+ inputs: [
754
+ { internalType: "address", name: "", type: "address" },
755
+ { internalType: "uint256", name: "", type: "uint256" },
756
+ ],
757
+ name: "pendingOrderIds",
758
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
759
+ stateMutability: "view",
760
+ type: "function",
761
+ },
762
+ {
763
+ inputs: [{ internalType: "address", name: "_trader", type: "address" }],
764
+ name: "pendingOrderIdsCount",
765
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
766
+ stateMutability: "view",
767
+ type: "function",
768
+ },
769
+ {
770
+ inputs: [],
771
+ name: "priceAggregator",
772
+ outputs: [
773
+ { internalType: "contract IPriceAggregator", name: "", type: "address" },
774
+ ],
775
+ stateMutability: "view",
776
+ type: "function",
777
+ },
778
+ {
779
+ inputs: [{ internalType: "address", name: "", type: "address" }],
780
+ name: "rebates",
781
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
782
+ stateMutability: "view",
783
+ type: "function",
784
+ },
785
+ {
786
+ inputs: [],
787
+ name: "referral",
788
+ outputs: [
789
+ { internalType: "contract IReferral", name: "", type: "address" },
790
+ ],
791
+ stateMutability: "view",
792
+ type: "function",
793
+ },
794
+ {
795
+ inputs: [
796
+ { internalType: "address", name: "trader", type: "address" },
797
+ { internalType: "uint256", name: "pairIndex", type: "uint256" },
798
+ { internalType: "uint256", name: "index", type: "uint256" },
799
+ { internalType: "uint256", name: "_amountReduced", type: "uint256" },
800
+ ],
801
+ name: "registerPartialTrade",
802
+ outputs: [],
803
+ stateMutability: "nonpayable",
804
+ type: "function",
805
+ },
806
+ {
807
+ inputs: [{ internalType: "address", name: "__trading", type: "address" }],
808
+ name: "removeTradingContract",
809
+ outputs: [],
810
+ stateMutability: "nonpayable",
811
+ type: "function",
812
+ },
813
+ {
814
+ inputs: [{ internalType: "uint256", name: "orderId", type: "uint256" }],
815
+ name: "reqIDpendingLimitOrder",
816
+ outputs: [
817
+ {
818
+ components: [
819
+ { internalType: "address", name: "trader", type: "address" },
820
+ { internalType: "uint256", name: "pairIndex", type: "uint256" },
821
+ { internalType: "uint256", name: "index", type: "uint256" },
822
+ {
823
+ internalType: "enum ITradingStorage.LimitOrder",
824
+ name: "orderType",
825
+ type: "uint8",
826
+ },
827
+ ],
828
+ internalType: "struct ITradingStorage.PendingLimitOrder",
829
+ name: "",
830
+ type: "tuple",
831
+ },
832
+ ],
833
+ stateMutability: "view",
834
+ type: "function",
835
+ },
836
+ {
837
+ inputs: [{ internalType: "uint256", name: "orderId", type: "uint256" }],
838
+ name: "reqIDpendingMarketOrder",
839
+ outputs: [
840
+ {
841
+ components: [
842
+ {
843
+ components: [
844
+ { internalType: "address", name: "trader", type: "address" },
845
+ { internalType: "uint256", name: "pairIndex", type: "uint256" },
846
+ { internalType: "uint256", name: "index", type: "uint256" },
847
+ {
848
+ internalType: "uint256",
849
+ name: "initialPosToken",
850
+ type: "uint256",
851
+ },
852
+ {
853
+ internalType: "uint256",
854
+ name: "positionSizeUSDC",
855
+ type: "uint256",
856
+ },
857
+ { internalType: "uint256", name: "openPrice", type: "uint256" },
858
+ { internalType: "bool", name: "buy", type: "bool" },
859
+ { internalType: "uint256", name: "leverage", type: "uint256" },
860
+ { internalType: "uint256", name: "tp", type: "uint256" },
861
+ { internalType: "uint256", name: "sl", type: "uint256" },
862
+ { internalType: "uint256", name: "timestamp", type: "uint256" },
863
+ ],
864
+ internalType: "struct ITradingStorage.Trade",
865
+ name: "trade",
866
+ type: "tuple",
867
+ },
868
+ { internalType: "uint256", name: "block", type: "uint256" },
869
+ { internalType: "uint256", name: "wantedPrice", type: "uint256" },
870
+ { internalType: "uint256", name: "slippageP", type: "uint256" },
871
+ ],
872
+ internalType: "struct ITradingStorage.PendingMarketOrder",
873
+ name: "",
874
+ type: "tuple",
875
+ },
876
+ ],
877
+ stateMutability: "view",
878
+ type: "function",
879
+ },
880
+ {
881
+ inputs: [{ internalType: "address", name: "_gov", type: "address" }],
882
+ name: "requestGov",
883
+ outputs: [],
884
+ stateMutability: "nonpayable",
885
+ type: "function",
886
+ },
887
+ {
888
+ inputs: [],
889
+ name: "requestedGov",
890
+ outputs: [{ internalType: "address", name: "", type: "address" }],
891
+ stateMutability: "view",
892
+ type: "function",
893
+ },
894
+ {
895
+ inputs: [
896
+ { internalType: "address", name: "_dev", type: "address" },
897
+ { internalType: "address", name: "_govTreasury", type: "address" },
898
+ ],
899
+ name: "setDevAndGovTreasury",
900
+ outputs: [],
901
+ stateMutability: "nonpayable",
902
+ type: "function",
903
+ },
904
+ {
905
+ inputs: [{ internalType: "address", name: "_newGov", type: "address" }],
906
+ name: "setGov",
907
+ outputs: [],
908
+ stateMutability: "nonpayable",
909
+ type: "function",
910
+ },
911
+ {
912
+ inputs: [
913
+ {
914
+ internalType: "uint256",
915
+ name: "_maxPendingMarketOrders",
916
+ type: "uint256",
917
+ },
918
+ ],
919
+ name: "setMaxPendingMarketOrders",
920
+ outputs: [],
921
+ stateMutability: "nonpayable",
922
+ type: "function",
923
+ },
924
+ {
925
+ inputs: [
926
+ { internalType: "uint256", name: "_maxTradesPerPair", type: "uint256" },
927
+ ],
928
+ name: "setMaxTradesPerPair",
929
+ outputs: [],
930
+ stateMutability: "nonpayable",
931
+ type: "function",
932
+ },
933
+ {
934
+ inputs: [
935
+ { internalType: "address", name: "_token", type: "address" },
936
+ { internalType: "address", name: "_aggregrator", type: "address" },
937
+ { internalType: "address", name: "_vaultManager", type: "address" },
938
+ { internalType: "address", name: "_referral", type: "address" },
939
+ { internalType: "address", name: "__trading", type: "address" },
940
+ { internalType: "address", name: "__callbacks", type: "address" },
941
+ ],
942
+ name: "setSuiteContracts",
943
+ outputs: [],
944
+ stateMutability: "nonpayable",
945
+ type: "function",
946
+ },
947
+ {
948
+ inputs: [{ internalType: "uint256", name: "_newCap", type: "uint256" }],
949
+ name: "setTvlCap",
950
+ outputs: [],
951
+ stateMutability: "nonpayable",
952
+ type: "function",
953
+ },
954
+ {
955
+ inputs: [
956
+ {
957
+ components: [
958
+ { internalType: "address", name: "trader", type: "address" },
959
+ { internalType: "uint256", name: "pairIndex", type: "uint256" },
960
+ { internalType: "uint256", name: "index", type: "uint256" },
961
+ { internalType: "uint256", name: "positionSize", type: "uint256" },
962
+ { internalType: "bool", name: "buy", type: "bool" },
963
+ { internalType: "uint256", name: "leverage", type: "uint256" },
964
+ { internalType: "uint256", name: "tp", type: "uint256" },
965
+ { internalType: "uint256", name: "sl", type: "uint256" },
966
+ { internalType: "uint256", name: "price", type: "uint256" },
967
+ { internalType: "uint256", name: "slippageP", type: "uint256" },
968
+ { internalType: "uint256", name: "block", type: "uint256" },
969
+ { internalType: "uint256", name: "executionFee", type: "uint256" },
970
+ ],
971
+ internalType: "struct ITradingStorage.OpenLimitOrder",
972
+ name: "o",
973
+ type: "tuple",
974
+ },
975
+ ],
976
+ name: "storeOpenLimitOrder",
977
+ outputs: [],
978
+ stateMutability: "nonpayable",
979
+ type: "function",
980
+ },
981
+ {
982
+ inputs: [
983
+ {
984
+ components: [
985
+ { internalType: "address", name: "trader", type: "address" },
986
+ { internalType: "uint256", name: "pairIndex", type: "uint256" },
987
+ { internalType: "uint256", name: "index", type: "uint256" },
988
+ {
989
+ internalType: "enum ITradingStorage.LimitOrder",
990
+ name: "orderType",
991
+ type: "uint8",
992
+ },
993
+ ],
994
+ internalType: "struct ITradingStorage.PendingLimitOrder",
995
+ name: "_limitOrder",
996
+ type: "tuple",
997
+ },
998
+ { internalType: "uint256", name: "_orderId", type: "uint256" },
999
+ ],
1000
+ name: "storePendingLimitOrder",
1001
+ outputs: [],
1002
+ stateMutability: "nonpayable",
1003
+ type: "function",
1004
+ },
1005
+ {
1006
+ inputs: [
1007
+ {
1008
+ components: [
1009
+ {
1010
+ components: [
1011
+ { internalType: "address", name: "trader", type: "address" },
1012
+ { internalType: "uint256", name: "pairIndex", type: "uint256" },
1013
+ { internalType: "uint256", name: "index", type: "uint256" },
1014
+ {
1015
+ internalType: "uint256",
1016
+ name: "initialPosToken",
1017
+ type: "uint256",
1018
+ },
1019
+ {
1020
+ internalType: "uint256",
1021
+ name: "positionSizeUSDC",
1022
+ type: "uint256",
1023
+ },
1024
+ { internalType: "uint256", name: "openPrice", type: "uint256" },
1025
+ { internalType: "bool", name: "buy", type: "bool" },
1026
+ { internalType: "uint256", name: "leverage", type: "uint256" },
1027
+ { internalType: "uint256", name: "tp", type: "uint256" },
1028
+ { internalType: "uint256", name: "sl", type: "uint256" },
1029
+ { internalType: "uint256", name: "timestamp", type: "uint256" },
1030
+ ],
1031
+ internalType: "struct ITradingStorage.Trade",
1032
+ name: "trade",
1033
+ type: "tuple",
1034
+ },
1035
+ { internalType: "uint256", name: "block", type: "uint256" },
1036
+ { internalType: "uint256", name: "wantedPrice", type: "uint256" },
1037
+ { internalType: "uint256", name: "slippageP", type: "uint256" },
1038
+ ],
1039
+ internalType: "struct ITradingStorage.PendingMarketOrder",
1040
+ name: "_order",
1041
+ type: "tuple",
1042
+ },
1043
+ { internalType: "uint256", name: "_id", type: "uint256" },
1044
+ { internalType: "bool", name: "_open", type: "bool" },
1045
+ ],
1046
+ name: "storePendingMarketOrder",
1047
+ outputs: [],
1048
+ stateMutability: "nonpayable",
1049
+ type: "function",
1050
+ },
1051
+ {
1052
+ inputs: [
1053
+ {
1054
+ components: [
1055
+ { internalType: "address", name: "trader", type: "address" },
1056
+ { internalType: "uint256", name: "pairIndex", type: "uint256" },
1057
+ { internalType: "uint256", name: "index", type: "uint256" },
1058
+ { internalType: "uint256", name: "initialPosToken", type: "uint256" },
1059
+ {
1060
+ internalType: "uint256",
1061
+ name: "positionSizeUSDC",
1062
+ type: "uint256",
1063
+ },
1064
+ { internalType: "uint256", name: "openPrice", type: "uint256" },
1065
+ { internalType: "bool", name: "buy", type: "bool" },
1066
+ { internalType: "uint256", name: "leverage", type: "uint256" },
1067
+ { internalType: "uint256", name: "tp", type: "uint256" },
1068
+ { internalType: "uint256", name: "sl", type: "uint256" },
1069
+ { internalType: "uint256", name: "timestamp", type: "uint256" },
1070
+ ],
1071
+ internalType: "struct ITradingStorage.Trade",
1072
+ name: "_trade",
1073
+ type: "tuple",
1074
+ },
1075
+ {
1076
+ components: [
1077
+ {
1078
+ internalType: "uint256",
1079
+ name: "openInterestUSDC",
1080
+ type: "uint256",
1081
+ },
1082
+ { internalType: "uint256", name: "tpLastUpdated", type: "uint256" },
1083
+ { internalType: "uint256", name: "slLastUpdated", type: "uint256" },
1084
+ { internalType: "bool", name: "beingMarketClosed", type: "bool" },
1085
+ { internalType: "uint256", name: "lossProtection", type: "uint256" },
1086
+ ],
1087
+ internalType: "struct ITradingStorage.TradeInfo",
1088
+ name: "_tradeInfo",
1089
+ type: "tuple",
1090
+ },
1091
+ { internalType: "bool", name: "isPnl", type: "bool" },
1092
+ ],
1093
+ name: "storeTrade",
1094
+ outputs: [],
1095
+ stateMutability: "nonpayable",
1096
+ type: "function",
1097
+ },
1098
+ {
1099
+ inputs: [],
1100
+ name: "totalOI",
1101
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1102
+ stateMutability: "view",
1103
+ type: "function",
1104
+ },
1105
+ {
1106
+ inputs: [],
1107
+ name: "trading",
1108
+ outputs: [{ internalType: "address", name: "", type: "address" }],
1109
+ stateMutability: "view",
1110
+ type: "function",
1111
+ },
1112
+ {
1113
+ inputs: [
1114
+ { internalType: "address", name: "_from", type: "address" },
1115
+ { internalType: "address", name: "_to", type: "address" },
1116
+ { internalType: "uint256", name: "_amount", type: "uint256" },
1117
+ ],
1118
+ name: "transferUSDC",
1119
+ outputs: [],
1120
+ stateMutability: "nonpayable",
1121
+ type: "function",
1122
+ },
1123
+ {
1124
+ inputs: [],
1125
+ name: "tvlCap",
1126
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1127
+ stateMutability: "view",
1128
+ type: "function",
1129
+ },
1130
+ {
1131
+ inputs: [
1132
+ { internalType: "address", name: "_trader", type: "address" },
1133
+ { internalType: "uint256", name: "_pairIndex", type: "uint256" },
1134
+ { internalType: "uint256", name: "_index", type: "uint256" },
1135
+ ],
1136
+ name: "unregisterOpenLimitOrder",
1137
+ outputs: [],
1138
+ stateMutability: "nonpayable",
1139
+ type: "function",
1140
+ },
1141
+ {
1142
+ inputs: [{ internalType: "uint256", name: "_order", type: "uint256" }],
1143
+ name: "unregisterPendingLimitOrder",
1144
+ outputs: [],
1145
+ stateMutability: "nonpayable",
1146
+ type: "function",
1147
+ },
1148
+ {
1149
+ inputs: [
1150
+ { internalType: "uint256", name: "_id", type: "uint256" },
1151
+ { internalType: "bool", name: "_open", type: "bool" },
1152
+ ],
1153
+ name: "unregisterPendingMarketOrder",
1154
+ outputs: [],
1155
+ stateMutability: "nonpayable",
1156
+ type: "function",
1157
+ },
1158
+ {
1159
+ inputs: [
1160
+ { internalType: "address", name: "trader", type: "address" },
1161
+ { internalType: "uint256", name: "pairIndex", type: "uint256" },
1162
+ { internalType: "uint256", name: "index", type: "uint256" },
1163
+ ],
1164
+ name: "unregisterTrade",
1165
+ outputs: [],
1166
+ stateMutability: "nonpayable",
1167
+ type: "function",
1168
+ },
1169
+ {
1170
+ inputs: [
1171
+ {
1172
+ components: [
1173
+ { internalType: "address", name: "trader", type: "address" },
1174
+ { internalType: "uint256", name: "pairIndex", type: "uint256" },
1175
+ { internalType: "uint256", name: "index", type: "uint256" },
1176
+ { internalType: "uint256", name: "positionSize", type: "uint256" },
1177
+ { internalType: "bool", name: "buy", type: "bool" },
1178
+ { internalType: "uint256", name: "leverage", type: "uint256" },
1179
+ { internalType: "uint256", name: "tp", type: "uint256" },
1180
+ { internalType: "uint256", name: "sl", type: "uint256" },
1181
+ { internalType: "uint256", name: "price", type: "uint256" },
1182
+ { internalType: "uint256", name: "slippageP", type: "uint256" },
1183
+ { internalType: "uint256", name: "block", type: "uint256" },
1184
+ { internalType: "uint256", name: "executionFee", type: "uint256" },
1185
+ ],
1186
+ internalType: "struct ITradingStorage.OpenLimitOrder",
1187
+ name: "_o",
1188
+ type: "tuple",
1189
+ },
1190
+ ],
1191
+ name: "updateOpenLimitOrder",
1192
+ outputs: [],
1193
+ stateMutability: "nonpayable",
1194
+ type: "function",
1195
+ },
1196
+ {
1197
+ inputs: [
1198
+ { internalType: "address", name: "_trader", type: "address" },
1199
+ { internalType: "uint256", name: "_pairIndex", type: "uint256" },
1200
+ { internalType: "uint256", name: "_index", type: "uint256" },
1201
+ { internalType: "uint256", name: "_newSl", type: "uint256" },
1202
+ ],
1203
+ name: "updateSl",
1204
+ outputs: [],
1205
+ stateMutability: "nonpayable",
1206
+ type: "function",
1207
+ },
1208
+ {
1209
+ inputs: [
1210
+ { internalType: "address", name: "_trader", type: "address" },
1211
+ { internalType: "uint256", name: "_pairIndex", type: "uint256" },
1212
+ { internalType: "uint256", name: "_index", type: "uint256" },
1213
+ { internalType: "uint256", name: "_newTp", type: "uint256" },
1214
+ ],
1215
+ name: "updateTp",
1216
+ outputs: [
1217
+ { internalType: "uint256", name: "correctedTP", type: "uint256" },
1218
+ ],
1219
+ stateMutability: "nonpayable",
1220
+ type: "function",
1221
+ },
1222
+ {
1223
+ inputs: [
1224
+ {
1225
+ components: [
1226
+ { internalType: "address", name: "trader", type: "address" },
1227
+ { internalType: "uint256", name: "pairIndex", type: "uint256" },
1228
+ { internalType: "uint256", name: "index", type: "uint256" },
1229
+ { internalType: "uint256", name: "initialPosToken", type: "uint256" },
1230
+ {
1231
+ internalType: "uint256",
1232
+ name: "positionSizeUSDC",
1233
+ type: "uint256",
1234
+ },
1235
+ { internalType: "uint256", name: "openPrice", type: "uint256" },
1236
+ { internalType: "bool", name: "buy", type: "bool" },
1237
+ { internalType: "uint256", name: "leverage", type: "uint256" },
1238
+ { internalType: "uint256", name: "tp", type: "uint256" },
1239
+ { internalType: "uint256", name: "sl", type: "uint256" },
1240
+ { internalType: "uint256", name: "timestamp", type: "uint256" },
1241
+ ],
1242
+ internalType: "struct ITradingStorage.Trade",
1243
+ name: "_t",
1244
+ type: "tuple",
1245
+ },
1246
+ ],
1247
+ name: "updateTrade",
1248
+ outputs: [],
1249
+ stateMutability: "nonpayable",
1250
+ type: "function",
1251
+ },
1252
+ {
1253
+ inputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1254
+ name: "usdOI",
1255
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1256
+ stateMutability: "view",
1257
+ type: "function",
1258
+ },
1259
+ {
1260
+ inputs: [],
1261
+ name: "usdc",
1262
+ outputs: [{ internalType: "contract IERC20", name: "", type: "address" }],
1263
+ stateMutability: "view",
1264
+ type: "function",
1265
+ },
1266
+ {
1267
+ inputs: [],
1268
+ name: "vaultManager",
1269
+ outputs: [
1270
+ { internalType: "contract IVaultManager", name: "", type: "address" },
1271
+ ],
1272
+ stateMutability: "view",
1273
+ type: "function",
1274
+ },
1275
+ {
1276
+ inputs: [{ internalType: "address", name: "_trader", type: "address" }],
1277
+ name: "walletOI",
1278
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1279
+ stateMutability: "view",
1280
+ type: "function",
1281
+ },
1282
+ {
1283
+ inputs: [
1284
+ { internalType: "address", name: "_trader", type: "address" },
1285
+ { internalType: "uint256", name: "_pairIndex", type: "uint256" },
1286
+ { internalType: "uint256", name: "_leveragedPos", type: "uint256" },
1287
+ { internalType: "bool", name: "_buy", type: "bool" },
1288
+ ],
1289
+ name: "withinExposureLimits",
1290
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1291
+ stateMutability: "view",
1292
+ type: "function",
1293
+ },
1294
+ ];
1295
+ exports.default = abi;