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