@gainsnetwork/sdk 0.2.35-rc1 → 0.2.36

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 (39) hide show
  1. package/lib/constants.d.ts +0 -8
  2. package/lib/constants.js +1 -9
  3. package/lib/contracts/types/generated/GFarmTradingStorageV5.d.ts +1911 -0
  4. package/lib/contracts/types/generated/GFarmTradingStorageV5.js +2 -0
  5. package/lib/contracts/types/generated/GNSBorrowingFees.d.ts +1067 -0
  6. package/lib/contracts/types/generated/GNSBorrowingFees.js +2 -0
  7. package/lib/contracts/types/generated/GNSMultiCollatDiamond.d.ts +673 -312
  8. package/lib/contracts/types/generated/GNSNftRewardsV6.d.ts +533 -0
  9. package/lib/contracts/types/generated/GNSNftRewardsV6.js +2 -0
  10. package/lib/contracts/types/generated/GNSNftRewardsV6_3_1.d.ts +613 -0
  11. package/lib/contracts/types/generated/GNSNftRewardsV6_3_1.js +2 -0
  12. package/lib/contracts/types/generated/GNSTrading.d.ts +758 -0
  13. package/lib/contracts/types/generated/GNSTrading.js +2 -0
  14. package/lib/contracts/types/generated/GNSTradingCallbacks.d.ts +875 -0
  15. package/lib/contracts/types/generated/GNSTradingCallbacks.js +2 -0
  16. package/lib/contracts/types/generated/GNSTradingStorage.d.ts +1387 -0
  17. package/lib/contracts/types/generated/GNSTradingStorage.js +2 -0
  18. package/lib/contracts/types/generated/factories/GFarmTradingStorageV5__factory.d.ts +83 -0
  19. package/lib/contracts/types/generated/factories/GFarmTradingStorageV5__factory.js +2691 -0
  20. package/lib/contracts/types/generated/factories/GNSBorrowingFees__factory.d.ts +124 -0
  21. package/lib/contracts/types/generated/factories/GNSBorrowingFees__factory.js +1784 -0
  22. package/lib/contracts/types/generated/factories/GNSMultiCollatDiamond__factory.js +1437 -532
  23. package/lib/contracts/types/generated/factories/GNSNftRewardsV6_3_1__factory.d.ts +100 -0
  24. package/lib/contracts/types/generated/factories/GNSNftRewardsV6_3_1__factory.js +1116 -0
  25. package/lib/contracts/types/generated/factories/GNSNftRewardsV6__factory.d.ts +100 -0
  26. package/lib/contracts/types/generated/factories/GNSNftRewardsV6__factory.js +1003 -0
  27. package/lib/contracts/types/generated/factories/GNSTradingCallbacks__factory.d.ts +113 -0
  28. package/lib/contracts/types/generated/factories/GNSTradingCallbacks__factory.js +1428 -0
  29. package/lib/contracts/types/generated/factories/GNSTradingStorage__factory.d.ts +96 -0
  30. package/lib/contracts/types/generated/factories/GNSTradingStorage__factory.js +2241 -0
  31. package/lib/contracts/types/generated/factories/GNSTrading__factory.d.ts +95 -0
  32. package/lib/contracts/types/generated/factories/GNSTrading__factory.js +1071 -0
  33. package/lib/contracts/utils/pairs.js +4 -12
  34. package/lib/trade/fees/index.js +2 -2
  35. package/lib/trade/spread.d.ts +4 -5
  36. package/lib/trade/spread.js +32 -15
  37. package/lib/trade/types.d.ts +13 -11
  38. package/lib/trade/types.js +0 -8
  39. package/package.json +1 -1
@@ -112,6 +112,11 @@ const _abi = [
112
112
  name: "Paused",
113
113
  type: "error",
114
114
  },
115
+ {
116
+ inputs: [],
117
+ name: "UnsupportedChain",
118
+ type: "error",
119
+ },
115
120
  {
116
121
  inputs: [],
117
122
  name: "WrongAccess",
@@ -198,6 +203,11 @@ const _abi = [
198
203
  name: "gnsStaking",
199
204
  type: "address",
200
205
  },
206
+ {
207
+ internalType: "address",
208
+ name: "treasury",
209
+ type: "address",
210
+ },
201
211
  ],
202
212
  indexed: false,
203
213
  internalType: "struct IAddressStore.Addresses",
@@ -207,7 +217,7 @@ const _abi = [
207
217
  ],
208
218
  name: "AddressesUpdated",
209
219
  type: "event",
210
- signature: "0xe4f1f9461410dada4f4b49a4b363bdf35e6069fb5a0cea4b1147c32affbd954a",
220
+ signature: "0x7b2fde61973b60e9083bea5f934d31d97c530deecb02e158dfa0280c8bc3f71a",
211
221
  },
212
222
  {
213
223
  anonymous: false,
@@ -403,6 +413,11 @@ const _abi = [
403
413
  name: "gnsStaking",
404
414
  type: "address",
405
415
  },
416
+ {
417
+ internalType: "address",
418
+ name: "treasury",
419
+ type: "address",
420
+ },
406
421
  ],
407
422
  internalType: "struct IAddressStore.Addresses",
408
423
  name: "",
@@ -442,7 +457,37 @@ const _abi = [
442
457
  inputs: [
443
458
  {
444
459
  internalType: "address",
445
- name: "_rolesManager",
460
+ name: "_account",
461
+ type: "address",
462
+ },
463
+ {
464
+ internalType: "enum IAddressStore.Role",
465
+ name: "_roleA",
466
+ type: "uint8",
467
+ },
468
+ {
469
+ internalType: "enum IAddressStore.Role",
470
+ name: "_roleB",
471
+ type: "uint8",
472
+ },
473
+ ],
474
+ name: "hasRoles",
475
+ outputs: [
476
+ {
477
+ internalType: "bool",
478
+ name: "",
479
+ type: "bool",
480
+ },
481
+ ],
482
+ stateMutability: "view",
483
+ type: "function",
484
+ signature: "0xb9c97229",
485
+ },
486
+ {
487
+ inputs: [
488
+ {
489
+ internalType: "address",
490
+ name: "_govTimelock",
446
491
  type: "address",
447
492
  },
448
493
  ],
@@ -551,15 +596,42 @@ const _abi = [
551
596
  type: "uint256",
552
597
  },
553
598
  {
599
+ components: [
600
+ {
601
+ internalType: "uint40",
602
+ name: "totalPositionSizeFeeP",
603
+ type: "uint40",
604
+ },
605
+ {
606
+ internalType: "uint40",
607
+ name: "totalLiqCollateralFeeP",
608
+ type: "uint40",
609
+ },
610
+ {
611
+ internalType: "uint40",
612
+ name: "oraclePositionSizeFeeP",
613
+ type: "uint40",
614
+ },
615
+ {
616
+ internalType: "uint32",
617
+ name: "minPositionSizeUsd",
618
+ type: "uint32",
619
+ },
620
+ {
621
+ internalType: "uint104",
622
+ name: "__placeholder",
623
+ type: "uint104",
624
+ },
625
+ ],
554
626
  indexed: false,
555
- internalType: "string",
556
- name: "name",
557
- type: "string",
627
+ internalType: "struct IPairsStorage.FeeGroup",
628
+ name: "feeGroup",
629
+ type: "tuple",
558
630
  },
559
631
  ],
560
632
  name: "FeeAdded",
561
633
  type: "event",
562
- signature: "0x482049823c85e038e099fe4f2b901487c4800def71c9a3f5bae2de8381ec54f6",
634
+ signature: "0x13b1e39f208d3f600b2dfd43c294bc9fb9518d7b57f027fdb0572d8a84cee278",
563
635
  },
564
636
  {
565
637
  anonymous: false,
@@ -570,10 +642,89 @@ const _abi = [
570
642
  name: "index",
571
643
  type: "uint256",
572
644
  },
645
+ {
646
+ components: [
647
+ {
648
+ internalType: "uint40",
649
+ name: "totalPositionSizeFeeP",
650
+ type: "uint40",
651
+ },
652
+ {
653
+ internalType: "uint40",
654
+ name: "totalLiqCollateralFeeP",
655
+ type: "uint40",
656
+ },
657
+ {
658
+ internalType: "uint40",
659
+ name: "oraclePositionSizeFeeP",
660
+ type: "uint40",
661
+ },
662
+ {
663
+ internalType: "uint32",
664
+ name: "minPositionSizeUsd",
665
+ type: "uint32",
666
+ },
667
+ {
668
+ internalType: "uint104",
669
+ name: "__placeholder",
670
+ type: "uint104",
671
+ },
672
+ ],
673
+ indexed: false,
674
+ internalType: "struct IPairsStorage.FeeGroup",
675
+ name: "feeGroup",
676
+ type: "tuple",
677
+ },
573
678
  ],
574
679
  name: "FeeUpdated",
575
680
  type: "event",
576
- signature: "0x8c4d35e54a3f2ef1134138fd8ea3daee6a3c89e10d2665996babdf70261e2c76",
681
+ signature: "0xb38258bbe4602eb8456888a284ddf8f9f9acc06f4699fce677ddd34941ed35cb",
682
+ },
683
+ {
684
+ anonymous: false,
685
+ inputs: [
686
+ {
687
+ components: [
688
+ {
689
+ internalType: "uint24",
690
+ name: "referralFeeP",
691
+ type: "uint24",
692
+ },
693
+ {
694
+ internalType: "uint24",
695
+ name: "govFeeP",
696
+ type: "uint24",
697
+ },
698
+ {
699
+ internalType: "uint24",
700
+ name: "triggerOrderFeeP",
701
+ type: "uint24",
702
+ },
703
+ {
704
+ internalType: "uint24",
705
+ name: "gnsOtcFeeP",
706
+ type: "uint24",
707
+ },
708
+ {
709
+ internalType: "uint24",
710
+ name: "gTokenFeeP",
711
+ type: "uint24",
712
+ },
713
+ {
714
+ internalType: "uint136",
715
+ name: "__placeholder",
716
+ type: "uint136",
717
+ },
718
+ ],
719
+ indexed: false,
720
+ internalType: "struct IPairsStorage.GlobalTradeFeeParams",
721
+ name: "feeParams",
722
+ type: "tuple",
723
+ },
724
+ ],
725
+ name: "GlobalTradeFeeParamsUpdated",
726
+ type: "event",
727
+ signature: "0xbbd4d37e525bc0d0bf80d0c56879b81ebcccbe7bfd22e484e19eb0f369c011a4",
577
728
  },
