@gainsnetwork/sdk 1.5.0-rc6 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/lib/constants.js +4 -4
  2. package/lib/contracts/types/generated/GFarmTradingStorageV5.d.ts +1911 -0
  3. package/lib/contracts/types/generated/GFarmTradingStorageV5.js +2 -0
  4. package/lib/contracts/types/generated/GNSBorrowingFees.d.ts +1067 -0
  5. package/lib/contracts/types/generated/GNSBorrowingFees.js +2 -0
  6. package/lib/contracts/types/generated/GNSBorrowingFeesV6_3_2.d.ts +979 -0
  7. package/lib/contracts/types/generated/GNSBorrowingFeesV6_3_2.js +2 -0
  8. package/lib/contracts/types/generated/GNSBorrowingFeesV6_4.d.ts +1058 -0
  9. package/lib/contracts/types/generated/GNSBorrowingFeesV6_4.js +2 -0
  10. package/lib/contracts/types/generated/GNSNftRewardsV6.d.ts +533 -0
  11. package/lib/contracts/types/generated/GNSNftRewardsV6.js +2 -0
  12. package/lib/contracts/types/generated/GNSNftRewardsV6_3_1.d.ts +613 -0
  13. package/lib/contracts/types/generated/GNSNftRewardsV6_3_1.js +2 -0
  14. package/lib/contracts/types/generated/GNSPairInfosV6_1.d.ts +911 -0
  15. package/lib/contracts/types/generated/GNSPairInfosV6_1.js +2 -0
  16. package/lib/contracts/types/generated/GNSPairsStorageV6.d.ts +660 -0
  17. package/lib/contracts/types/generated/GNSPairsStorageV6.js +2 -0
  18. package/lib/contracts/types/generated/GNSTrading.d.ts +758 -0
  19. package/lib/contracts/types/generated/GNSTrading.js +2 -0
  20. package/lib/contracts/types/generated/GNSTradingCallbacks.d.ts +875 -0
  21. package/lib/contracts/types/generated/GNSTradingCallbacks.js +2 -0
  22. package/lib/contracts/types/generated/GNSTradingCallbacksV6_3_2.d.ts +806 -0
  23. package/lib/contracts/types/generated/GNSTradingCallbacksV6_3_2.js +2 -0
  24. package/lib/contracts/types/generated/GNSTradingCallbacksV6_4.d.ts +821 -0
  25. package/lib/contracts/types/generated/GNSTradingCallbacksV6_4.js +2 -0
  26. package/lib/contracts/types/generated/GNSTradingStorage.d.ts +1387 -0
  27. package/lib/contracts/types/generated/GNSTradingStorage.js +2 -0
  28. package/lib/contracts/types/generated/GTokenV6_3_2.d.ts +1838 -0
  29. package/lib/contracts/types/generated/GTokenV6_3_2.js +2 -0
  30. package/lib/contracts/types/generated/factories/GFarmTradingStorageV5__factory.d.ts +83 -0
  31. package/lib/contracts/types/generated/factories/GFarmTradingStorageV5__factory.js +2691 -0
  32. package/lib/contracts/types/generated/factories/GNSBorrowingFeesV6_3_2__factory.d.ts +88 -0
  33. package/lib/contracts/types/generated/factories/GNSBorrowingFeesV6_3_2__factory.js +1654 -0
  34. package/lib/contracts/types/generated/factories/GNSBorrowingFeesV6_4__factory.d.ts +113 -0
  35. package/lib/contracts/types/generated/factories/GNSBorrowingFeesV6_4__factory.js +1742 -0
  36. package/lib/contracts/types/generated/factories/GNSBorrowingFees__factory.d.ts +124 -0
  37. package/lib/contracts/types/generated/factories/GNSBorrowingFees__factory.js +1784 -0
  38. package/lib/contracts/types/generated/factories/GNSNftRewardsV6_3_1__factory.d.ts +100 -0
  39. package/lib/contracts/types/generated/factories/GNSNftRewardsV6_3_1__factory.js +1116 -0
  40. package/lib/contracts/types/generated/factories/GNSNftRewardsV6__factory.d.ts +100 -0
  41. package/lib/contracts/types/generated/factories/GNSNftRewardsV6__factory.js +1003 -0
  42. package/lib/contracts/types/generated/factories/GNSPairInfosV6_1__factory.d.ts +98 -0
  43. package/lib/contracts/types/generated/factories/GNSPairInfosV6_1__factory.js +1485 -0
  44. package/lib/contracts/types/generated/factories/GNSPairsStorageV6__factory.d.ts +117 -0
  45. package/lib/contracts/types/generated/factories/GNSPairsStorageV6__factory.js +1265 -0
  46. package/lib/contracts/types/generated/factories/GNSTradingCallbacksV6_3_2__factory.d.ts +82 -0
  47. package/lib/contracts/types/generated/factories/GNSTradingCallbacksV6_3_2__factory.js +1273 -0
  48. package/lib/contracts/types/generated/factories/GNSTradingCallbacksV6_4__factory.d.ts +82 -0
  49. package/lib/contracts/types/generated/factories/GNSTradingCallbacksV6_4__factory.js +1326 -0
  50. package/lib/contracts/types/generated/factories/GNSTradingCallbacks__factory.d.ts +113 -0
  51. package/lib/contracts/types/generated/factories/GNSTradingCallbacks__factory.js +1428 -0
  52. package/lib/contracts/types/generated/factories/GNSTradingStorage__factory.d.ts +96 -0
  53. package/lib/contracts/types/generated/factories/GNSTradingStorage__factory.js +2241 -0
  54. package/lib/contracts/types/generated/factories/GNSTrading__factory.d.ts +95 -0
  55. package/lib/contracts/types/generated/factories/GNSTrading__factory.js +1071 -0
  56. package/lib/contracts/types/generated/factories/GTokenV6_3_2__factory.d.ts +110 -0
  57. package/lib/contracts/types/generated/factories/GTokenV6_3_2__factory.js +2682 -0
  58. package/lib/markets/oi/fetcher.d.ts +58 -0
  59. package/lib/markets/oi/fetcher.js +181 -0
  60. package/lib/markets/oi/validation.d.ts +80 -0
  61. package/lib/markets/oi/validation.js +172 -0
  62. package/lib/pricing/depthBands/converter.d.ts +65 -0
  63. package/lib/pricing/depthBands/converter.js +155 -0
  64. package/lib/pricing/depthBands/decoder.d.ts +32 -0
  65. package/lib/pricing/depthBands/decoder.js +109 -0
  66. package/lib/pricing/depthBands/encoder.d.ts +19 -0
  67. package/lib/pricing/depthBands/encoder.js +105 -0
  68. package/lib/pricing/depthBands/index.d.ts +8 -0
  69. package/lib/pricing/depthBands/index.js +26 -0
  70. package/lib/pricing/depthBands/types.d.ts +49 -0
  71. package/lib/pricing/depthBands/types.js +10 -0
  72. package/lib/pricing/depthBands/validator.d.ts +22 -0
  73. package/lib/pricing/depthBands/validator.js +113 -0
  74. package/lib/trade/effectiveLeverage/builder.d.ts +23 -0
  75. package/lib/trade/effectiveLeverage/builder.js +30 -0
  76. package/lib/trade/fees/borrowingV2/fetcher.d.ts +0 -1
  77. package/lib/trade/fees/holdingFees/index.d.ts +46 -0
  78. package/lib/trade/fees/holdingFees/index.js +105 -0
  79. package/lib/trade/fees/holdingFees/types.d.ts +23 -0
  80. package/lib/trade/fees/holdingFees/types.js +5 -0
  81. package/lib/trade/fees/trading/holdingFees.d.ts +28 -0
  82. package/lib/trade/fees/trading/holdingFees.js +66 -0
  83. package/lib/trade/fees/trading/holdingFeesStructured.d.ts +28 -0
  84. package/lib/trade/fees/trading/holdingFeesStructured.js +66 -0
  85. package/package.json +1 -1