578
729
  {
579
730
  anonymous: false,
@@ -721,37 +872,32 @@ const _abi = [
721
872
  {
722
873
  components: [
723
874
  {
724
- internalType: "string",
725
- name: "name",
726
- type: "string",
727
- },
728
- {
729
- internalType: "uint256",
730
- name: "openFeeP",
731
- type: "uint256",
875
+ internalType: "uint40",
876
+ name: "totalPositionSizeFeeP",
877
+ type: "uint40",
732
878
  },
733
879
  {
734
- internalType: "uint256",
735
- name: "closeFeeP",
736
- type: "uint256",
880
+ internalType: "uint40",
881
+ name: "totalLiqCollateralFeeP",
882
+ type: "uint40",
737
883
  },
738
884
  {
739
- internalType: "uint256",
740
- name: "oracleFeeP",
741
- type: "uint256",
885
+ internalType: "uint40",
886
+ name: "oraclePositionSizeFeeP",
887
+ type: "uint40",
742
888
  },
743
889
  {
744
- internalType: "uint256",
745
- name: "triggerOrderFeeP",
746
- type: "uint256",
890
+ internalType: "uint32",
891
+ name: "minPositionSizeUsd",
892
+ type: "uint32",
747
893
  },
748
894
  {
749
- internalType: "uint256",
750
- name: "minPositionSizeUsd",
751
- type: "uint256",
895
+ internalType: "uint104",
896
+ name: "__placeholder",
897
+ type: "uint104",
752
898
  },
753
899
  ],
754
- internalType: "struct IPairsStorage.Fee[]",
900
+ internalType: "struct IPairsStorage.FeeGroup[]",
755
901
  name: "_fees",
756
902
  type: "tuple[]",
757
903
  },
@@ -760,7 +906,7 @@ const _abi = [
760
906
  outputs: [],
761
907
  stateMutability: "nonpayable",
762
908
  type: "function",
763
- signature: "0x0c00b94a",
909
+ signature: "0x0e5c75af",
764
910
  },
765
911
  {
766
912
  inputs: [
@@ -879,37 +1025,32 @@ const _abi = [
879
1025
  {
880
1026
  components: [
881
1027
  {
882
- internalType: "string",
883
- name: "name",
884
- type: "string",
885
- },
886
- {
887
- internalType: "uint256",
888
- name: "openFeeP",
889
- type: "uint256",
1028
+ internalType: "uint40",
1029
+ name: "totalPositionSizeFeeP",
1030
+ type: "uint40",
890
1031
  },
891
1032
  {
892
- internalType: "uint256",
893
- name: "closeFeeP",
894
- type: "uint256",
1033
+ internalType: "uint40",
1034
+ name: "totalLiqCollateralFeeP",
1035
+ type: "uint40",
895
1036
  },
896
1037
  {
897
- internalType: "uint256",
898
- name: "oracleFeeP",
899
- type: "uint256",
1038
+ internalType: "uint40",
1039
+ name: "oraclePositionSizeFeeP",
1040
+ type: "uint40",
900
1041
  },
901
1042
  {
902
- internalType: "uint256",
903
- name: "triggerOrderFeeP",
904
- type: "uint256",
1043
+ internalType: "uint32",
1044
+ name: "minPositionSizeUsd",
1045
+ type: "uint32",
905
1046
  },
906
1047
  {
907
- internalType: "uint256",
908
- name: "minPositionSizeUsd",
909
- type: "uint256",
1048
+ internalType: "uint104",
1049
+ name: "__placeholder",
1050
+ type: "uint104",
910
1051
  },
911
1052
  ],
912
- internalType: "struct IPairsStorage.Fee",
1053
+ internalType: "struct IPairsStorage.FeeGroup",
913
1054
  name: "",
914
1055
  type: "tuple",
915
1056
  },
@@ -946,6 +1087,52 @@ const _abi = [
946
1087
  type: "function",
947
1088
  signature: "0x678b3fb0",
948
1089
  },
1090
+ {
1091
+ inputs: [],
1092
+ name: "getGlobalTradeFeeParams",
1093
+ outputs: [
1094
+ {
1095
+ components: [
1096
+ {
1097
+ internalType: "uint24",
1098
+ name: "referralFeeP",
1099
+ type: "uint24",
1100
+ },
1101
+ {
1102
+ internalType: "uint24",
1103
+ name: "govFeeP",
1104
+ type: "uint24",
1105
+ },
1106
+ {
1107
+ internalType: "uint24",
1108
+ name: "triggerOrderFeeP",
1109
+ type: "uint24",
1110
+ },
1111
+ {
1112
+ internalType: "uint24",
1113
+ name: "gnsOtcFeeP",
1114
+ type: "uint24",
1115
+ },
1116
+ {
1117
+ internalType: "uint24",
1118
+ name: "gTokenFeeP",
1119
+ type: "uint24",
1120
+ },
1121
+ {
1122
+ internalType: "uint136",
1123
+ name: "__placeholder",
1124
+ type: "uint136",
1125
+ },
1126
+ ],
1127
+ internalType: "struct IPairsStorage.GlobalTradeFeeParams",
1128
+ name: "",
1129
+ type: "tuple",
1130
+ },
1131
+ ],
1132
+ stateMutability: "view",
1133
+ type: "function",
1134
+ signature: "0x48fc3ef3",
1135
+ },
949
1136
  {
950
1137
  inputs: [
951
1138
  {
@@ -1137,6 +1324,52 @@ const _abi = [
1137
1324
  type: "function",
1138
1325
  signature: "0x85d4390e",
1139
1326
  },
1327
+ {
1328
+ inputs: [
1329
+ {
1330
+ components: [
1331
+ {
1332
+ internalType: "uint24",
1333
+ name: "referralFeeP",
1334
+ type: "uint24",
1335
+ },
1336
+ {
1337
+ internalType: "uint24",
1338
+ name: "govFeeP",
1339
+ type: "uint24",
1340
+ },
1341
+ {
1342
+ internalType: "uint24",
1343
+ name: "triggerOrderFeeP",
1344
+ type: "uint24",
1345
+ },
1346
+ {
1347
+ internalType: "uint24",
1348
+ name: "gnsOtcFeeP",
1349
+ type: "uint24",
1350
+ },
1351
+ {
1352
+ internalType: "uint24",
1353
+ name: "gTokenFeeP",
1354
+ type: "uint24",
1355
+ },
1356
+ {
1357
+ internalType: "uint136",
1358
+ name: "__placeholder",
1359
+ type: "uint136",
1360
+ },
1361
+ ],
1362
+ internalType: "struct IPairsStorage.GlobalTradeFeeParams",
1363
+ name: "_tradeFeeParams",
1364
+ type: "tuple",
1365
+ },
1366
+ ],
1367
+ name: "initializeNewFees",
1368
+ outputs: [],
1369
+ stateMutability: "nonpayable",
1370
+ type: "function",
1371
+ signature: "0xc85ac748",
1372
+ },
1140
1373
  {
1141
1374
  inputs: [
1142
1375
  {
@@ -1190,7 +1423,7 @@ const _abi = [
1190
1423
  type: "uint256",
1191
1424
  },
1192
1425
  ],
1193
- name: "pairCloseFeeP",
1426
+ name: "pairCustomMaxLeverage",
1194
1427
  outputs: [
1195
1428
  {
1196
1429
  internalType: "uint256",
@@ -1200,27 +1433,7 @@ const _abi = [
1200
1433
  ],
1201
1434
  stateMutability: "view",
1202
1435
  type: "function",
1203
- signature: "0x836a341a",
1204
- },
1205
- {
1206
- inputs: [
1207
- {
1208
- internalType: "uint256",
1209
- name: "_pairIndex",
1210
- type: "uint256",
1211
- },
1212
- ],
1213
- name: "pairCustomMaxLeverage",
1214
- outputs: [
1215
- {
1216
- internalType: "uint256",
1217
- name: "",
1218
- type: "uint256",
1219
- },
1220
- ],
1221
- stateMutability: "view",
1222
- type: "function",
1223
- signature: "0x24a96865",
1436
+ signature: "0x24a96865",
1224
1437
  },
1225
1438
  {
1226
1439
  inputs: [
@@ -1335,7 +1548,7 @@ const _abi = [
1335
1548
  type: "uint256",
1336
1549
  },
1337
1550
  ],
1338
- name: "pairOpenFeeP",
1551
+ name: "pairOraclePositionSizeFeeP",
1339
1552
  outputs: [
1340
1553
  {
1341
1554
  internalType: "uint256",
@@ -1345,7 +1558,7 @@ const _abi = [
1345
1558
  ],
1346
1559
  stateMutability: "view",
1347
1560
  type: "function",
1348
- signature: "0x8251135b",
1561
+ signature: "0x0cf34255",
1349
1562
  },
1350
1563
  {
1351
1564
  inputs: [
@@ -1355,7 +1568,7 @@ const _abi = [
1355
1568
  type: "uint256",
1356
1569
  },
1357
1570
  ],
1358
- name: "pairOracleFeeP",
1571
+ name: "pairSpreadP",
1359
1572
  outputs: [
1360
1573
  {
1361
1574
  internalType: "uint256",
@@ -1365,7 +1578,7 @@ const _abi = [
1365
1578
  ],
1366
1579
  stateMutability: "view",
1367
1580
  type: "function",
1368
- signature: "0xf7acbabd",
1581
+ signature: "0xa1d54e9b",
1369
1582
  },
1370
1583
  {
1371
1584
  inputs: [
@@ -1375,7 +1588,7 @@ const _abi = [
1375
1588
  type: "uint256",
1376
1589
  },
1377
1590
  ],
1378
- name: "pairSpreadP",
1591
+ name: "pairTotalLiqCollateralFeeP",
1379
1592
  outputs: [
1380
1593
  {
1381
1594
  internalType: "uint256",
@@ -1385,7 +1598,7 @@ const _abi = [
1385
1598
  ],
1386
1599
  stateMutability: "view",
1387
1600
  type: "function",
1388
- signature: "0xa1d54e9b",
1601
+ signature: "0xfbf3f911",
1389
1602
  },
1390
1603
  {
1391
1604
  inputs: [
@@ -1395,7 +1608,7 @@ const _abi = [
1395
1608
  type: "uint256",
1396
1609
  },
1397
1610
  ],
1398
- name: "pairTriggerOrderFeeP",
1611
+ name: "pairTotalPositionSizeFeeP",
1399
1612
  outputs: [
1400
1613
  {
1401
1614
  internalType: "uint256",
@@ -1405,7 +1618,7 @@ const _abi = [
1405
1618
  ],
1406
1619
  stateMutability: "view",
1407
1620
  type: "function",
1408
- signature: "0xe74aff72",
1621
+ signature: "0xc927b4b6",
1409
1622
  },
1410
1623
  {
1411
1624
  inputs: [
@@ -1482,156 +1695,64 @@ const _abi = [
1482
1695
  signature: "0xb91ac788",
1483
1696
  },
1484
1697
  {
1485
- inputs: [
1698
+ inputs: [],
1699
+ name: "pairsCount",
1700
+ outputs: [
1486
1701
  {
1487
1702
  internalType: "uint256",
1488
- name: "_index",
1703
+ name: "",
1489
1704
  type: "uint256",
1490
1705
  },
1491
1706
  ],
1492
- name: "pairsBackend",
1493
- outputs: [
1494
- {
1495
- components: [
1496
- {
1497
- internalType: "string",
1498
- name: "from",
1499
- type: "string",
1500
- },
1501
- {
1502
- internalType: "string",
1503
- name: "to",
1504
- type: "string",
1505
- },
1506
- {
1507
- components: [
1508
- {
1509
- internalType: "address",
1510
- name: "feed1",
1511
- type: "address",
1512
- },
1513
- {
1514
- internalType: "address",
1515
- name: "feed2",
1516
- type: "address",
1517
- },
1518
- {
1519
- internalType: "enum IPairsStorage.FeedCalculation",
1520
- name: "feedCalculation",
1521
- type: "uint8",
1522
- },
1523
- {
1524
- internalType: "uint256",
1525
- name: "maxDeviationP",
1526
- type: "uint256",
1527
- },
1528
- ],
1529
- internalType: "struct IPairsStorage.Feed",
1530
- name: "feed",
1531
- type: "tuple",
1532
- },
1533
- {
1534
- internalType: "uint256",
1535
- name: "spreadP",
1536
- type: "uint256",
1537
- },
1538
- {
1539
- internalType: "uint256",
1540
- name: "groupIndex",
1541
- type: "uint256",
1542
- },
1543
- {
1544
- internalType: "uint256",
1545
- name: "feeIndex",
1546
- type: "uint256",
1547
- },
1548
- ],
1549
- internalType: "struct IPairsStorage.Pair",
1550
- name: "",
1551
- type: "tuple",
1552
- },
1553
- {
1554
- components: [
1555
- {
1556
- internalType: "string",
1557
- name: "name",
1558
- type: "string",
1559
- },
1560
- {
1561
- internalType: "bytes32",
1562
- name: "job",
1563
- type: "bytes32",
1564
- },
1565
- {
1566
- internalType: "uint256",
1567
- name: "minLeverage",
1568
- type: "uint256",
1569
- },
1570
- {
1571
- internalType: "uint256",
1572
- name: "maxLeverage",
1573
- type: "uint256",
1574
- },
1575
- ],
1576
- internalType: "struct IPairsStorage.Group",
1577
- name: "",
1578
- type: "tuple",
1579
- },
1707
+ stateMutability: "view",
1708
+ type: "function",
1709
+ signature: "0xb81b2b71",
1710
+ },
1711
+ {
1712
+ inputs: [
1580
1713
  {
1581
1714
  components: [
1582
1715
  {
1583
- internalType: "string",
1584
- name: "name",
1585
- type: "string",
1716
+ internalType: "uint24",
1717
+ name: "referralFeeP",
1718
+ type: "uint24",
1586
1719
  },
1587
1720
  {
1588
- internalType: "uint256",
1589
- name: "openFeeP",
1590
- type: "uint256",
1721
+ internalType: "uint24",
1722
+ name: "govFeeP",
1723
+ type: "uint24",
1591
1724
  },
1592
1725
  {
1593
- internalType: "uint256",
1594
- name: "closeFeeP",
1595
- type: "uint256",
1726
+ internalType: "uint24",
1727
+ name: "triggerOrderFeeP",
1728
+ type: "uint24",
1596
1729
  },
1597
1730
  {
1598
- internalType: "uint256",
1599
- name: "oracleFeeP",
1600
- type: "uint256",
1731
+ internalType: "uint24",
1732
+ name: "gnsOtcFeeP",
1733
+ type: "uint24",
1601
1734
  },
1602
1735
  {
1603
- internalType: "uint256",
1604
- name: "triggerOrderFeeP",
1605
- type: "uint256",
1736
+ internalType: "uint24",
1737
+ name: "gTokenFeeP",
1738
+ type: "uint24",
1606
1739
  },
1607
1740
  {
1608
- internalType: "uint256",
1609
- name: "minPositionSizeUsd",
1610
- type: "uint256",
1741
+ internalType: "uint136",
1742
+ name: "__placeholder",
1743
+ type: "uint136",
1611
1744
  },
1612
1745
  ],
1613
- internalType: "struct IPairsStorage.Fee",
1614
- name: "",
1746
+ internalType: "struct IPairsStorage.GlobalTradeFeeParams",
1747
+ name: "_feeParams",
1615
1748
  type: "tuple",
1616
1749
  },
1617
1750
  ],
1618
- stateMutability: "view",
1619
- type: "function",
1620
- signature: "0x9567dccf",
1621
- },
1622
- {
1623
- inputs: [],
1624
- name: "pairsCount",
1625
- outputs: [
1626
- {
1627
- internalType: "uint256",
1628
- name: "",
1629
- type: "uint256",
1630
- },
1631
- ],
1632
- stateMutability: "view",
1751
+ name: "setGlobalTradeFeeParams",
1752
+ outputs: [],
1753
+ stateMutability: "nonpayable",
1633
1754
  type: "function",
1634
- signature: "0xb81b2b71",
1755
+ signature: "0x5f57a073",
1635
1756
  },
1636
1757
  {
1637
1758
  inputs: [
@@ -1708,37 +1829,32 @@ const _abi = [
1708
1829
  {
1709
1830
  components: [
1710
1831
  {
1711
- internalType: "string",
1712
- name: "name",
1713
- type: "string",
1714
- },
1715
- {
1716
- internalType: "uint256",
1717
- name: "openFeeP",
1718
- type: "uint256",
1832
+ internalType: "uint40",
1833
+ name: "totalPositionSizeFeeP",
1834
+ type: "uint40",
1719
1835
  },
1720
1836
  {
1721
- internalType: "uint256",
1722
- name: "closeFeeP",
1723
- type: "uint256",
1837
+ internalType: "uint40",
1838
+ name: "totalLiqCollateralFeeP",
1839
+ type: "uint40",
1724
1840
  },
1725
1841
  {
1726
- internalType: "uint256",
1727
- name: "oracleFeeP",
1728
- type: "uint256",
1842
+ internalType: "uint40",
1843
+ name: "oraclePositionSizeFeeP",
1844
+ type: "uint40",
1729
1845
  },
1730
1846
  {
1731
- internalType: "uint256",
1732
- name: "triggerOrderFeeP",
1733
- type: "uint256",
1847
+ internalType: "uint32",
1848
+ name: "minPositionSizeUsd",
1849
+ type: "uint32",
1734
1850
  },
1735
1851
  {
1736
- internalType: "uint256",
1737
- name: "minPositionSizeUsd",
1738
- type: "uint256",
1852
+ internalType: "uint104",
1853
+ name: "__placeholder",
1854
+ type: "uint104",
1739
1855
  },
1740
1856
  ],
1741
- internalType: "struct IPairsStorage.Fee[]",
1857
+ internalType: "struct IPairsStorage.FeeGroup[]",
1742
1858
  name: "_fees",
1743
1859
  type: "tuple[]",
1744
1860
  },
@@ -1747,7 +1863,7 @@ const _abi = [
1747
1863
  outputs: [],
1748
1864
  stateMutability: "nonpayable",
1749
1865
  type: "function",
1750
- signature: "0xe57f6759",
1866
+ signature: "0x1cf71b9b",
1751
1867
  },
1752
1868
  {
1753
1869
  inputs: [
@@ -2167,7 +2283,7 @@ const _abi = [
2167
2283
  },
2168
2284
  {
2169
2285
  internalType: "uint256",
2170
- name: "_pairOpenFeeP",
2286
+ name: "_referrerFeeUsd",
2171
2287
  type: "uint256",
2172
2288
  },
2173
2289
  {
@@ -2177,13 +2293,7 @@ const _abi = [
2177
2293
  },
2178
2294
  ],
2179
2295
  name: "distributeReferralReward",
2180
- outputs: [
2181
- {
2182
- internalType: "uint256",
2183
- name: "",
2184
- type: "uint256",
2185
- },
2186
- ],
2296
+ outputs: [],
2187
2297
  stateMutability: "nonpayable",
2188
2298
  type: "function",
2189
2299
  signature: "0xfa3c8dbf",
@@ -2254,20 +2364,6 @@ const _abi = [
2254
2364
  type: "function",
2255
2365
  signature: "0x97436b5f",
2256
2366
  },
2257
- {
2258
- inputs: [],
2259
- name: "getReferralsOpenFeeP",
2260
- outputs: [
2261
- {
2262
- internalType: "uint256",
2263
- name: "",
2264
- type: "uint256",
2265
- },
2266
- ],
2267
- stateMutability: "view",
2268
- type: "function",
2269
- signature: "0x06350917",
2270
- },
2271
2367
  {
2272
2368
  inputs: [],
2273
2369
  name: "getReferralsStartReferrerFeeP",
@@ -2356,17 +2452,12 @@ const _abi = [
2356
2452
  {
2357
2453
  inputs: [
2358
2454
  {
2359
- internalType: "uint256",
2360
- name: "_pairOpenFeeP",
2361
- type: "uint256",
2362
- },
2363
- {
2364
- internalType: "uint256",
2365
- name: "_volumeReferredUsd",
2366
- type: "uint256",
2455
+ internalType: "address",
2456
+ name: "_referrer",
2457
+ type: "address",
2367
2458
  },
2368
2459
  ],
2369
- name: "getReferrerFeeP",
2460
+ name: "getReferrerFeeProgressP",
2370
2461
  outputs: [
2371
2462
  {
2372
2463
  internalType: "uint256",
@@ -2376,7 +2467,7 @@ const _abi = [
2376
2467
  ],
2377
2468
  stateMutability: "view",
2378
2469
  type: "function",
2379
- signature: "0x4e583b31",
2470
+ signature: "0x5d19b5d3",
2380
2471
  },
2381
2472
  {
2382
2473
  inputs: [
@@ -2470,11 +2561,6 @@ const _abi = [
2470
2561
  name: "_startReferrerFeeP",
2471
2562
  type: "uint256",
2472
2563
  },
2473
- {
2474
- internalType: "uint256",
2475
- name: "_openFeeP",
2476
- type: "uint256",
2477
- },
2478
2564
  {
2479
2565
  internalType: "uint256",
2480
2566
  name: "_targetVolumeUsd",
@@ -2485,7 +2571,7 @@ const _abi = [
2485
2571
  outputs: [],
2486
2572
  stateMutability: "nonpayable",
2487
2573
  type: "function",
2488
- signature: "0xc8b0d710",
2574
+ signature: "0x38fb18c7",
2489
2575
  },
2490
2576
  {
2491
2577
  inputs: [
@@ -2548,20 +2634,6 @@ const _abi = [
2548
2634
  type: "function",
2549
2635
  signature: "0x97365b74",
2550
2636
  },
2551
- {
2552
- inputs: [
2553
- {
2554
- internalType: "uint256",
2555
- name: "_value",
2556
- type: "uint256",
2557
- },
2558
- ],
2559
- name: "updateReferralsOpenFeeP",
2560
- outputs: [],
2561
- stateMutability: "nonpayable",
2562
- type: "function",
2563
- signature: "0xdfed4fcb",
2564
- },
2565
2637
  {
2566
2638
  inputs: [
2567
2639
  {
@@ -2623,6 +2695,11 @@ const _abi = [
2623
2695
  type: "function",
2624
2696
  signature: "0x507cd8de",
2625
2697
  },
2698
+ {
2699
+ inputs: [],
2700
+ name: "PointsOverflow",
2701
+ type: "error",
2702
+ },
2626
2703
  {
2627
2704
  inputs: [],
2628
2705
  name: "WrongFeeTier",
@@ -2826,27 +2903,109 @@ const _abi = [
2826
2903
  type: "address",
2827
2904
  },
2828
2905
  {
2829
- indexed: false,
2906
+ indexed: true,
2830
2907
  internalType: "uint32",
2831
- name: "fromDay",
2908
+ name: "day",
2832
2909
  type: "uint32",
2833
2910
  },
2834
2911
  {
2835
2912
  indexed: false,
2836
- internalType: "uint32",
2837
- name: "toDay",
2838
- type: "uint32",
2913
+ internalType: "enum IFeeTiers.CreditType",
2914
+ name: "creditType",
2915
+ type: "uint8",
2839
2916
  },
2840
2917
  {
2841
2918
  indexed: false,
2842
2919
  internalType: "uint224",
2843
- name: "expiredPoints",
2920
+ name: "points",
2844
2921
  type: "uint224",
2845
2922
  },
2846
2923
  ],
2847
- name: "TraderTrailingPointsExpired",
2924
+ name: "TraderPointsCredited",
2848
2925
  type: "event",
2849
- signature: "0x964f0f6a92f6d7eedbff7670a2e850f5511e59321724a9dbef638c8068b7527b",
2926
+ signature: "0xf050ee240db213d72ebabd2f46c0d3270c8206c02d51e074d447c4ca20bd7a6f",
2927
+ },
2928
+ {
2929
+ anonymous: false,
2930
+ inputs: [
2931
+ {
2932
+ indexed: true,
2933
+ internalType: "address",
2934
+ name: "trader",
2935
+ type: "address",
2936
+ },
2937
+ {
2938
+ indexed: false,
2939
+ internalType: "uint32",
2940
+ name: "fromDay",
2941
+ type: "uint32",
2942
+ },
2943
+ {
2944
+ indexed: false,
2945
+ internalType: "uint32",
2946
+ name: "toDay",
2947
+ type: "uint32",
2948
+ },
2949
+ {
2950
+ indexed: false,
2951
+ internalType: "uint224",
2952
+ name: "expiredPoints",
2953
+ type: "uint224",
2954
+ },
2955
+ ],
2956
+ name: "TraderTrailingPointsExpired",
2957
+ type: "event",
2958
+ signature: "0x964f0f6a92f6d7eedbff7670a2e850f5511e59321724a9dbef638c8068b7527b",
2959
+ },
2960
+ {
2961
+ anonymous: false,
2962
+ inputs: [
2963
+ {
2964
+ indexed: true,
2965
+ internalType: "address",
2966
+ name: "trader",
2967
+ type: "address",
2968
+ },
2969
+ {
2970
+ indexed: true,
2971
+ internalType: "uint32",
2972
+ name: "day",
2973
+ type: "uint32",
2974
+ },
2975
+ {
2976
+ indexed: false,
2977
+ internalType: "uint224",
2978
+ name: "points",
2979
+ type: "uint224",
2980
+ },
2981
+ ],
2982
+ name: "TraderUnclaimedPointsClaimed",
2983
+ type: "event",
2984
+ signature: "0x8b1dd1669c243ea81885b90c31d292a58996045d48bd261b3aea98a09cd66f1e",
2985
+ },
2986
+ {
2987
+ inputs: [
2988
+ {
2989
+ internalType: "address[]",
2990
+ name: "_traders",
2991
+ type: "address[]",
2992
+ },
2993
+ {
2994
+ internalType: "enum IFeeTiers.CreditType[]",
2995
+ name: "_creditTypes",
2996
+ type: "uint8[]",
2997
+ },
2998
+ {
2999
+ internalType: "uint224[]",
3000
+ name: "_points",
3001
+ type: "uint224[]",
3002
+ },
3003
+ ],
3004
+ name: "addTradersUnclaimedPoints",
3005
+ outputs: [],
3006
+ stateMutability: "nonpayable",
3007
+ type: "function",
3008
+ signature: "0xb61ce13b",
2850
3009
  },
2851
3010
  {
2852
3011
  inputs: [
@@ -3040,6 +3199,26 @@ const _abi = [
3040
3199
  type: "function",
3041
3200
  signature: "0x508cbfbe",
3042
3201
  },
3202
+ {
3203
+ inputs: [
3204
+ {
3205
+ internalType: "address",
3206
+ name: "_trader",
3207
+ type: "address",
3208
+ },
3209
+ ],
3210
+ name: "getTraderUnclaimedPoints",
3211
+ outputs: [
3212
+ {
3213
+ internalType: "uint224",
3214
+ name: "",
3215
+ type: "uint224",
3216
+ },
3217
+ ],
3218
+ stateMutability: "view",
3219
+ type: "function",
3220
+ signature: "0x84e3ebe2",
3221
+ },
3043
3222
  {
3044
3223
  inputs: [
3045
3224
  {
@@ -3216,6 +3395,60 @@ const _abi = [
3216
3395
  type: "event",
3217
3396
  signature: "0x2742ec28d0252b4477106a77a10b04e1c1ecd2b568c7168d56c3a3154d3a3122",
3218
3397
  },
3398
+ {
3399
+ anonymous: false,
3400
+ inputs: [
3401
+ {
3402
+ indexed: true,
3403
+ internalType: "uint256",
3404
+ name: "pairIndex",
3405
+ type: "uint256",
3406
+ },
3407
+ {
3408
+ indexed: false,
3409
+ internalType: "bool",
3410
+ name: "exemptAfterProtectionCloseFactor",
3411
+ type: "bool",
3412
+ },
3413
+ ],
3414
+ name: "ExemptAfterProtectionCloseFactorUpdated",
3415
+ type: "event",
3416
+ signature: "0xd5c6c8f00fcf1cd1dcccec431caee897386371cb8c3ec99d177b49ca8b38de7a",
3417
+ },
3418
+ {
3419
+ anonymous: false,
3420
+ inputs: [
3421
+ {
3422
+ indexed: true,
3423
+ internalType: "uint256",
3424
+ name: "pairIndex",
3425
+ type: "uint256",
3426
+ },
3427
+ {
3428
+ indexed: false,
3429
+ internalType: "bool",
3430
+ name: "exemptOnOpen",
3431
+ type: "bool",
3432
+ },
3433
+ ],
3434
+ name: "ExemptOnOpenUpdated",
3435
+ type: "event",
3436
+ signature: "0x194d4896e74b7ec72619871dc3ed535210aa9f76fa7b42822b6980a8585938ca",
3437
+ },
3438
+ {
3439
+ anonymous: false,
3440
+ inputs: [
3441
+ {
3442
+ indexed: true,
3443
+ internalType: "uint40",
3444
+ name: "negPnlCumulVolMultiplier",
3445
+ type: "uint40",
3446
+ },
3447
+ ],
3448
+ name: "NegPnlCumulVolMultiplierUpdated",
3449
+ type: "event",
3450
+ signature: "0x6d53c6510943113652968162063328b13689dc76c9927ac79a6706ae6eaf8212",
3451
+ },
3219
3452
  {
3220
3453
  anonymous: false,
3221
3454
  inputs: [
@@ -3366,6 +3599,11 @@ const _abi = [
3366
3599
  name: "open",
3367
3600
  type: "bool",
3368
3601
  },
3602
+ {
3603
+ internalType: "bool",
3604
+ name: "isPnlPositive",
3605
+ type: "bool",
3606
+ },
3369
3607
  {
3370
3608
  internalType: "uint128",
3371
3609
  name: "openInterestUsd",
@@ -3380,7 +3618,7 @@ const _abi = [
3380
3618
  ],
3381
3619
  name: "PriceImpactOpenInterestAdded",
3382
3620
  type: "event",
3383
- signature: "0xcca5358ade10271036cf22898f07ad681f9dd7fc3e861da5fc31319c4b890ad4",
3621
+ signature: "0xf9cf8994f1c8e16af56d311d1ebb387a7a3c37cc847edbd2155ad32c5cc9a2fe",
3384
3622
  },
3385
3623
  {
3386
3624
  anonymous: false,
@@ -3450,6 +3688,26 @@ const _abi = [
3450
3688
  type: "event",
3451
3689
  signature: "0x471eb2788149a10519cea684f0149db7c6af0e5fa1182f06b50c5420fe95d12a",
3452
3690
  },
3691
+ {
3692
+ anonymous: false,
3693
+ inputs: [
3694
+ {
3695
+ indexed: false,
3696
+ internalType: "address",
3697
+ name: "trader",
3698
+ type: "address",
3699
+ },
3700
+ {
3701
+ indexed: false,
3702
+ internalType: "bool",
3703
+ name: "whitelisted",
3704
+ type: "bool",
3705
+ },
3706
+ ],
3707
+ name: "ProtectionCloseFactorWhitelistUpdated",
3708
+ type: "event",
3709
+ signature: "0xb97e27f523fc23750f9d24f12010b9c513c301db9022d0ce8e27a50d9f426383",
3710
+ },
3453
3711
  {
3454
3712
  inputs: [
3455
3713
  {
@@ -3472,12 +3730,31 @@ const _abi = [
3472
3730
  name: "_open",
3473
3731
  type: "bool",
3474
3732
  },
3733
+ {
3734
+ internalType: "bool",
3735
+ name: "_isPnlPositive",
3736
+ type: "bool",
3737
+ },
3475
3738
  ],
3476
3739
  name: "addPriceImpactOpenInterest",
3477
3740
  outputs: [],
3478
3741
  stateMutability: "nonpayable",
3479
3742
  type: "function",
3480
- signature: "0x23ce624b",
3743
+ signature: "0x81688f7b",
3744
+ },
3745
+ {
3746
+ inputs: [],
3747
+ name: "getNegPnlCumulVolMultiplier",
3748
+ outputs: [
3749
+ {
3750
+ internalType: "uint48",
3751
+ name: "",
3752
+ type: "uint48",
3753
+ },
3754
+ ],
3755
+ stateMutability: "view",
3756
+ type: "function",
3757
+ signature: "0xc1681679",
3481
3758
  },
3482
3759
  {
3483
3760
  inputs: [
@@ -3686,9 +3963,19 @@ const _abi = [
3686
3963
  type: "uint40",
3687
3964
  },
3688
3965
  {
3689
- internalType: "uint144",
3966
+ internalType: "bool",
3967
+ name: "exemptOnOpen",
3968
+ type: "bool",
3969
+ },
3970
+ {
3971
+ internalType: "bool",
3972
+ name: "exemptAfterProtectionCloseFactor",
3973
+ type: "bool",
3974
+ },
3975
+ {
3976
+ internalType: "uint128",
3690
3977
  name: "__placeholder",
3691
- type: "uint144",
3978
+ type: "uint128",
3692
3979
  },
3693
3980
  ],
3694
3981
  internalType: "struct IPriceImpact.PairFactors[]",
@@ -3727,6 +4014,31 @@ const _abi = [
3727
4014
  },
3728
4015
  {
3729
4016
  inputs: [
4017
+ {
4018
+ internalType: "address",
4019
+ name: "_trader",
4020
+ type: "address",
4021
+ },
4022
+ ],
4023
+ name: "getProtectionCloseFactorWhitelist",
4024
+ outputs: [
4025
+ {
4026
+ internalType: "bool",
4027
+ name: "",
4028
+ type: "bool",
4029
+ },
4030
+ ],
4031
+ stateMutability: "view",
4032
+ type: "function",
4033
+ signature: "0x2aa8f882",
4034
+ },
4035
+ {
4036
+ inputs: [
4037
+ {
4038
+ internalType: "address",
4039
+ name: "_trader",
4040
+ type: "address",
4041
+ },
3730
4042
  {
3731
4043
  internalType: "uint256",
3732
4044
  name: "_marketPrice",
@@ -3783,7 +4095,21 @@ const _abi = [
3783
4095
  ],
3784
4096
  stateMutability: "view",
3785
4097
  type: "function",
3786
- signature: "0xdd5ef6f1",
4098
+ signature: "0xae0d3a07",
4099
+ },
4100
+ {
4101
+ inputs: [
4102
+ {
4103
+ internalType: "uint40",
4104
+ name: "_negPnlCumulVolMultiplier",
4105
+ type: "uint40",
4106
+ },
4107
+ ],
4108
+ name: "initializeNegPnlCumulVolMultiplier",
4109
+ outputs: [],
4110
+ stateMutability: "nonpayable",
4111
+ type: "function",
4112
+ signature: "0xe551bcbf",
3787
4113
  },
3788
4114
  {
3789
4115
  inputs: [
@@ -3855,60 +4181,112 @@ const _abi = [
3855
4181
  {
3856
4182
  inputs: [
3857
4183
  {
3858
- internalType: "uint256[]",
3859
- name: "_indices",
3860
- type: "uint256[]",
3861
- },
3862
- {
3863
- internalType: "uint128[]",
3864
- name: "_depthsAboveUsd",
3865
- type: "uint128[]",
4184
+ internalType: "uint16[]",
4185
+ name: "_pairIndices",
4186
+ type: "uint16[]",
3866
4187
  },
3867
4188
  {
3868
- internalType: "uint128[]",
3869
- name: "_depthsBelowUsd",
3870
- type: "uint128[]",
4189
+ internalType: "bool[]",
4190
+ name: "_exemptAfterProtectionCloseFactor",
4191
+ type: "bool[]",
3871
4192
  },
3872
4193
  ],
3873
- name: "setPairDepths",
4194
+ name: "setExemptAfterProtectionCloseFactor",
3874
4195
  outputs: [],
3875
4196
  stateMutability: "nonpayable",
3876
4197
  type: "function",
3877
- signature: "0x6474b399",
4198
+ signature: "0x212d8a1e",
3878
4199
  },
3879
4200
  {
3880
4201
  inputs: [
3881
4202
  {
3882
- internalType: "uint48",
3883
- name: "_newWindowsCount",
3884
- type: "uint48",
4203
+ internalType: "uint16[]",
4204
+ name: "_pairIndices",
4205
+ type: "uint16[]",
4206
+ },
4207
+ {
4208
+ internalType: "bool[]",
4209
+ name: "_exemptOnOpen",
4210
+ type: "bool[]",
3885
4211
  },
3886
4212
  ],
3887
- name: "setPriceImpactWindowsCount",
4213
+ name: "setExemptOnOpen",
3888
4214
  outputs: [],
3889
4215
  stateMutability: "nonpayable",
3890
4216
  type: "function",
3891
- signature: "0x10751b4f",
4217
+ signature: "0xdded895a",
3892
4218
  },
3893
4219
  {
3894
4220
  inputs: [
3895
4221
  {
3896
- internalType: "uint48",
3897
- name: "_newWindowsDuration",
3898
- type: "uint48",
4222
+ internalType: "uint40",
4223
+ name: "_negPnlCumulVolMultiplier",
4224
+ type: "uint40",
3899
4225
  },
3900
4226
  ],
3901
- name: "setPriceImpactWindowsDuration",
4227
+ name: "setNegPnlCumulVolMultiplier",
3902
4228
  outputs: [],
3903
4229
  stateMutability: "nonpayable",
3904
4230
  type: "function",
3905
- signature: "0x39b0fc82",
4231
+ signature: "0x302e88f8",
3906
4232
  },
3907
4233
  {
3908
4234
  inputs: [
3909
4235
  {
3910
- internalType: "uint16[]",
3911
- name: "_pairIndices",
4236
+ internalType: "uint256[]",
4237
+ name: "_indices",
4238
+ type: "uint256[]",
4239
+ },
4240
+ {
4241
+ internalType: "uint128[]",
4242
+ name: "_depthsAboveUsd",
4243
+ type: "uint128[]",
4244
+ },
4245
+ {
4246
+ internalType: "uint128[]",
4247
+ name: "_depthsBelowUsd",
4248
+ type: "uint128[]",
4249
+ },
4250
+ ],
4251
+ name: "setPairDepths",
4252
+ outputs: [],
4253
+ stateMutability: "nonpayable",
4254
+ type: "function",
4255
+ signature: "0x6474b399",
4256
+ },
4257
+ {
4258
+ inputs: [
4259
+ {
4260
+ internalType: "uint48",
4261
+ name: "_newWindowsCount",
4262
+ type: "uint48",
4263
+ },
4264
+ ],
4265
+ name: "setPriceImpactWindowsCount",
4266
+ outputs: [],
4267
+ stateMutability: "nonpayable",
4268
+ type: "function",
4269
+ signature: "0x10751b4f",
4270
+ },
4271
+ {
4272
+ inputs: [
4273
+ {
4274
+ internalType: "uint48",
4275
+ name: "_newWindowsDuration",
4276
+ type: "uint48",
4277
+ },
4278
+ ],
4279
+ name: "setPriceImpactWindowsDuration",
4280
+ outputs: [],
4281
+ stateMutability: "nonpayable",
4282
+ type: "function",
4283
+ signature: "0x39b0fc82",
4284
+ },
4285
+ {
4286
+ inputs: [
4287
+ {
4288
+ internalType: "uint16[]",
4289
+ name: "_pairIndices",
3912
4290
  type: "uint16[]",
3913
4291
  },
3914
4292
  {
@@ -3923,6 +4301,25 @@ const _abi = [
3923
4301
  type: "function",
3924
4302
  signature: "0x2a4cde4a",
3925
4303
  },
4304
+ {
4305
+ inputs: [
4306
+ {
4307
+ internalType: "address[]",
4308
+ name: "_traders",
4309
+ type: "address[]",
4310
+ },
4311
+ {
4312
+ internalType: "bool[]",
4313
+ name: "_whitelisted",
4314
+ type: "bool[]",
4315
+ },
4316
+ ],
4317
+ name: "setProtectionCloseFactorWhitelist",
4318
+ outputs: [],
4319
+ stateMutability: "nonpayable",
4320
+ type: "function",
4321
+ signature: "0xd8762abb",
4322
+ },
3926
4323
  {
3927
4324
  inputs: [
3928
4325
  {
@@ -4082,22 +4479,16 @@ const _abi = [
4082
4479
  anonymous: false,
4083
4480
  inputs: [
4084
4481
  {
4085
- components: [
4086
- {
4087
- internalType: "address",
4088
- name: "user",
4089
- type: "address",
4090
- },
4091
- {
4092
- internalType: "uint32",
4093
- name: "index",
4094
- type: "uint32",
4095
- },
4096
- ],
4097
- indexed: false,
4098
- internalType: "struct ITradingStorage.Id",
4099
- name: "tradeId",
4100
- type: "tuple",
4482
+ indexed: true,
4483
+ internalType: "address",
4484
+ name: "user",
4485
+ type: "address",
4486
+ },
4487
+ {
4488
+ indexed: true,
4489
+ internalType: "uint32",
4490
+ name: "index",
4491
+ type: "uint32",
4101
4492
  },
4102
4493
  {
4103
4494
  indexed: false,
@@ -4126,7 +4517,7 @@ const _abi = [
4126
4517
  ],
4127
4518
  name: "OpenOrderDetailsUpdated",
4128
4519
  type: "event",
4129
- signature: "0x57166866105b85933cf7d2f84637e524028a4ca84133309f14b2ce0dfc113498",
4520
+ signature: "0x1db0f5e6d7fd465827f67d8349f32499863715a690a2e33a77cf3d1b53b5ba1a",
4130
4521
  },
4131
4522
  {
4132
4523
  anonymous: false,
@@ -4276,48 +4667,42 @@ const _abi = [
4276
4667
  anonymous: false,
4277
4668
  inputs: [
4278
4669
  {
4279
- components: [
4280
- {
4281
- internalType: "address",
4282
- name: "user",
4283
- type: "address",
4284
- },
4285
- {
4286
- internalType: "uint32",
4287
- name: "index",
4288
- type: "uint32",
4289
- },
4290
- ],
4670
+ indexed: true,
4671
+ internalType: "address",
4672
+ name: "user",
4673
+ type: "address",
4674
+ },
4675
+ {
4676
+ indexed: true,
4677
+ internalType: "uint32",
4678
+ name: "index",
4679
+ type: "uint32",
4680
+ },
4681
+ {
4291
4682
  indexed: false,
4292
- internalType: "struct ITradingStorage.Id",
4293
- name: "tradeId",
4294
- type: "tuple",
4683
+ internalType: "bool",
4684
+ name: "isPnlPositive",
4685
+ type: "bool",
4295
4686
  },
4296
4687
  ],
4297
4688
  name: "TradeClosed",
4298
4689
  type: "event",
4299
- signature: "0xedf2f9a86d6e2127c61aaaeb10a282ee4e0aa89ea19c7db37df80fece027a493",
4690
+ signature: "0xa518dc0f204e7b9dcb9655590f084b91940be34dd66e174c2b29f4a81d99d5df",
4300
4691
  },
4301
4692
  {
4302
4693
  anonymous: false,
4303
4694
  inputs: [
4304
4695
  {
4305
- components: [
4306
- {
4307
- internalType: "address",
4308
- name: "user",
4309
- type: "address",
4310
- },
4311
- {
4312
- internalType: "uint32",
4313
- name: "index",
4314
- type: "uint32",
4315
- },
4316
- ],
4317
- indexed: false,
4318
- internalType: "struct ITradingStorage.Id",
4319
- name: "tradeId",
4320
- type: "tuple",
4696
+ indexed: true,
4697
+ internalType: "address",
4698
+ name: "user",
4699
+ type: "address",
4700
+ },
4701
+ {
4702
+ indexed: true,
4703
+ internalType: "uint32",
4704
+ name: "index",
4705
+ type: "uint32",
4321
4706
  },
4322
4707
  {
4323
4708
  indexed: false,
@@ -4328,28 +4713,22 @@ const _abi = [
4328
4713
  ],
4329
4714
  name: "TradeCollateralUpdated",
4330
4715
  type: "event",
4331
- signature: "0xce228a7b1b8e239798e94cb2ba581d57501692fc1d29719a891125f1f393826d",
4716
+ signature: "0x48a630649f549ef031330c87af1da1f77164d2f664b9044c7e95bc01d27999e5",
4332
4717
  },
4333
4718
  {
4334
4719
  anonymous: false,
4335
4720
  inputs: [
4336
4721
  {
4337
- components: [
4338
- {
4339
- internalType: "address",
4340
- name: "user",
4341
- type: "address",
4342
- },
4343
- {
4344
- internalType: "uint32",
4345
- name: "index",
4346
- type: "uint32",
4347
- },
4348
- ],
4349
- indexed: false,
4350
- internalType: "struct ITradingStorage.Id",
4351
- name: "tradeId",
4352
- type: "tuple",
4722
+ indexed: true,
4723
+ internalType: "address",
4724
+ name: "user",
4725
+ type: "address",
4726
+ },
4727
+ {
4728
+ indexed: true,
4729
+ internalType: "uint32",
4730
+ name: "index",
4731
+ type: "uint32",
4353
4732
  },
4354
4733
  {
4355
4734
  indexed: false,
@@ -4360,28 +4739,22 @@ const _abi = [
4360
4739
  ],
4361
4740
  name: "TradeMaxClosingSlippagePUpdated",
4362
4741
  type: "event",
4363
- signature: "0xb34e0065c48018b4a48b78c4729fd9ffd1968c59d6532e600c4afb42ce093da1",
4742
+ signature: "0x3a303c8e1d22ea7e3b98451d472573daeaa2bedb6db17838cb23c0d8b506d89e",
4364
4743
  },
4365
4744
  {
4366
4745
  anonymous: false,
4367
4746
  inputs: [
4368
4747
  {
4369
- components: [
4370
- {
4371
- internalType: "address",
4372
- name: "user",
4373
- type: "address",
4374
- },
4375
- {
4376
- internalType: "uint32",
4377
- name: "index",
4378
- type: "uint32",
4379
- },
4380
- ],
4381
- indexed: false,
4382
- internalType: "struct ITradingStorage.Id",
4383
- name: "tradeId",
4384
- type: "tuple",
4748
+ indexed: true,
4749
+ internalType: "address",
4750
+ name: "user",
4751
+ type: "address",
4752
+ },
4753
+ {
4754
+ indexed: true,
4755
+ internalType: "uint32",
4756
+ name: "index",
4757
+ type: "uint32",
4385
4758
  },
4386
4759
  {
4387
4760
  indexed: false,
@@ -4419,31 +4792,31 @@ const _abi = [
4419
4792
  name: "isPartialIncrease",
4420
4793
  type: "bool",
4421
4794
  },
4795
+ {
4796
+ indexed: false,
4797
+ internalType: "bool",
4798
+ name: "isPnlPositive",
4799
+ type: "bool",
4800
+ },
4422
4801
  ],
4423
4802
  name: "TradePositionUpdated",
4424
4803
  type: "event",
4425
- signature: "0x3890801c6f1ea37e9eb6aaae6cb1e57eeb8fe67e3af47b2533ff1fc4d1031ede",
4804
+ signature: "0xd44377bc88226583e82782aec12182dbe38e1b796330892e34a21a9558611a70",
4426
4805
  },
4427
4806
  {
4428
4807
  anonymous: false,
4429
4808
  inputs: [
4430
4809
  {
4431
- components: [
4432
- {
4433
- internalType: "address",
4434
- name: "user",
4435
- type: "address",
4436
- },
4437
- {
4438
- internalType: "uint32",
4439
- name: "index",
4440
- type: "uint32",
4441
- },
4442
- ],
4443
- indexed: false,
4444
- internalType: "struct ITradingStorage.Id",
4445
- name: "tradeId",
4446
- type: "tuple",
4810
+ indexed: true,
4811
+ internalType: "address",
4812
+ name: "user",
4813
+ type: "address",
4814
+ },
4815
+ {
4816
+ indexed: true,
4817
+ internalType: "uint32",
4818
+ name: "index",
4819
+ type: "uint32",
4447
4820
  },
4448
4821
  {
4449
4822
  indexed: false,
@@ -4454,11 +4827,23 @@ const _abi = [
4454
4827
  ],
4455
4828
  name: "TradeSlUpdated",
4456
4829
  type: "event",
4457
- signature: "0x38f5d5d40d9c4a41aa03d21461f1b07aa6b4ef035fb9d21f02d53a82c712a002",
4830
+ signature: "0xbb058b3eaaea5c2a669a057939f688156d50b5e092969eae671e583635192ead",
4458
4831
  },
4459
4832
  {
4460
4833
  anonymous: false,
4461
4834
  inputs: [
4835
+ {
4836
+ indexed: true,
4837
+ internalType: "address",
4838
+ name: "user",
4839
+ type: "address",
4840
+ },
4841
+ {
4842
+ indexed: true,
4843
+ internalType: "uint32",
4844
+ name: "index",
4845
+ type: "uint32",
4846
+ },
4462
4847
  {
4463
4848
  components: [
4464
4849
  {
@@ -4621,28 +5006,22 @@ const _abi = [
4621
5006
  ],
4622
5007
  name: "TradeStored",
4623
5008
  type: "event",
4624
- signature: "0xb4c8599e992aeeb8f86e02eaee1061646ddf10a354b91f1daa776eb4595387a3",
5009
+ signature: "0x1a540c278c1838afbb56bb7659257d49132e43ff5e7687a333f8b47327db38ff",
4625
5010
  },
4626
5011
  {
4627
5012
  anonymous: false,
4628
5013
  inputs: [
4629
5014
  {
4630
- components: [
4631
- {
4632
- internalType: "address",
4633
- name: "user",
4634
- type: "address",
4635
- },
4636
- {
4637
- internalType: "uint32",
4638
- name: "index",
4639
- type: "uint32",
4640
- },
4641
- ],
4642
- indexed: false,
4643
- internalType: "struct ITradingStorage.Id",
4644
- name: "tradeId",
4645
- type: "tuple",
5015
+ indexed: true,
5016
+ internalType: "address",
5017
+ name: "user",
5018
+ type: "address",
5019
+ },
5020
+ {
5021
+ indexed: true,
5022
+ internalType: "uint32",
5023
+ name: "index",
5024
+ type: "uint32",
4646
5025
  },
4647
5026
  {
4648
5027
  indexed: false,
@@ -4653,7 +5032,7 @@ const _abi = [
4653
5032
  ],
4654
5033
  name: "TradeTpUpdated",
4655
5034
  type: "event",
4656
- signature: "0x3d045f25e6a6757ae5ca79ce5d28d84d69713804353a02c521d6a5352c0f9e20",
5035
+ signature: "0x67ddba1ecd6f73c7d78db146108dbd4e4cc0cea77597d2709de42ff4a603bb22",
4657
5036
  },
4658
5037
  {
4659
5038
  anonymous: false,
@@ -4733,12 +5112,17 @@ const _abi = [
4733
5112
  name: "_tradeId",
4734
5113
  type: "tuple",
4735
5114
  },
5115
+ {
5116
+ internalType: "bool",
5117
+ name: "_isPnlPositive",
5118
+ type: "bool",
5119
+ },
4736
5120
  ],
4737
5121
  name: "closeTrade",
4738
5122
  outputs: [],
4739
5123
  stateMutability: "nonpayable",
4740
5124
  type: "function",
4741
- signature: "0x8583909b",
5125
+ signature: "0x221d25f4",
4742
5126
  },
4743
5127
  {
4744
5128
  inputs: [
@@ -4869,6 +5253,140 @@ const _abi = [
4869
5253
  type: "function",
4870
5254
  signature: "0x2d11445f",
4871
5255
  },
5256
+ {
5257
+ inputs: [
5258
+ {
5259
+ internalType: "address[]",
5260
+ name: "_traders",
5261
+ type: "address[]",
5262
+ },
5263
+ {
5264
+ internalType: "uint256",
5265
+ name: "_offset",
5266
+ type: "uint256",
5267
+ },
5268
+ {
5269
+ internalType: "uint256",
5270
+ name: "_limit",
5271
+ type: "uint256",
5272
+ },
5273
+ ],
5274
+ name: "getAllPendingOrdersForTraders",
5275
+ outputs: [
5276
+ {
5277
+ components: [
5278
+ {
5279
+ components: [
5280
+ {
5281
+ internalType: "address",
5282
+ name: "user",
5283
+ type: "address",
5284
+ },
5285
+ {
5286
+ internalType: "uint32",
5287
+ name: "index",
5288
+ type: "uint32",
5289
+ },
5290
+ {
5291
+ internalType: "uint16",
5292
+ name: "pairIndex",
5293
+ type: "uint16",
5294
+ },
5295
+ {
5296
+ internalType: "uint24",
5297
+ name: "leverage",
5298
+ type: "uint24",
5299
+ },
5300
+ {
5301
+ internalType: "bool",
5302
+ name: "long",
5303
+ type: "bool",
5304
+ },
5305
+ {
5306
+ internalType: "bool",
5307
+ name: "isOpen",
5308
+ type: "bool",
5309
+ },
5310
+ {
5311
+ internalType: "uint8",
5312
+ name: "collateralIndex",
5313
+ type: "uint8",
5314
+ },
5315
+ {
5316
+ internalType: "enum ITradingStorage.TradeType",
5317
+ name: "tradeType",
5318
+ type: "uint8",
5319
+ },
5320
+ {
5321
+ internalType: "uint120",
5322
+ name: "collateralAmount",
5323
+ type: "uint120",
5324
+ },
5325
+ {
5326
+ internalType: "uint64",
5327
+ name: "openPrice",
5328
+ type: "uint64",
5329
+ },
5330
+ {
5331
+ internalType: "uint64",
5332
+ name: "tp",
5333
+ type: "uint64",
5334
+ },
5335
+ {
5336
+ internalType: "uint64",
5337
+ name: "sl",
5338
+ type: "uint64",
5339
+ },
5340
+ {
5341
+ internalType: "uint192",
5342
+ name: "__placeholder",
5343
+ type: "uint192",
5344
+ },
5345
+ ],
5346
+ internalType: "struct ITradingStorage.Trade",
5347
+ name: "trade",
5348
+ type: "tuple",
5349
+ },
5350
+ {
5351
+ internalType: "address",
5352
+ name: "user",
5353
+ type: "address",
5354
+ },
5355
+ {
5356
+ internalType: "uint32",
5357
+ name: "index",
5358
+ type: "uint32",
5359
+ },
5360
+ {
5361
+ internalType: "bool",
5362
+ name: "isOpen",
5363
+ type: "bool",
5364
+ },
5365
+ {
5366
+ internalType: "enum ITradingStorage.PendingOrderType",
5367
+ name: "orderType",
5368
+ type: "uint8",
5369
+ },
5370
+ {
5371
+ internalType: "uint32",
5372
+ name: "createdBlock",
5373
+ type: "uint32",
5374
+ },
5375
+ {
5376
+ internalType: "uint16",
5377
+ name: "maxSlippageP",
5378
+ type: "uint16",
5379
+ },
5380
+ ],
5381
+ internalType: "struct ITradingStorage.PendingOrder[]",
5382
+ name: "",
5383
+ type: "tuple[]",
5384
+ },
5385
+ ],
5386
+ stateMutability: "view",
5387
+ type: "function",
5388
+ signature: "0x28eb002f",
5389
+ },
4872
5390
  {
4873
5391
  inputs: [
4874
5392
  {
@@ -4941,6 +5459,83 @@ const _abi = [
4941
5459
  type: "function",
4942
5460
  signature: "0xeb50287f",
4943
5461
  },
5462
+ {
5463
+ inputs: [
5464
+ {
5465
+ internalType: "address[]",
5466
+ name: "_traders",
5467
+ type: "address[]",
5468
+ },
5469
+ {
5470
+ internalType: "uint256",
5471
+ name: "_offset",
5472
+ type: "uint256",
5473
+ },
5474
+ {
5475
+ internalType: "uint256",
5476
+ name: "_limit",
5477
+ type: "uint256",
5478
+ },
5479
+ ],
5480
+ name: "getAllTradeInfosForTraders",
5481
+ outputs: [
5482
+ {
5483
+ components: [
5484
+ {
5485
+ internalType: "uint32",
5486
+ name: "createdBlock",
5487
+ type: "uint32",
5488
+ },
5489
+ {
5490
+ internalType: "uint32",
5491
+ name: "tpLastUpdatedBlock",
5492
+ type: "uint32",
5493
+ },
5494
+ {
5495
+ internalType: "uint32",
5496
+ name: "slLastUpdatedBlock",
5497
+ type: "uint32",
5498
+ },
5499
+ {
5500
+ internalType: "uint16",
5501
+ name: "maxSlippageP",
5502
+ type: "uint16",
5503
+ },
5504
+ {
5505
+ internalType: "uint48",
5506
+ name: "lastOiUpdateTs",
5507
+ type: "uint48",
5508
+ },
5509
+ {
5510
+ internalType: "uint48",
5511
+ name: "collateralPriceUsd",
5512
+ type: "uint48",
5513
+ },
5514
+ {
5515
+ internalType: "enum ITradingStorage.ContractsVersion",
5516
+ name: "contractsVersion",
5517
+ type: "uint8",
5518
+ },
5519
+ {
5520
+ internalType: "uint32",
5521
+ name: "lastPosIncreaseBlock",
5522
+ type: "uint32",
5523
+ },
5524
+ {
5525
+ internalType: "uint8",
5526
+ name: "__placeholder",
5527
+ type: "uint8",
5528
+ },
5529
+ ],
5530
+ internalType: "struct ITradingStorage.TradeInfo[]",
5531
+ name: "",
5532
+ type: "tuple[]",
5533
+ },
5534
+ ],
5535
+ stateMutability: "view",
5536
+ type: "function",
5537
+ signature: "0x01e87cb0",
5538
+ },
4944
5539
  {
4945
5540
  inputs: [
4946
5541
  {
@@ -5033,6 +5628,103 @@ const _abi = [
5033
5628
  type: "function",
5034
5629
  signature: "0xdffd8a1f",
5035
5630
  },
5631
+ {
5632
+ inputs: [
5633
+ {
5634
+ internalType: "address[]",
5635
+ name: "_traders",
5636
+ type: "address[]",
5637
+ },
5638
+ {
5639
+ internalType: "uint256",
5640
+ name: "_offset",
5641
+ type: "uint256",
5642
+ },
5643
+ {
5644
+ internalType: "uint256",
5645
+ name: "_limit",
5646
+ type: "uint256",
5647
+ },
5648
+ ],
5649
+ name: "getAllTradesForTraders",
5650
+ outputs: [
5651
+ {
5652
+ components: [
5653
+ {
5654
+ internalType: "address",
5655
+ name: "user",
5656
+ type: "address",
5657
+ },
5658
+ {
5659
+ internalType: "uint32",
5660
+ name: "index",
5661
+ type: "uint32",
5662
+ },
5663
+ {
5664
+ internalType: "uint16",
5665
+ name: "pairIndex",
5666
+ type: "uint16",
5667
+ },
5668
+ {
5669
+ internalType: "uint24",
5670
+ name: "leverage",
5671
+ type: "uint24",
5672
+ },
5673
+ {
5674
+ internalType: "bool",
5675
+ name: "long",
5676
+ type: "bool",
5677
+ },
5678
+ {
5679
+ internalType: "bool",
5680
+ name: "isOpen",
5681
+ type: "bool",
5682
+ },
5683
+ {
5684
+ internalType: "uint8",
5685
+ name: "collateralIndex",
5686
+ type: "uint8",
5687
+ },
5688
+ {
5689
+ internalType: "enum ITradingStorage.TradeType",
5690
+ name: "tradeType",
5691
+ type: "uint8",
5692
+ },
5693
+ {
5694
+ internalType: "uint120",
5695
+ name: "collateralAmount",
5696
+ type: "uint120",
5697
+ },
5698
+ {
5699
+ internalType: "uint64",
5700
+ name: "openPrice",
5701
+ type: "uint64",
5702
+ },
5703
+ {
5704
+ internalType: "uint64",
5705
+ name: "tp",
5706
+ type: "uint64",
5707
+ },
5708
+ {
5709
+ internalType: "uint64",
5710
+ name: "sl",
5711
+ type: "uint64",
5712
+ },
5713
+ {
5714
+ internalType: "uint192",
5715
+ name: "__placeholder",
5716
+ type: "uint192",
5717
+ },
5718
+ ],
5719
+ internalType: "struct ITradingStorage.Trade[]",
5720
+ name: "",
5721
+ type: "tuple[]",
5722
+ },
5723
+ ],
5724
+ stateMutability: "view",
5725
+ type: "function",
5726
+ signature: "0x33ea7f74",
5727
+ },
5036
5728
  {
5037
5729
  inputs: [
5038
5730
  {
@@ -5085,6 +5777,63 @@ const _abi = [
5085
5777
  type: "function",
5086
5778
  signature: "0xc2b96e65",
5087
5779
  },
5780
+ {
5781
+ inputs: [
5782
+ {
5783
+ internalType: "address[]",
5784
+ name: "_traders",
5785
+ type: "address[]",
5786
+ },
5787
+ {
5788
+ internalType: "uint256",
5789
+ name: "_offset",
5790
+ type: "uint256",
5791
+ },
5792
+ {
5793
+ internalType: "uint256",
5794
+ name: "_limit",
5795
+ type: "uint256",
5796
+ },
5797
+ ],
5798
+ name: "getAllTradesLiquidationParamsForTraders",
5799
+ outputs: [
5800
+ {
5801
+ components: [
5802
+ {
5803
+ internalType: "uint40",
5804
+ name: "maxLiqSpreadP",
5805
+ type: "uint40",
5806
+ },
5807
+ {
5808
+ internalType: "uint40",
5809
+ name: "startLiqThresholdP",
5810
+ type: "uint40",
5811
+ },
5812
+ {
5813
+ internalType: "uint40",
5814
+ name: "endLiqThresholdP",
5815
+ type: "uint40",
5816
+ },
5817
+ {
5818
+ internalType: "uint24",
5819
+ name: "startLeverage",
5820
+ type: "uint24",
5821
+ },
5822
+ {
5823
+ internalType: "uint24",
5824
+ name: "endLeverage",
5825
+ type: "uint24",
5826
+ },
5827
+ ],
5828
+ internalType: "struct IPairsStorage.GroupLiquidationParams[]",
5829
+ name: "",
5830
+ type: "tuple[]",
5831
+ },
5832
+ ],
5833
+ stateMutability: "view",
5834
+ type: "function",
5835
+ signature: "0x556e838f",
5836
+ },
5088
5837
  {
5089
5838
  inputs: [
5090
5839
  {
@@ -5200,19 +5949,61 @@ const _abi = [
5200
5949
  {
5201
5950
  internalType: "uint8",
5202
5951
  name: "",
5203
- type: "uint8",
5952
+ type: "uint8",
5953
+ },
5954
+ ],
5955
+ stateMutability: "view",
5956
+ type: "function",
5957
+ signature: "0xa3e15d09",
5958
+ },
5959
+ {
5960
+ inputs: [
5961
+ {
5962
+ internalType: "address",
5963
+ name: "_trader",
5964
+ type: "address",
5965
+ },
5966
+ {
5967
+ internalType: "enum ITradingStorage.CounterType",
5968
+ name: "_type",
5969
+ type: "uint8",
5970
+ },
5971
+ ],
5972
+ name: "getCounters",
5973
+ outputs: [
5974
+ {
5975
+ components: [
5976
+ {
5977
+ internalType: "uint32",
5978
+ name: "currentIndex",
5979
+ type: "uint32",
5980
+ },
5981
+ {
5982
+ internalType: "uint32",
5983
+ name: "openCount",
5984
+ type: "uint32",
5985
+ },
5986
+ {
5987
+ internalType: "uint192",
5988
+ name: "__placeholder",
5989
+ type: "uint192",
5990
+ },
5991
+ ],
5992
+ internalType: "struct ITradingStorage.Counter",
5993
+ name: "",
5994
+ type: "tuple",
5204
5995
  },
5205
5996
  ],
5206
5997
  stateMutability: "view",
5207
5998
  type: "function",
5208
- signature: "0xa3e15d09",
5999
+ signature: "0x0212f0d6",
5209
6000
  },
5210
6001
  {
5211
6002
  inputs: [
5212
6003
  {
5213
- internalType: "address",
5214
- name: "_trader",
5215
- type: "address",
6004
+ internalType: "address[]",
6005
+ name: "_traders",
6006
+ type: "address[]",
5216
6007
  },
5217
6008
  {
5218
6009
  internalType: "enum ITradingStorage.CounterType",
@@ -5220,7 +6011,7 @@ const _abi = [
5220
6011
  type: "uint8",
5221
6012
  },
5222
6013
  ],
5223
- name: "getCounters",
6014
+ name: "getCountersForTraders",
5224
6015
  outputs: [
5225
6016
  {
5226
6017
  components: [
@@ -5240,14 +6031,14 @@ const _abi = [
5240
6031
  type: "uint192",
5241
6032
  },
5242
6033
  ],
5243
- internalType: "struct ITradingStorage.Counter",
6034
+ internalType: "struct ITradingStorage.Counter[]",
5244
6035
  name: "",
5245
- type: "tuple",
6036
+ type: "tuple[]",
5246
6037
  },
5247
6038
  ],
5248
6039
  stateMutability: "view",
5249
6040
  type: "function",
5250
- signature: "0x0212f0d6",
6041
+ signature: "0xc1ee6f78",
5251
6042
  },
5252
6043
  {
5253
6044
  inputs: [],
@@ -5908,6 +6699,20 @@ const _abi = [
5908
6699
  type: "function",
5909
6700
  signature: "0x0e503724",
5910
6701
  },
6702
+ {
6703
+ inputs: [],
6704
+ name: "getTradersCount",
6705
+ outputs: [
6706
+ {
6707
+ internalType: "uint256",
6708
+ name: "",
6709
+ type: "uint256",
6710
+ },
6711
+ ],
6712
+ stateMutability: "view",
6713
+ type: "function",
6714
+ signature: "0x32080d60",
6715
+ },
5911
6716
  {
5912
6717
  inputs: [
5913
6718
  {
@@ -6739,12 +7544,17 @@ const _abi = [
6739
7544
  name: "_isPartialIncrease",
6740
7545
  type: "bool",
6741
7546
  },
7547
+ {
7548
+ internalType: "bool",
7549
+ name: "_isPnlPositive",
7550
+ type: "bool",
7551
+ },
6742
7552
  ],
6743
7553
  name: "updateTradePosition",
6744
7554
  outputs: [],
6745
7555
  stateMutability: "nonpayable",
6746
7556
  type: "function",
6747
- signature: "0x72570e24",
7557
+ signature: "0xbb7af8de",
6748
7558
  },
6749
7559
  {
6750
7560
  inputs: [
@@ -7185,7 +7995,7 @@ const _abi = [
7185
7995
  type: "uint16",
7186
7996
  },
7187
7997
  {
7188
- indexed: false,
7998
+ indexed: true,
7189
7999
  internalType: "uint32",
7190
8000
  name: "index",
7191
8001
  type: "uint32",
@@ -7241,13 +8051,13 @@ const _abi = [
7241
8051
  type: "address",
7242
8052
  },
7243
8053
  {
7244
- indexed: true,
8054
+ indexed: false,
7245
8055
  internalType: "uint256",
7246
8056
  name: "pairIndex",
7247
8057
  type: "uint256",
7248
8058
  },
7249
8059
  {
7250
- indexed: false,
8060
+ indexed: true,
7251
8061
  internalType: "uint256",
7252
8062
  name: "index",
7253
8063
  type: "uint256",
@@ -7255,7 +8065,7 @@ const _abi = [
7255
8065
  {
7256
8066
  indexed: false,
7257
8067
  internalType: "uint256",
7258
- name: "marketPrice",
8068
+ name: "oraclePrice",
7259
8069
  type: "uint256",
7260
8070
  },
7261
8071
  {
@@ -7331,7 +8141,7 @@ const _abi = [
7331
8141
  type: "uint256",
7332
8142
  },
7333
8143
  {
7334
- indexed: false,
8144
+ indexed: true,
7335
8145
  internalType: "uint256",
7336
8146
  name: "index",
7337
8147
  type: "uint256",
@@ -7447,7 +8257,7 @@ const _abi = [
7447
8257
  type: "uint16",
7448
8258
  },
7449
8259
  {
7450
- indexed: false,
8260
+ indexed: true,
7451
8261
  internalType: "uint32",
7452
8262
  name: "index",
7453
8263
  type: "uint32",
@@ -7473,7 +8283,7 @@ const _abi = [
7473
8283
  type: "uint16",
7474
8284
  },
7475
8285
  {
7476
- indexed: false,
8286
+ indexed: true,
7477
8287
  internalType: "uint32",
7478
8288
  name: "index",
7479
8289
  type: "uint32",
@@ -7523,7 +8333,7 @@ const _abi = [
7523
8333
  type: "uint16",
7524
8334
  },
7525
8335
  {
7526
- indexed: false,
8336
+ indexed: true,
7527
8337
  internalType: "uint32",
7528
8338
  name: "index",
7529
8339
  type: "uint32",
@@ -7573,13 +8383,13 @@ const _abi = [
7573
8383
  type: "address",
7574
8384
  },
7575
8385
  {
7576
- indexed: true,
8386
+ indexed: false,
7577
8387
  internalType: "uint256",
7578
8388
  name: "pairIndex",
7579
8389
  type: "uint256",
7580
8390
  },
7581
8391
  {
7582
- indexed: false,
8392
+ indexed: true,
7583
8393
  internalType: "uint256",
7584
8394
  name: "index",
7585
8395
  type: "uint256",
@@ -7593,7 +8403,7 @@ const _abi = [
7593
8403
  {
7594
8404
  indexed: false,
7595
8405
  internalType: "uint256",
7596
- name: "marketPrice",
8406
+ name: "oraclePrice",
7597
8407
  type: "uint256",
7598
8408
  },
7599
8409
  {
@@ -7648,12 +8458,7 @@ const _abi = [
7648
8458
  },
7649
8459
  {
7650
8460
  internalType: "uint256",
7651
- name: "vaultFeeCollateral",
7652
- type: "uint256",
7653
- },
7654
- {
7655
- internalType: "uint256",
7656
- name: "gnsStakingFeeCollateral",
8461
+ name: "closingFeeCollateral",
7657
8462
  type: "uint256",
7658
8463
  },
7659
8464
  {
@@ -7685,7 +8490,7 @@ const _abi = [
7685
8490
  ],
7686
8491
  name: "PositionSizeDecreaseExecuted",
7687
8492
  type: "event",
7688
- signature: "0xe74b50af866d7f8e3577bc959bf73a2690841f0abce22ab0cfb1b1c84122a7d7",
8493
+ signature: "0xd994d286871fe96525f071a7c54e68b1183a4d88ccbf0aef2c527c7374d3d130",
7689
8494
  },
7690
8495
  {
7691
8496
  anonymous: false,
@@ -7727,13 +8532,13 @@ const _abi = [
7727
8532
  type: "address",
7728
8533
  },
7729
8534
  {
7730
- indexed: true,
8535
+ indexed: false,
7731
8536
  internalType: "uint256",
7732
8537
  name: "pairIndex",
7733
8538
  type: "uint256",
7734
8539
  },
7735
8540
  {
7736
- indexed: false,
8541
+ indexed: true,
7737
8542
  internalType: "uint256",
7738
8543
  name: "index",
7739
8544
  type: "uint256",
@@ -7747,7 +8552,7 @@ const _abi = [
7747
8552
  {
7748
8553
  indexed: false,
7749
8554
  internalType: "uint256",
7750
- name: "marketPrice",
8555
+ name: "oraclePrice",
7751
8556
  type: "uint256",
7752
8557
  },
7753
8558
  {
@@ -7875,7 +8680,7 @@ const _abi = [
7875
8680
  type: "uint256",
7876
8681
  },
7877
8682
  {
7878
- indexed: false,
8683
+ indexed: true,
7879
8684
  internalType: "uint256",
7880
8685
  name: "index",
7881
8686
  type: "uint256",
@@ -8559,6 +9364,12 @@ const _abi = [
8559
9364
  name: "trader",
8560
9365
  type: "address",
8561
9366
  },
9367
+ {
9368
+ indexed: true,
9369
+ internalType: "uint32",
9370
+ name: "index",
9371
+ type: "uint32",
9372
+ },
8562
9373
  {
8563
9374
  indexed: true,
8564
9375
  internalType: "uint8",
@@ -8574,7 +9385,7 @@ const _abi = [
8574
9385
  ],
8575
9386
  name: "BorrowingFeeCharged",
8576
9387
  type: "event",
8577
- signature: "0x2aac04047becf1d92defe3c1ee644bdd7b50ae634a7e5ebfca84c2be3fc63344",
9388
+ signature: "0xe51bd3297a1287c8baca0874d5647413ea766784f1ae76f8519801bb9f1a14fd",
8578
9389
  },
8579
9390
  {
8580
9391
  anonymous: false,
@@ -8624,9 +9435,9 @@ const _abi = [
8624
9435
  type: "uint256",
8625
9436
  },
8626
9437
  ],
8627
- name: "GnsStakingFeeCharged",
9438
+ name: "GnsOtcFeeCharged",
8628
9439
  type: "event",
8629
- signature: "0x8e4c272f039ef17bb8cb5a5bc5d6f0cebf9c5037dceae9528bb05b0c4f5a7b80",
9440
+ signature: "0x5c36283cfd2f38afd723e604b61c6c61b55515e5cb93e863fbe4df53bf81d4ac",
8630
9441
  },
8631
9442
  {
8632
9443
  anonymous: false,
@@ -8675,6 +9486,24 @@ const _abi = [
8675
9486
  name: "orderId",
8676
9487
  type: "tuple",
8677
9488
  },
9489
+ {
9490
+ indexed: true,
9491
+ internalType: "address",
9492
+ name: "user",
9493
+ type: "address",
9494
+ },
9495
+ {
9496
+ indexed: true,
9497
+ internalType: "uint32",
9498
+ name: "index",
9499
+ type: "uint32",
9500
+ },
9501
+ {
9502
+ indexed: true,
9503
+ internalType: "uint32",
9504
+ name: "limitIndex",
9505
+ type: "uint32",
9506
+ },
8678
9507
  {
8679
9508
  components: [
8680
9509
  {
@@ -8749,7 +9578,7 @@ const _abi = [
8749
9578
  type: "tuple",
8750
9579
  },
8751
9580
  {
8752
- indexed: true,
9581
+ indexed: false,
8753
9582
  internalType: "address",
8754
9583
  name: "triggerCaller",
8755
9584
  type: "address",
@@ -8763,7 +9592,19 @@ const _abi = [
8763
9592
  {
8764
9593
  indexed: false,
8765
9594
  internalType: "uint256",
8766
- name: "price",
9595
+ name: "oraclePrice",
9596
+ type: "uint256",
9597
+ },
9598
+ {
9599
+ indexed: false,
9600
+ internalType: "uint256",
9601
+ name: "marketPrice",
9602
+ type: "uint256",
9603
+ },
9604
+ {
9605
+ indexed: false,
9606
+ internalType: "uint256",
9607
+ name: "liqPrice",
8767
9608
  type: "uint256",
8768
9609
  },
8769
9610
  {
@@ -8799,7 +9640,7 @@ const _abi = [
8799
9640
  ],
8800
9641
  name: "LimitExecuted",
8801
9642
  type: "event",
8802
- signature: "0xc10f67c0e22c53149183a414c16a62334103432a2c48b839a057cd9bd5fdeb99",
9643
+ signature: "0x33b71dccfeb2f3e0f4ed2a9f7c05255d8c5aa57936b542245a5e63c938301597",
8803
9644
  },
8804
9645
  {
8805
9646
  anonymous: false,
@@ -8835,7 +9676,7 @@ const _abi = [
8835
9676
  type: "uint256",
8836
9677
  },
8837
9678
  {
8838
- indexed: false,
9679
+ indexed: true,
8839
9680
  internalType: "uint256",
8840
9681
  name: "index",
8841
9682
  type: "uint256",
@@ -8872,6 +9713,18 @@ const _abi = [
8872
9713
  name: "orderId",
8873
9714
  type: "tuple",
8874
9715
  },
9716
+ {
9717
+ indexed: true,
9718
+ internalType: "address",
9719
+ name: "user",
9720
+ type: "address",
9721
+ },
9722
+ {
9723
+ indexed: true,
9724
+ internalType: "uint32",
9725
+ name: "index",
9726
+ type: "uint32",
9727
+ },
8875
9728
  {
8876
9729
  components: [
8877
9730
  {
@@ -8953,9 +9806,21 @@ const _abi = [
8953
9806
  },
8954
9807
  {
8955
9808
  indexed: false,
8956
- internalType: "uint64",
8957
- name: "price",
8958
- type: "uint64",
9809
+ internalType: "uint256",
9810
+ name: "oraclePrice",
9811
+ type: "uint256",
9812
+ },
9813
+ {
9814
+ indexed: false,
9815
+ internalType: "uint256",
9816
+ name: "marketPrice",
9817
+ type: "uint256",
9818
+ },
9819
+ {
9820
+ indexed: false,
9821
+ internalType: "uint256",
9822
+ name: "liqPrice",
9823
+ type: "uint256",
8959
9824
  },
8960
9825
  {
8961
9826
  indexed: false,
@@ -8984,7 +9849,7 @@ const _abi = [
8984
9849
  ],
8985
9850
  name: "MarketExecuted",
8986
9851
  type: "event",
8987
- signature: "0xbbd5cfa7b4ec0d44d4155fcaad32af9cf7e65799d6b8b08f233b930de7bcd9a8",
9852
+ signature: "0x26d428c63a1c5161a75dbe15e1e65bc7bf932acb203db2a47df55b16a60d35b1",
8988
9853
  },
8989
9854
  {
8990
9855
  anonymous: false,
@@ -9506,6 +10371,20 @@ const _abi = [
9506
10371
  type: "function",
9507
10372
  signature: "0xec98ec83",
9508
10373
  },
10374
+ {
10375
+ inputs: [
10376
+ {
10377
+ internalType: "address",
10378
+ name: "_treasury",
10379
+ type: "address",
10380
+ },
10381
+ ],
10382
+ name: "initializeTreasuryAddress",
10383
+ outputs: [],
10384
+ stateMutability: "nonpayable",
10385
+ type: "function",
10386
+ signature: "0x63a21e54",
10387
+ },
9509
10388
  {
9510
10389
  inputs: [
9511
10390
  {
@@ -9622,6 +10501,20 @@ const _abi = [
9622
10501
  type: "function",
9623
10502
  signature: "0x92dd2940",
9624
10503
  },
10504
+ {
10505
+ inputs: [
10506
+ {
10507
+ internalType: "address",
10508
+ name: "_treasury",
10509
+ type: "address",
10510
+ },
10511
+ ],
10512
+ name: "updateTreasuryAddress",
10513
+ outputs: [],
10514
+ stateMutability: "nonpayable",
10515
+ type: "function",
10516
+ signature: "0x841e4561",
10517
+ },
9625
10518
  {
9626
10519
  inputs: [
9627
10520
  {
@@ -9757,16 +10650,6 @@ const _abi = [
9757
10650
  },
9758
10651
  {
9759
10652
  components: [
9760
- {
9761
- internalType: "uint256",
9762
- name: "positionSizeCollateral",
9763
- type: "uint256",
9764
- },
9765
- {
9766
- internalType: "uint256",
9767
- name: "gnsPriceCollateral",
9768
- type: "uint256",
9769
- },
9770
10653
  {
9771
10654
  internalType: "int256",
9772
10655
  name: "profitP",
@@ -9787,26 +10670,6 @@ const _abi = [
9787
10670
  name: "amountSentToTrader",
9788
10671
  type: "uint256",
9789
10672
  },
9790
- {
9791
- internalType: "uint256",
9792
- name: "reward1",
9793
- type: "uint256",
9794
- },
9795
- {
9796
- internalType: "uint256",
9797
- name: "reward2",
9798
- type: "uint256",
9799
- },
9800
- {
9801
- internalType: "uint256",
9802
- name: "reward3",
9803
- type: "uint256",
9804
- },
9805
- {
9806
- internalType: "uint128",
9807
- name: "collateralPrecisionDelta",
9808
- type: "uint128",
9809
- },
9810
10673
  {
9811
10674
  internalType: "uint256",
9812
10675
  name: "collateralPriceUsd",
@@ -9819,17 +10682,22 @@ const _abi = [
9819
10682
  },
9820
10683
  {
9821
10684
  internalType: "uint256",
9822
- name: "closingFeeCollateral",
10685
+ name: "collateralLeftInStorage",
9823
10686
  type: "uint256",
9824
10687
  },
9825
10688
  {
9826
10689
  internalType: "uint256",
9827
- name: "triggerFeeCollateral",
10690
+ name: "oraclePrice",
9828
10691
  type: "uint256",
9829
10692
  },
10693
+ {
10694
+ internalType: "uint32",
10695
+ name: "limitIndex",
10696
+ type: "uint32",
10697
+ },
9830
10698
  {
9831
10699
  internalType: "uint256",
9832
- name: "collateralLeftInStorage",
10700
+ name: "priceImpactP",
9833
10701
  type: "uint256",
9834
10702
  },
9835
10703
  ],
@@ -9837,11 +10705,6 @@ const _abi = [
9837
10705
  name: "v",
9838
10706
  type: "tuple",
9839
10707
  },
9840
- {
9841
- internalType: "uint256",
9842
- name: "priceImpactP",
9843
- type: "uint256",
9844
- },
9845
10708
  ],
9846
10709
  stateMutability: "view",
9847
10710
  type: "function",
@@ -9967,19 +10830,61 @@ const _abi = [
9967
10830
  type: "uint8",
9968
10831
  },
9969
10832
  {
9970
- internalType: "uint256",
9971
- name: "priceImpactP",
9972
- type: "uint256",
9973
- },
9974
- {
9975
- internalType: "uint256",
9976
- name: "priceAfterImpact",
9977
- type: "uint256",
9978
- },
9979
- {
9980
- internalType: "bool",
9981
- name: "exactExecution",
9982
- type: "bool",
10833
+ components: [
10834
+ {
10835
+ internalType: "int256",
10836
+ name: "profitP",
10837
+ type: "int256",
10838
+ },
10839
+ {
10840
+ internalType: "uint256",
10841
+ name: "executionPrice",
10842
+ type: "uint256",
10843
+ },
10844
+ {
10845
+ internalType: "uint256",
10846
+ name: "liqPrice",
10847
+ type: "uint256",
10848
+ },
10849
+ {
10850
+ internalType: "uint256",
10851
+ name: "amountSentToTrader",
10852
+ type: "uint256",
10853
+ },
10854
+ {
10855
+ internalType: "uint256",
10856
+ name: "collateralPriceUsd",
10857
+ type: "uint256",
10858
+ },
10859
+ {
10860
+ internalType: "bool",
10861
+ name: "exactExecution",
10862
+ type: "bool",
10863
+ },
10864
+ {
10865
+ internalType: "uint256",
10866
+ name: "collateralLeftInStorage",
10867
+ type: "uint256",
10868
+ },
10869
+ {
10870
+ internalType: "uint256",
10871
+ name: "oraclePrice",
10872
+ type: "uint256",
10873
+ },
10874
+ {
10875
+ internalType: "uint32",
10876
+ name: "limitIndex",
10877
+ type: "uint32",
10878
+ },
10879
+ {
10880
+ internalType: "uint256",
10881
+ name: "priceImpactP",
10882
+ type: "uint256",
10883
+ },
10884
+ ],
10885
+ internalType: "struct ITradingCallbacks.Values",
10886
+ name: "v",
10887
+ type: "tuple",
9983
10888
  },
9984
10889
  ],
9985
10890
  stateMutability: "view",