@@ -0,0 +1,1485 @@
1
+ "use strict";
2
+ /* Autogenerated file. Do not edit manually. */
3
+ /* tslint:disable */
4
+ /* eslint-disable */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.GNSPairInfosV6_1__factory = void 0;
7
+ const ethers_1 = require("ethers");
8
+ const _abi = [
9
+ {
10
+ inputs: [
11
+ {
12
+ internalType: "contract StorageInterfaceV5",
13
+ name: "_storageT",
14
+ type: "address",
15
+ },
16
+ ],
17
+ stateMutability: "nonpayable",
18
+ type: "constructor",
19
+ },
20
+ {
21
+ anonymous: false,
22
+ inputs: [
23
+ {
24
+ indexed: false,
25
+ internalType: "uint256",
26
+ name: "pairIndex",
27
+ type: "uint256",
28
+ },
29
+ {
30
+ indexed: false,
31
+ internalType: "int256",
32
+ name: "valueLong",
33
+ type: "int256",
34
+ },
35
+ {
36
+ indexed: false,
37
+ internalType: "int256",
38
+ name: "valueShort",
39
+ type: "int256",
40
+ },
41
+ ],
42
+ name: "AccFundingFeesStored",
43
+ type: "event",
44
+ },
45
+ {
46
+ anonymous: false,
47
+ inputs: [
48
+ {
49
+ indexed: false,
50
+ internalType: "uint256",
51
+ name: "pairIndex",
52
+ type: "uint256",
53
+ },
54
+ {
55
+ indexed: false,
56
+ internalType: "uint256",
57
+ name: "value",
58
+ type: "uint256",
59
+ },
60
+ ],
61
+ name: "AccRolloverFeesStored",
62
+ type: "event",
63
+ },
64
+ {
65
+ anonymous: false,
66
+ inputs: [
67
+ {
68
+ indexed: false,
69
+ internalType: "uint256",
70
+ name: "pairIndex",
71
+ type: "uint256",
72
+ },
73
+ {
74
+ indexed: false,
75
+ internalType: "bool",
76
+ name: "long",
77
+ type: "bool",
78
+ },
79
+ {
80
+ indexed: false,
81
+ internalType: "uint256",
82
+ name: "collateral",
83
+ type: "uint256",
84
+ },
85
+ {
86
+ indexed: false,
87
+ internalType: "uint256",
88
+ name: "leverage",
89
+ type: "uint256",
90
+ },
91
+ {
92
+ indexed: false,
93
+ internalType: "int256",
94
+ name: "percentProfit",
95
+ type: "int256",
96
+ },
97
+ {
98
+ indexed: false,
99
+ internalType: "uint256",
100
+ name: "rolloverFees",
101
+ type: "uint256",
102
+ },
103
+ {
104
+ indexed: false,
105
+ internalType: "int256",
106
+ name: "fundingFees",
107
+ type: "int256",
108
+ },
109
+ ],
110
+ name: "FeesCharged",
111
+ type: "event",
112
+ },
113
+ {
114
+ anonymous: false,
115
+ inputs: [
116
+ {
117
+ indexed: false,
118
+ internalType: "uint256",
119
+ name: "pairIndex",
120
+ type: "uint256",
121
+ },
122
+ {
123
+ indexed: false,
124
+ internalType: "uint256",
125
+ name: "value",
126
+ type: "uint256",
127
+ },
128
+ ],
129
+ name: "FundingFeePerBlockPUpdated",
130
+ type: "event",
131
+ },
132
+ {
133
+ anonymous: false,
134
+ inputs: [
135
+ {
136
+ indexed: false,
137
+ internalType: "address",
138
+ name: "value",
139
+ type: "address",
140
+ },
141
+ ],
142
+ name: "ManagerUpdated",
143
+ type: "event",
144
+ },
145
+ {
146
+ anonymous: false,
147
+ inputs: [
148
+ {
149
+ indexed: false,
150
+ internalType: "uint256",
151
+ name: "value",
152
+ type: "uint256",
153
+ },
154
+ ],
155
+ name: "MaxNegativePnlOnOpenPUpdated",
156
+ type: "event",
157
+ },
158
+ {
159
+ anonymous: false,
160
+ inputs: [
161
+ {
162
+ indexed: false,
163
+ internalType: "uint256",
164
+ name: "pairIndex",
165
+ type: "uint256",
166
+ },
167
+ {
168
+ indexed: false,
169
+ internalType: "uint256",
170
+ name: "valueAbove",
171
+ type: "uint256",
172
+ },
173
+ {
174
+ indexed: false,
175
+ internalType: "uint256",
176
+ name: "valueBelow",
177
+ type: "uint256",
178
+ },
179
+ ],
180
+ name: "OnePercentDepthUpdated",
181
+ type: "event",
182
+ },
183
+ {
184
+ anonymous: false,
185
+ inputs: [
186
+ {
187
+ indexed: false,
188
+ internalType: "uint256",
189
+ name: "pairIndex",
190
+ type: "uint256",
191
+ },
192
+ {
193
+ components: [
194
+ {
195
+ internalType: "uint256",
196
+ name: "onePercentDepthAbove",
197
+ type: "uint256",
198
+ },
199
+ {
200
+ internalType: "uint256",
201
+ name: "onePercentDepthBelow",
202
+ type: "uint256",
203
+ },
204
+ {
205
+ internalType: "uint256",
206
+ name: "rolloverFeePerBlockP",
207
+ type: "uint256",
208
+ },
209
+ {
210
+ internalType: "uint256",
211
+ name: "fundingFeePerBlockP",
212
+ type: "uint256",
213
+ },
214
+ ],
215
+ indexed: false,
216
+ internalType: "struct GNSPairInfosV6_1.PairParams",
217
+ name: "value",
218
+ type: "tuple",
219
+ },
220
+ ],
221
+ name: "PairParamsUpdated",
222
+ type: "event",
223
+ },
224
+ {
225
+ anonymous: false,
226
+ inputs: [
227
+ {
228
+ indexed: false,
229
+ internalType: "uint256",
230
+ name: "pairIndex",
231
+ type: "uint256",
232
+ },
233
+ {
234
+ indexed: false,
235
+ internalType: "uint256",
236
+ name: "value",
237
+ type: "uint256",
238
+ },
239
+ ],
240
+ name: "RolloverFeePerBlockPUpdated",
241
+ type: "event",
242
+ },
243
+ {
244
+ anonymous: false,
245
+ inputs: [
246
+ {
247
+ indexed: false,
248
+ internalType: "address",
249
+ name: "trader",
250
+ type: "address",
251
+ },
252
+ {
253
+ indexed: false,
254
+ internalType: "uint256",
255
+ name: "pairIndex",
256
+ type: "uint256",
257
+ },
258
+ {
259
+ indexed: false,
260
+ internalType: "uint256",
261
+ name: "index",
262
+ type: "uint256",
263
+ },
264
+ {
265
+ indexed: false,
266
+ internalType: "uint256",
267
+ name: "rollover",
268
+ type: "uint256",
269
+ },
270
+ {
271
+ indexed: false,
272
+ internalType: "int256",
273
+ name: "funding",
274
+ type: "int256",
275
+ },
276
+ ],
277
+ name: "TradeInitialAccFeesStored",
278
+ type: "event",
279
+ },
280
+ {
281
+ inputs: [
282
+ {
283
+ internalType: "uint256",
284
+ name: "pairIndex",
285
+ type: "uint256",
286
+ },
287
+ ],
288
+ name: "getAccFundingFeesLong",
289
+ outputs: [
290
+ {
291
+ internalType: "int256",
292
+ name: "",
293
+ type: "int256",
294
+ },
295
+ ],
296
+ stateMutability: "view",
297
+ type: "function",
298
+ },
299
+ {
300
+ inputs: [
301
+ {
302
+ internalType: "uint256",
303
+ name: "pairIndex",
304
+ type: "uint256",
305
+ },
306
+ ],
307
+ name: "getAccFundingFeesShort",
308
+ outputs: [
309
+ {
310
+ internalType: "int256",
311
+ name: "",
312
+ type: "int256",
313
+ },
314
+ ],
315
+ stateMutability: "view",
316
+ type: "function",
317
+ },
318
+ {
319
+ inputs: [
320
+ {
321
+ internalType: "uint256",
322
+ name: "pairIndex",
323
+ type: "uint256",
324
+ },
325
+ ],
326
+ name: "getAccFundingFeesUpdateBlock",
327
+ outputs: [
328
+ {
329
+ internalType: "uint256",
330
+ name: "",
331
+ type: "uint256",
332
+ },
333
+ ],
334
+ stateMutability: "view",
335
+ type: "function",
336
+ },
337
+ {
338
+ inputs: [
339
+ {
340
+ internalType: "uint256",
341
+ name: "pairIndex",
342
+ type: "uint256",
343
+ },
344
+ ],
345
+ name: "getAccRolloverFees",
346
+ outputs: [
347
+ {
348
+ internalType: "uint256",
349
+ name: "",
350
+ type: "uint256",
351
+ },
352
+ ],
353
+ stateMutability: "view",
354
+ type: "function",
355
+ },
356
+ {
357
+ inputs: [
358
+ {
359
+ internalType: "uint256",
360
+ name: "pairIndex",
361
+ type: "uint256",
362
+ },
363
+ ],
364
+ name: "getAccRolloverFeesUpdateBlock",
365
+ outputs: [
366
+ {
367
+ internalType: "uint256",
368
+ name: "",
369
+ type: "uint256",
370
+ },
371
+ ],
372
+ stateMutability: "view",
373
+ type: "function",
374
+ },
375
+ {
376
+ inputs: [
377
+ {
378
+ internalType: "uint256",
379
+ name: "pairIndex",
380
+ type: "uint256",
381
+ },
382
+ ],
383
+ name: "getFundingFeePerBlockP",
384
+ outputs: [
385
+ {
386
+ internalType: "uint256",
387
+ name: "",
388
+ type: "uint256",
389
+ },
390
+ ],
391
+ stateMutability: "view",
392
+ type: "function",
393
+ },
394
+ {
395
+ inputs: [
396
+ {
397
+ internalType: "uint256",
398
+ name: "pairIndex",
399
+ type: "uint256",
400
+ },
401
+ ],
402
+ name: "getOnePercentDepthAbove",
403
+ outputs: [
404
+ {
405
+ internalType: "uint256",
406
+ name: "",
407
+ type: "uint256",
408
+ },
409
+ ],
410
+ stateMutability: "view",
411
+ type: "function",
412
+ },
413
+ {
414
+ inputs: [
415
+ {
416
+ internalType: "uint256",
417
+ name: "pairIndex",
418
+ type: "uint256",
419
+ },
420
+ ],
421
+ name: "getOnePercentDepthBelow",
422
+ outputs: [
423
+ {
424
+ internalType: "uint256",
425
+ name: "",
426
+ type: "uint256",
427
+ },
428
+ ],
429
+ stateMutability: "view",
430
+ type: "function",
431
+ },
432
+ {
433
+ inputs: [
434
+ {
435
+ internalType: "uint256[]",
436
+ name: "indices",
437
+ type: "uint256[]",
438
+ },
439
+ ],
440
+ name: "getPairInfos",
441
+ outputs: [
442
+ {
443
+ components: [
444
+ {
445
+ internalType: "uint256",
446
+ name: "onePercentDepthAbove",
447
+ type: "uint256",
448
+ },
449
+ {
450
+ internalType: "uint256",
451
+ name: "onePercentDepthBelow",
452
+ type: "uint256",
453
+ },
454
+ {
455
+ internalType: "uint256",
456
+ name: "rolloverFeePerBlockP",
457
+ type: "uint256",
458
+ },
459
+ {
460
+ internalType: "uint256",
461
+ name: "fundingFeePerBlockP",
462
+ type: "uint256",
463
+ },
464
+ ],
465
+ internalType: "struct GNSPairInfosV6_1.PairParams[]",
466
+ name: "",
467
+ type: "tuple[]",
468
+ },
469
+ {
470
+ components: [
471
+ {
472
+ internalType: "uint256",
473
+ name: "accPerCollateral",
474
+ type: "uint256",
475
+ },
476
+ {
477
+ internalType: "uint256",
478
+ name: "lastUpdateBlock",
479
+ type: "uint256",
480
+ },
481
+ ],
482
+ internalType: "struct GNSPairInfosV6_1.PairRolloverFees[]",
483
+ name: "",
484
+ type: "tuple[]",
485
+ },
486
+ {
487
+ components: [
488
+ {
489
+ internalType: "int256",
490
+ name: "accPerOiLong",
491
+ type: "int256",
492
+ },
493
+ {
494
+ internalType: "int256",
495
+ name: "accPerOiShort",
496
+ type: "int256",
497
+ },
498
+ {
499
+ internalType: "uint256",
500
+ name: "lastUpdateBlock",
501
+ type: "uint256",
502
+ },
503
+ ],
504
+ internalType: "struct GNSPairInfosV6_1.PairFundingFees[]",
505
+ name: "",
506
+ type: "tuple[]",
507
+ },
508
+ ],
509
+ stateMutability: "view",
510
+ type: "function",
511
+ },
512
+ {
513
+ inputs: [
514
+ {
515
+ internalType: "uint256",
516
+ name: "pairIndex",
517
+ type: "uint256",
518
+ },
519
+ ],
520
+ name: "getPendingAccFundingFees",
521
+ outputs: [
522
+ {
523
+ internalType: "int256",
524
+ name: "valueLong",
525
+ type: "int256",
526
+ },
527
+ {
528
+ internalType: "int256",
529
+ name: "valueShort",
530
+ type: "int256",
531
+ },
532
+ ],
533
+ stateMutability: "view",
534
+ type: "function",
535
+ },
536
+ {
537
+ inputs: [
538
+ {
539
+ internalType: "uint256",
540
+ name: "pairIndex",
541
+ type: "uint256",
542
+ },
543
+ ],
544
+ name: "getPendingAccRolloverFees",
545
+ outputs: [
546
+ {
547
+ internalType: "uint256",
548
+ name: "",
549
+ type: "uint256",
550
+ },
551
+ ],
552
+ stateMutability: "view",
553
+ type: "function",
554
+ },
555
+ {
556
+ inputs: [
557
+ {
558
+ internalType: "uint256",
559
+ name: "pairIndex",
560
+ type: "uint256",
561
+ },
562
+ ],
563
+ name: "getRolloverFeePerBlockP",
564
+ outputs: [
565
+ {
566
+ internalType: "uint256",
567
+ name: "",
568
+ type: "uint256",
569
+ },
570
+ ],
571
+ stateMutability: "view",
572
+ type: "function",
573
+ },
574
+ {
575
+ inputs: [
576
+ {
577
+ internalType: "address",
578
+ name: "trader",
579
+ type: "address",
580
+ },
581
+ {
582
+ internalType: "uint256",
583
+ name: "pairIndex",
584
+ type: "uint256",
585
+ },
586
+ {
587
+ internalType: "uint256",
588
+ name: "index",
589
+ type: "uint256",
590
+ },
591
+ {
592
+ internalType: "bool",
593
+ name: "long",
594
+ type: "bool",
595
+ },
596
+ {
597
+ internalType: "uint256",
598
+ name: "collateral",
599
+ type: "uint256",
600
+ },
601
+ {
602
+ internalType: "uint256",
603
+ name: "leverage",
604
+ type: "uint256",
605
+ },
606
+ ],
607
+ name: "getTradeFundingFee",
608
+ outputs: [
609
+ {
610
+ internalType: "int256",
611
+ name: "",
612
+ type: "int256",
613
+ },
614
+ ],
615
+ stateMutability: "view",
616
+ type: "function",
617
+ },
618
+ {
619
+ inputs: [
620
+ {
621
+ internalType: "int256",
622
+ name: "accFundingFeesPerOi",
623
+ type: "int256",
624
+ },
625
+ {
626
+ internalType: "int256",
627
+ name: "endAccFundingFeesPerOi",
628
+ type: "int256",
629
+ },
630
+ {
631
+ internalType: "uint256",
632
+ name: "collateral",
633
+ type: "uint256",
634
+ },
635
+ {
636
+ internalType: "uint256",
637
+ name: "leverage",
638
+ type: "uint256",
639
+ },
640
+ ],
641
+ name: "getTradeFundingFeePure",
642
+ outputs: [
643
+ {
644
+ internalType: "int256",
645
+ name: "",
646
+ type: "int256",
647
+ },
648
+ ],
649
+ stateMutability: "pure",
650
+ type: "function",
651
+ },
652
+ {
653
+ inputs: [
654
+ {
655
+ internalType: "address",
656
+ name: "trader",
657
+ type: "address",
658
+ },
659
+ {
660
+ internalType: "uint256",
661
+ name: "pairIndex",
662
+ type: "uint256",
663
+ },
664
+ {
665
+ internalType: "uint256",
666
+ name: "index",
667
+ type: "uint256",
668
+ },
669
+ ],
670
+ name: "getTradeInitialAccFundingFeesPerOi",
671
+ outputs: [
672
+ {
673
+ internalType: "int256",
674
+ name: "",
675
+ type: "int256",
676
+ },
677
+ ],
678
+ stateMutability: "view",
679
+ type: "function",
680
+ },
681
+ {
682
+ inputs: [
683
+ {
684
+ internalType: "address",
685
+ name: "trader",
686
+ type: "address",
687
+ },
688
+ {
689
+ internalType: "uint256",
690
+ name: "pairIndex",
691
+ type: "uint256",
692
+ },
693
+ {
694
+ internalType: "uint256",
695
+ name: "index",
696
+ type: "uint256",
697
+ },
698
+ ],
699
+ name: "getTradeInitialAccRolloverFeesPerCollateral",
700
+ outputs: [
701
+ {
702
+ internalType: "uint256",
703
+ name: "",
704
+ type: "uint256",
705
+ },
706
+ ],
707
+ stateMutability: "view",
708
+ type: "function",
709
+ },
710
+ {
711
+ inputs: [
712
+ {
713
+ internalType: "address",
714
+ name: "trader",
715
+ type: "address",
716
+ },
717
+ {
718
+ internalType: "uint256",
719
+ name: "pairIndex",
720
+ type: "uint256",
721
+ },
722
+ {
723
+ internalType: "uint256",
724
+ name: "index",
725
+ type: "uint256",
726
+ },
727
+ {
728
+ internalType: "uint256",
729
+ name: "openPrice",
730
+ type: "uint256",
731
+ },
732
+ {
733
+ internalType: "bool",
734
+ name: "long",
735
+ type: "bool",
736
+ },
737
+ {
738
+ internalType: "uint256",
739
+ name: "collateral",
740
+ type: "uint256",
741
+ },
742
+ {
743
+ internalType: "uint256",
744
+ name: "leverage",
745
+ type: "uint256",
746
+ },
747
+ ],
748
+ name: "getTradeLiquidationPrice",
749
+ outputs: [
750
+ {
751
+ internalType: "uint256",
752
+ name: "",
753
+ type: "uint256",
754
+ },
755
+ ],
756
+ stateMutability: "view",
757
+ type: "function",
758
+ },
759
+ {
760
+ inputs: [
761
+ {
762
+ internalType: "uint256",
763
+ name: "openPrice",
764
+ type: "uint256",
765
+ },
766
+ {
767
+ internalType: "bool",
768
+ name: "long",
769
+ type: "bool",
770
+ },
771
+ {
772
+ internalType: "uint256",
773
+ name: "collateral",
774
+ type: "uint256",
775
+ },
776
+ {
777
+ internalType: "uint256",
778
+ name: "leverage",
779
+ type: "uint256",
780
+ },
781
+ {
782
+ internalType: "uint256",
783
+ name: "rolloverFee",
784
+ type: "uint256",
785
+ },
786
+ {
787
+ internalType: "int256",
788
+ name: "fundingFee",
789
+ type: "int256",
790
+ },
791
+ ],
792
+ name: "getTradeLiquidationPricePure",
793
+ outputs: [
794
+ {
795
+ internalType: "uint256",
796
+ name: "",
797
+ type: "uint256",
798
+ },
799
+ ],
800
+ stateMutability: "pure",
801
+ type: "function",
802
+ },
803
+ {
804
+ inputs: [
805
+ {
806
+ internalType: "address",
807
+ name: "trader",
808
+ type: "address",
809
+ },
810
+ {
811
+ internalType: "uint256",
812
+ name: "pairIndex",
813
+ type: "uint256",
814
+ },
815
+ {
816
+ internalType: "uint256",
817
+ name: "index",
818
+ type: "uint256",
819
+ },
820
+ ],
821
+ name: "getTradeOpenedAfterUpdate",
822
+ outputs: [
823
+ {
824
+ internalType: "bool",
825
+ name: "",
826
+ type: "bool",
827
+ },
828
+ ],
829
+ stateMutability: "view",
830
+ type: "function",
831
+ },
832
+ {
833
+ inputs: [
834
+ {
835
+ internalType: "uint256",
836
+ name: "openPrice",
837
+ type: "uint256",
838
+ },
839
+ {
840
+ internalType: "uint256",
841
+ name: "pairIndex",
842
+ type: "uint256",
843
+ },
844
+ {
845
+ internalType: "bool",
846
+ name: "long",
847
+ type: "bool",
848
+ },
849
+ {
850
+ internalType: "uint256",
851
+ name: "tradeOpenInterest",
852
+ type: "uint256",
853
+ },
854
+ ],
855
+ name: "getTradePriceImpact",
856
+ outputs: [
857
+ {
858
+ internalType: "uint256",
859
+ name: "priceImpactP",
860
+ type: "uint256",
861
+ },
862
+ {
863
+ internalType: "uint256",
864
+ name: "priceAfterImpact",
865
+ type: "uint256",
866
+ },
867
+ ],
868
+ stateMutability: "view",
869
+ type: "function",
870
+ },
871
+ {
872
+ inputs: [
873
+ {
874
+ internalType: "uint256",
875
+ name: "openPrice",
876
+ type: "uint256",
877
+ },
878
+ {
879
+ internalType: "bool",
880
+ name: "long",
881
+ type: "bool",
882
+ },
883
+ {
884
+ internalType: "uint256",
885
+ name: "startOpenInterest",
886
+ type: "uint256",
887
+ },
888
+ {
889
+ internalType: "uint256",
890
+ name: "tradeOpenInterest",
891
+ type: "uint256",
892
+ },
893
+ {
894
+ internalType: "uint256",
895
+ name: "onePercentDepth",
896
+ type: "uint256",
897
+ },
898
+ ],
899
+ name: "getTradePriceImpactPure",
900
+ outputs: [
901
+ {
902
+ internalType: "uint256",
903
+ name: "priceImpactP",
904
+ type: "uint256",
905
+ },
906
+ {
907
+ internalType: "uint256",
908
+ name: "priceAfterImpact",
909
+ type: "uint256",
910
+ },
911
+ ],
912
+ stateMutability: "pure",
913
+ type: "function",
914
+ },
915
+ {
916
+ inputs: [
917
+ {
918
+ internalType: "address",
919
+ name: "trader",
920
+ type: "address",
921
+ },
922
+ {
923
+ internalType: "uint256",
924
+ name: "pairIndex",
925
+ type: "uint256",
926
+ },
927
+ {
928
+ internalType: "uint256",
929
+ name: "index",
930
+ type: "uint256",
931
+ },
932
+ {
933
+ internalType: "uint256",
934
+ name: "collateral",
935
+ type: "uint256",
936
+ },
937
+ ],
938
+ name: "getTradeRolloverFee",
939
+ outputs: [
940
+ {
941
+ internalType: "uint256",
942
+ name: "",
943
+ type: "uint256",
944
+ },
945
+ ],
946
+ stateMutability: "view",
947
+ type: "function",
948
+ },
949
+ {
950
+ inputs: [
951
+ {
952
+ internalType: "uint256",
953
+ name: "accRolloverFeesPerCollateral",
954
+ type: "uint256",
955
+ },
956
+ {
957
+ internalType: "uint256",
958
+ name: "endAccRolloverFeesPerCollateral",
959
+ type: "uint256",
960
+ },
961
+ {
962
+ internalType: "uint256",
963
+ name: "collateral",
964
+ type: "uint256",
965
+ },
966
+ ],
967
+ name: "getTradeRolloverFeePure",
968
+ outputs: [
969
+ {
970
+ internalType: "uint256",
971
+ name: "",
972
+ type: "uint256",
973
+ },
974
+ ],
975
+ stateMutability: "pure",
976
+ type: "function",
977
+ },
978
+ {
979
+ inputs: [
980
+ {
981
+ internalType: "address",
982
+ name: "trader",
983
+ type: "address",
984
+ },
985
+ {
986
+ internalType: "uint256",
987
+ name: "pairIndex",
988
+ type: "uint256",
989
+ },
990
+ {
991
+ internalType: "uint256",
992
+ name: "index",
993
+ type: "uint256",
994
+ },
995
+ {
996
+ internalType: "bool",
997
+ name: "long",
998
+ type: "bool",
999
+ },
1000
+ {
1001
+ internalType: "uint256",
1002
+ name: "collateral",
1003
+ type: "uint256",
1004
+ },
1005
+ {
1006
+ internalType: "uint256",
1007
+ name: "leverage",
1008
+ type: "uint256",
1009
+ },
1010
+ {
1011
+ internalType: "int256",
1012
+ name: "percentProfit",
1013
+ type: "int256",
1014
+ },
1015
+ {
1016
+ internalType: "uint256",
1017
+ name: "closingFee",
1018
+ type: "uint256",
1019
+ },
1020
+ ],
1021
+ name: "getTradeValue",
1022
+ outputs: [
1023
+ {
1024
+ internalType: "uint256",
1025
+ name: "amount",
1026
+ type: "uint256",
1027
+ },
1028
+ ],
1029
+ stateMutability: "nonpayable",
1030
+ type: "function",
1031
+ },
1032
+ {
1033
+ inputs: [
1034
+ {
1035
+ internalType: "uint256",
1036
+ name: "collateral",
1037
+ type: "uint256",
1038
+ },
1039
+ {
1040
+ internalType: "int256",
1041
+ name: "percentProfit",
1042
+ type: "int256",
1043
+ },
1044
+ {
1045
+ internalType: "uint256",
1046
+ name: "rolloverFee",
1047
+ type: "uint256",
1048
+ },
1049
+ {
1050
+ internalType: "int256",
1051
+ name: "fundingFee",
1052
+ type: "int256",
1053
+ },
1054
+ {
1055
+ internalType: "uint256",
1056
+ name: "closingFee",
1057
+ type: "uint256",
1058
+ },
1059
+ ],
1060
+ name: "getTradeValuePure",
1061
+ outputs: [
1062
+ {
1063
+ internalType: "uint256",
1064
+ name: "",
1065
+ type: "uint256",
1066
+ },
1067
+ ],
1068
+ stateMutability: "pure",
1069
+ type: "function",
1070
+ },
1071
+ {
1072
+ inputs: [],
1073
+ name: "manager",
1074
+ outputs: [
1075
+ {
1076
+ internalType: "address",
1077
+ name: "",
1078
+ type: "address",
1079
+ },
1080
+ ],
1081
+ stateMutability: "view",
1082
+ type: "function",
1083
+ },
1084
+ {
1085
+ inputs: [],
1086
+ name: "maxNegativePnlOnOpenP",
1087
+ outputs: [
1088
+ {
1089
+ internalType: "uint256",
1090
+ name: "",
1091
+ type: "uint256",
1092
+ },
1093
+ ],
1094
+ stateMutability: "view",
1095
+ type: "function",
1096
+ },
1097
+ {
1098
+ inputs: [
1099
+ {
1100
+ internalType: "uint256",
1101
+ name: "",
1102
+ type: "uint256",
1103
+ },
1104
+ ],
1105
+ name: "pairFundingFees",
1106
+ outputs: [
1107
+ {
1108
+ internalType: "int256",
1109
+ name: "accPerOiLong",
1110
+ type: "int256",
1111
+ },
1112
+ {
1113
+ internalType: "int256",
1114
+ name: "accPerOiShort",
1115
+ type: "int256",
1116
+ },
1117
+ {
1118
+ internalType: "uint256",
1119
+ name: "lastUpdateBlock",
1120
+ type: "uint256",
1121
+ },
1122
+ ],
1123
+ stateMutability: "view",
1124
+ type: "function",
1125
+ },
1126
+ {
1127
+ inputs: [
1128
+ {
1129
+ internalType: "uint256",
1130
+ name: "",
1131
+ type: "uint256",
1132
+ },
1133
+ ],
1134
+ name: "pairParams",
1135
+ outputs: [
1136
+ {
1137
+ internalType: "uint256",
1138
+ name: "onePercentDepthAbove",
1139
+ type: "uint256",
1140
+ },
1141
+ {
1142
+ internalType: "uint256",
1143
+ name: "onePercentDepthBelow",
1144
+ type: "uint256",
1145
+ },
1146
+ {
1147
+ internalType: "uint256",
1148
+ name: "rolloverFeePerBlockP",
1149
+ type: "uint256",
1150
+ },
1151
+ {
1152
+ internalType: "uint256",
1153
+ name: "fundingFeePerBlockP",
1154
+ type: "uint256",
1155
+ },
1156
+ ],
1157
+ stateMutability: "view",
1158
+ type: "function",
1159
+ },
1160
+ {
1161
+ inputs: [
1162
+ {
1163
+ internalType: "uint256",
1164
+ name: "",
1165
+ type: "uint256",
1166
+ },
1167
+ ],
1168
+ name: "pairRolloverFees",
1169
+ outputs: [
1170
+ {
1171
+ internalType: "uint256",
1172
+ name: "accPerCollateral",
1173
+ type: "uint256",
1174
+ },
1175
+ {
1176
+ internalType: "uint256",
1177
+ name: "lastUpdateBlock",
1178
+ type: "uint256",
1179
+ },
1180
+ ],
1181
+ stateMutability: "view",
1182
+ type: "function",
1183
+ },
1184
+ {
1185
+ inputs: [
1186
+ {
1187
+ internalType: "uint256",
1188
+ name: "pairIndex",
1189
+ type: "uint256",
1190
+ },
1191
+ {
1192
+ internalType: "uint256",
1193
+ name: "value",
1194
+ type: "uint256",
1195
+ },
1196
+ ],
1197
+ name: "setFundingFeePerBlockP",
1198
+ outputs: [],
1199
+ stateMutability: "nonpayable",
1200
+ type: "function",
1201
+ },
1202
+ {
1203
+ inputs: [
1204
+ {
1205
+ internalType: "uint256[]",
1206
+ name: "indices",
1207
+ type: "uint256[]",
1208
+ },
1209
+ {
1210
+ internalType: "uint256[]",
1211
+ name: "values",
1212
+ type: "uint256[]",
1213
+ },
1214
+ ],
1215
+ name: "setFundingFeePerBlockPArray",
1216
+ outputs: [],
1217
+ stateMutability: "nonpayable",
1218
+ type: "function",
1219
+ },
1220
+ {
1221
+ inputs: [
1222
+ {
1223
+ internalType: "address",
1224
+ name: "_manager",
1225
+ type: "address",
1226
+ },
1227
+ ],
1228
+ name: "setManager",
1229
+ outputs: [],
1230
+ stateMutability: "nonpayable",
1231
+ type: "function",
1232
+ },
1233
+ {
1234
+ inputs: [
1235
+ {
1236
+ internalType: "uint256",
1237
+ name: "value",
1238
+ type: "uint256",
1239
+ },
1240
+ ],
1241
+ name: "setMaxNegativePnlOnOpenP",
1242
+ outputs: [],
1243
+ stateMutability: "nonpayable",
1244
+ type: "function",
1245
+ },
1246
+ {
1247
+ inputs: [
1248
+ {
1249
+ internalType: "uint256",
1250
+ name: "pairIndex",
1251
+ type: "uint256",
1252
+ },
1253
+ {
1254
+ internalType: "uint256",
1255
+ name: "valueAbove",
1256
+ type: "uint256",
1257
+ },
1258
+ {
1259
+ internalType: "uint256",
1260
+ name: "valueBelow",
1261
+ type: "uint256",
1262
+ },
1263
+ ],
1264
+ name: "setOnePercentDepth",
1265
+ outputs: [],
1266
+ stateMutability: "nonpayable",
1267
+ type: "function",
1268
+ },
1269
+ {
1270
+ inputs: [
1271
+ {
1272
+ internalType: "uint256[]",
1273
+ name: "indices",
1274
+ type: "uint256[]",
1275
+ },
1276
+ {
1277
+ internalType: "uint256[]",
1278
+ name: "valuesAbove",
1279
+ type: "uint256[]",
1280
+ },
1281
+ {
1282
+ internalType: "uint256[]",
1283
+ name: "valuesBelow",
1284
+ type: "uint256[]",
1285
+ },
1286
+ ],
1287
+ name: "setOnePercentDepthArray",
1288
+ outputs: [],
1289
+ stateMutability: "nonpayable",
1290
+ type: "function",
1291
+ },
1292
+ {
1293
+ inputs: [
1294
+ {
1295
+ internalType: "uint256",
1296
+ name: "pairIndex",
1297
+ type: "uint256",
1298
+ },
1299
+ {
1300
+ components: [
1301
+ {
1302
+ internalType: "uint256",
1303
+ name: "onePercentDepthAbove",
1304
+ type: "uint256",
1305
+ },
1306
+ {
1307
+ internalType: "uint256",
1308
+ name: "onePercentDepthBelow",
1309
+ type: "uint256",
1310
+ },
1311
+ {
1312
+ internalType: "uint256",
1313
+ name: "rolloverFeePerBlockP",
1314
+ type: "uint256",
1315
+ },
1316
+ {
1317
+ internalType: "uint256",
1318
+ name: "fundingFeePerBlockP",
1319
+ type: "uint256",
1320
+ },
1321
+ ],
1322
+ internalType: "struct GNSPairInfosV6_1.PairParams",
1323
+ name: "value",
1324
+ type: "tuple",
1325
+ },
1326
+ ],
1327
+ name: "setPairParams",
1328
+ outputs: [],
1329
+ stateMutability: "nonpayable",
1330
+ type: "function",
1331
+ },
1332
+ {
1333
+ inputs: [
1334
+ {
1335
+ internalType: "uint256[]",
1336
+ name: "indices",
1337
+ type: "uint256[]",
1338
+ },
1339
+ {
1340
+ components: [
1341
+ {
1342
+ internalType: "uint256",
1343
+ name: "onePercentDepthAbove",
1344
+ type: "uint256",
1345
+ },
1346
+ {
1347
+ internalType: "uint256",
1348
+ name: "onePercentDepthBelow",
1349
+ type: "uint256",
1350
+ },
1351
+ {
1352
+ internalType: "uint256",
1353
+ name: "rolloverFeePerBlockP",
1354
+ type: "uint256",
1355
+ },
1356
+ {
1357
+ internalType: "uint256",
1358
+ name: "fundingFeePerBlockP",
1359
+ type: "uint256",
1360
+ },
1361
+ ],
1362
+ internalType: "struct GNSPairInfosV6_1.PairParams[]",
1363
+ name: "values",
1364
+ type: "tuple[]",
1365
+ },
1366
+ ],
1367
+ name: "setPairParamsArray",
1368
+ outputs: [],
1369
+ stateMutability: "nonpayable",
1370
+ type: "function",
1371
+ },
1372
+ {
1373
+ inputs: [
1374
+ {
1375
+ internalType: "uint256",
1376
+ name: "pairIndex",
1377
+ type: "uint256",
1378
+ },
1379
+ {
1380
+ internalType: "uint256",
1381
+ name: "value",
1382
+ type: "uint256",
1383
+ },
1384
+ ],
1385
+ name: "setRolloverFeePerBlockP",
1386
+ outputs: [],
1387
+ stateMutability: "nonpayable",
1388
+ type: "function",
1389
+ },
1390
+ {
1391
+ inputs: [
1392
+ {
1393
+ internalType: "uint256[]",
1394
+ name: "indices",
1395
+ type: "uint256[]",
1396
+ },
1397
+ {
1398
+ internalType: "uint256[]",
1399
+ name: "values",
1400
+ type: "uint256[]",
1401
+ },
1402
+ ],
1403
+ name: "setRolloverFeePerBlockPArray",
1404
+ outputs: [],
1405
+ stateMutability: "nonpayable",
1406
+ type: "function",
1407
+ },
1408
+ {
1409
+ inputs: [
1410
+ {
1411
+ internalType: "address",
1412
+ name: "trader",
1413
+ type: "address",
1414
+ },
1415
+ {
1416
+ internalType: "uint256",
1417
+ name: "pairIndex",
1418
+ type: "uint256",
1419
+ },
1420
+ {
1421
+ internalType: "uint256",
1422
+ name: "index",
1423
+ type: "uint256",
1424
+ },
1425
+ {
1426
+ internalType: "bool",
1427
+ name: "long",
1428
+ type: "bool",
1429
+ },
1430
+ ],
1431
+ name: "storeTradeInitialAccFees",
1432
+ outputs: [],
1433
+ stateMutability: "nonpayable",
1434
+ type: "function",
1435
+ },
1436
+ {
1437
+ inputs: [
1438
+ {
1439
+ internalType: "address",
1440
+ name: "",
1441
+ type: "address",
1442
+ },
1443
+ {
1444
+ internalType: "uint256",
1445
+ name: "",
1446
+ type: "uint256",
1447
+ },
1448
+ {
1449
+ internalType: "uint256",
1450
+ name: "",
1451
+ type: "uint256",
1452
+ },
1453
+ ],
1454
+ name: "tradeInitialAccFees",
1455
+ outputs: [
1456
+ {
1457
+ internalType: "uint256",
1458
+ name: "rollover",
1459
+ type: "uint256",
1460
+ },
1461
+ {
1462
+ internalType: "int256",
1463
+ name: "funding",
1464
+ type: "int256",
1465
+ },
1466
+ {
1467
+ internalType: "bool",
1468
+ name: "openedAfterUpdate",
1469
+ type: "bool",
1470
+ },
1471
+ ],
1472
+ stateMutability: "view",
1473
+ type: "function",
1474
+ },
1475
+ ];
1476
+ class GNSPairInfosV6_1__factory {
1477
+ static createInterface() {
1478
+ return new ethers_1.utils.Interface(_abi);
1479
+ }
1480
+ static connect(address, signerOrProvider) {
1481
+ return new ethers_1.Contract(address, _abi, signerOrProvider);
1482
+ }
1483
+ }
1484
+ exports.GNSPairInfosV6_1__factory = GNSPairInfosV6_1__factory;
1485
+ GNSPairInfosV6_1__factory.abi = _abi;