@gainsnetwork/sdk 0.2.12-rc1 → 0.2.12-rc11
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.
- package/lib/constants.d.ts +4 -0
- package/lib/constants.js +5 -1
- package/lib/contracts/types/generated/GNSMultiCollatDiamond.d.ts +349 -175
- package/lib/contracts/types/generated/factories/GNSMultiCollatDiamond__factory.d.ts +63 -22
- package/lib/contracts/types/generated/factories/GNSMultiCollatDiamond__factory.js +787 -308
- package/lib/contracts/types/index.d.ts +4 -0
- package/lib/contracts/types/index.js +6 -1
- package/lib/contracts/utils/openTrades.js +5 -3
- package/lib/contracts/utils/pairs.d.ts +0 -1
- package/lib/contracts/utils/pairs.js +5 -18
- package/lib/trade/fees/index.d.ts +1 -1
- package/lib/trade/fees/index.js +6 -3
- package/lib/trade/liquidation.d.ts +10 -2
- package/lib/trade/liquidation.js +38 -4
- package/lib/trade/pnl.d.ts +5 -2
- package/lib/trade/pnl.js +6 -3
- package/lib/trade/spread.d.ts +5 -1
- package/lib/trade/spread.js +23 -3
- package/lib/trade/types.d.ts +12 -1
- package/lib/trade/types.js +4 -0
- package/package.json +1 -1
|
@@ -132,6 +132,11 @@ const _abi = [
|
|
|
132
132
|
name: "WrongOrder",
|
|
133
133
|
type: "error",
|
|
134
134
|
},
|
|
135
|
+
{
|
|
136
|
+
inputs: [],
|
|
137
|
+
name: "WrongOrderType",
|
|
138
|
+
type: "error",
|
|
139
|
+
},
|
|
135
140
|
{
|
|
136
141
|
inputs: [],
|
|
137
142
|
name: "WrongParams",
|
|
@@ -607,14 +612,14 @@ const _abi = [
|
|
|
607
612
|
type: "uint40",
|
|
608
613
|
},
|
|
609
614
|
{
|
|
610
|
-
internalType: "
|
|
615
|
+
internalType: "uint40",
|
|
611
616
|
name: "startLiqThresholdP",
|
|
612
|
-
type: "
|
|
617
|
+
type: "uint40",
|
|
613
618
|
},
|
|
614
619
|
{
|
|
615
|
-
internalType: "
|
|
620
|
+
internalType: "uint40",
|
|
616
621
|
name: "endLiqThresholdP",
|
|
617
|
-
type: "
|
|
622
|
+
type: "uint40",
|
|
618
623
|
},
|
|
619
624
|
{
|
|
620
625
|
internalType: "uint24",
|
|
@@ -635,7 +640,7 @@ const _abi = [
|
|
|
635
640
|
],
|
|
636
641
|
name: "GroupLiquidationParamsUpdated",
|
|
637
642
|
type: "event",
|
|
638
|
-
signature: "
|
|
643
|
+
signature: "0x7e8e79d406657a52635b68c3f3ad15d2526e71077df1b40afad9d323eacbabfc",
|
|
639
644
|
},
|
|
640
645
|
{
|
|
641
646
|
anonymous: false,
|
|
@@ -959,14 +964,14 @@ const _abi = [
|
|
|
959
964
|
type: "uint40",
|
|
960
965
|
},
|
|
961
966
|
{
|
|
962
|
-
internalType: "
|
|
967
|
+
internalType: "uint40",
|
|
963
968
|
name: "startLiqThresholdP",
|
|
964
|
-
type: "
|
|
969
|
+
type: "uint40",
|
|
965
970
|
},
|
|
966
971
|
{
|
|
967
|
-
internalType: "
|
|
972
|
+
internalType: "uint40",
|
|
968
973
|
name: "endLiqThresholdP",
|
|
969
|
-
type: "
|
|
974
|
+
type: "uint40",
|
|
970
975
|
},
|
|
971
976
|
{
|
|
972
977
|
internalType: "uint24",
|
|
@@ -1006,14 +1011,14 @@ const _abi = [
|
|
|
1006
1011
|
type: "uint40",
|
|
1007
1012
|
},
|
|
1008
1013
|
{
|
|
1009
|
-
internalType: "
|
|
1014
|
+
internalType: "uint40",
|
|
1010
1015
|
name: "startLiqThresholdP",
|
|
1011
|
-
type: "
|
|
1016
|
+
type: "uint40",
|
|
1012
1017
|
},
|
|
1013
1018
|
{
|
|
1014
|
-
internalType: "
|
|
1019
|
+
internalType: "uint40",
|
|
1015
1020
|
name: "endLiqThresholdP",
|
|
1016
|
-
type: "
|
|
1021
|
+
type: "uint40",
|
|
1017
1022
|
},
|
|
1018
1023
|
{
|
|
1019
1024
|
internalType: "uint24",
|
|
@@ -1101,14 +1106,14 @@ const _abi = [
|
|
|
1101
1106
|
type: "uint40",
|
|
1102
1107
|
},
|
|
1103
1108
|
{
|
|
1104
|
-
internalType: "
|
|
1109
|
+
internalType: "uint40",
|
|
1105
1110
|
name: "startLiqThresholdP",
|
|
1106
|
-
type: "
|
|
1111
|
+
type: "uint40",
|
|
1107
1112
|
},
|
|
1108
1113
|
{
|
|
1109
|
-
internalType: "
|
|
1114
|
+
internalType: "uint40",
|
|
1110
1115
|
name: "endLiqThresholdP",
|
|
1111
|
-
type: "
|
|
1116
|
+
type: "uint40",
|
|
1112
1117
|
},
|
|
1113
1118
|
{
|
|
1114
1119
|
internalType: "uint24",
|
|
@@ -1130,7 +1135,7 @@ const _abi = [
|
|
|
1130
1135
|
outputs: [],
|
|
1131
1136
|
stateMutability: "nonpayable",
|
|
1132
1137
|
type: "function",
|
|
1133
|
-
signature: "
|
|
1138
|
+
signature: "0x85d4390e",
|
|
1134
1139
|
},
|
|
1135
1140
|
{
|
|
1136
1141
|
inputs: [
|
|
@@ -1643,14 +1648,14 @@ const _abi = [
|
|
|
1643
1648
|
type: "uint40",
|
|
1644
1649
|
},
|
|
1645
1650
|
{
|
|
1646
|
-
internalType: "
|
|
1651
|
+
internalType: "uint40",
|
|
1647
1652
|
name: "startLiqThresholdP",
|
|
1648
|
-
type: "
|
|
1653
|
+
type: "uint40",
|
|
1649
1654
|
},
|
|
1650
1655
|
{
|
|
1651
|
-
internalType: "
|
|
1656
|
+
internalType: "uint40",
|
|
1652
1657
|
name: "endLiqThresholdP",
|
|
1653
|
-
type: "
|
|
1658
|
+
type: "uint40",
|
|
1654
1659
|
},
|
|
1655
1660
|
{
|
|
1656
1661
|
internalType: "uint24",
|
|
@@ -1672,7 +1677,7 @@ const _abi = [
|
|
|
1672
1677
|
outputs: [],
|
|
1673
1678
|
stateMutability: "nonpayable",
|
|
1674
1679
|
type: "function",
|
|
1675
|
-
signature: "
|
|
1680
|
+
signature: "0xd0cb753e",
|
|
1676
1681
|
},
|
|
1677
1682
|
{
|
|
1678
1683
|
inputs: [
|
|
@@ -3096,6 +3101,26 @@ const _abi = [
|
|
|
3096
3101
|
name: "WrongWindowsDuration",
|
|
3097
3102
|
type: "error",
|
|
3098
3103
|
},
|
|
3104
|
+
{
|
|
3105
|
+
anonymous: false,
|
|
3106
|
+
inputs: [
|
|
3107
|
+
{
|
|
3108
|
+
indexed: true,
|
|
3109
|
+
internalType: "uint256",
|
|
3110
|
+
name: "pairIndex",
|
|
3111
|
+
type: "uint256",
|
|
3112
|
+
},
|
|
3113
|
+
{
|
|
3114
|
+
indexed: false,
|
|
3115
|
+
internalType: "uint40",
|
|
3116
|
+
name: "cumulativeFactor",
|
|
3117
|
+
type: "uint40",
|
|
3118
|
+
},
|
|
3119
|
+
],
|
|
3120
|
+
name: "CumulativeFactorUpdated",
|
|
3121
|
+
type: "event",
|
|
3122
|
+
signature: "0x2742ec28d0252b4477106a77a10b04e1c1ecd2b568c7168d56c3a3154d3a3122",
|
|
3123
|
+
},
|
|
3099
3124
|
{
|
|
3100
3125
|
anonymous: false,
|
|
3101
3126
|
inputs: [
|
|
@@ -3241,61 +3266,9 @@ const _abi = [
|
|
|
3241
3266
|
name: "long",
|
|
3242
3267
|
type: "bool",
|
|
3243
3268
|
},
|
|
3244
|
-
{
|
|
3245
|
-
internalType: "uint128",
|
|
3246
|
-
name: "openInterestUsd",
|
|
3247
|
-
type: "uint128",
|
|
3248
|
-
},
|
|
3249
|
-
],
|
|
3250
|
-
indexed: false,
|
|
3251
|
-
internalType: "struct IPriceImpact.OiWindowUpdate",
|
|
3252
|
-
name: "oiWindowUpdate",
|
|
3253
|
-
type: "tuple",
|
|
3254
|
-
},
|
|
3255
|
-
{
|
|
3256
|
-
indexed: false,
|
|
3257
|
-
internalType: "bool",
|
|
3258
|
-
name: "isPartial",
|
|
3259
|
-
type: "bool",
|
|
3260
|
-
},
|
|
3261
|
-
],
|
|
3262
|
-
name: "PriceImpactOpenInterestAdded",
|
|
3263
|
-
type: "event",
|
|
3264
|
-
signature: "0x4ad96f03f62012d64f1a3676413b5a73b13a99eebe005158b124403e3c3ab70d",
|
|
3265
|
-
},
|
|
3266
|
-
{
|
|
3267
|
-
anonymous: false,
|
|
3268
|
-
inputs: [
|
|
3269
|
-
{
|
|
3270
|
-
components: [
|
|
3271
|
-
{
|
|
3272
|
-
internalType: "address",
|
|
3273
|
-
name: "trader",
|
|
3274
|
-
type: "address",
|
|
3275
|
-
},
|
|
3276
|
-
{
|
|
3277
|
-
internalType: "uint32",
|
|
3278
|
-
name: "index",
|
|
3279
|
-
type: "uint32",
|
|
3280
|
-
},
|
|
3281
|
-
{
|
|
3282
|
-
internalType: "uint48",
|
|
3283
|
-
name: "windowsDuration",
|
|
3284
|
-
type: "uint48",
|
|
3285
|
-
},
|
|
3286
|
-
{
|
|
3287
|
-
internalType: "uint256",
|
|
3288
|
-
name: "pairIndex",
|
|
3289
|
-
type: "uint256",
|
|
3290
|
-
},
|
|
3291
|
-
{
|
|
3292
|
-
internalType: "uint256",
|
|
3293
|
-
name: "windowId",
|
|
3294
|
-
type: "uint256",
|
|
3295
|
-
},
|
|
3296
3269
|
{
|
|
3297
3270
|
internalType: "bool",
|
|
3298
|
-
name: "
|
|
3271
|
+
name: "open",
|
|
3299
3272
|
type: "bool",
|
|
3300
3273
|
},
|
|
3301
3274
|
{
|
|
@@ -3309,16 +3282,10 @@ const _abi = [
|
|
|
3309
3282
|
name: "oiWindowUpdate",
|
|
3310
3283
|
type: "tuple",
|
|
3311
3284
|
},
|
|
3312
|
-
{
|
|
3313
|
-
indexed: false,
|
|
3314
|
-
internalType: "bool",
|
|
3315
|
-
name: "notOutdated",
|
|
3316
|
-
type: "bool",
|
|
3317
|
-
},
|
|
3318
3285
|
],
|
|
3319
|
-
name: "
|
|
3286
|
+
name: "PriceImpactOpenInterestAdded",
|
|
3320
3287
|
type: "event",
|
|
3321
|
-
signature: "
|
|
3288
|
+
signature: "0xcca5358ade10271036cf22898f07ad681f9dd7fc3e861da5fc31319c4b890ad4",
|
|
3322
3289
|
},
|
|
3323
3290
|
{
|
|
3324
3291
|
anonymous: false,
|
|
@@ -3351,16 +3318,22 @@ const _abi = [
|
|
|
3351
3318
|
{
|
|
3352
3319
|
anonymous: false,
|
|
3353
3320
|
inputs: [
|
|
3321
|
+
{
|
|
3322
|
+
indexed: true,
|
|
3323
|
+
internalType: "uint256",
|
|
3324
|
+
name: "pairIndex",
|
|
3325
|
+
type: "uint256",
|
|
3326
|
+
},
|
|
3354
3327
|
{
|
|
3355
3328
|
indexed: false,
|
|
3356
|
-
internalType: "
|
|
3329
|
+
internalType: "uint32",
|
|
3357
3330
|
name: "protectionCloseFactorBlocks",
|
|
3358
|
-
type: "
|
|
3331
|
+
type: "uint32",
|
|
3359
3332
|
},
|
|
3360
3333
|
],
|
|
3361
3334
|
name: "ProtectionCloseFactorBlocksUpdated",
|
|
3362
3335
|
type: "event",
|
|
3363
|
-
signature: "
|
|
3336
|
+
signature: "0xd537ef0f85bea3a23f6af53d4c1b29fdc74cdbd3a07a37bfdb76f5368aebd660",
|
|
3364
3337
|
},
|
|
3365
3338
|
{
|
|
3366
3339
|
anonymous: false,
|
|
@@ -3373,14 +3346,14 @@ const _abi = [
|
|
|
3373
3346
|
},
|
|
3374
3347
|
{
|
|
3375
3348
|
indexed: false,
|
|
3376
|
-
internalType: "
|
|
3349
|
+
internalType: "uint40",
|
|
3377
3350
|
name: "protectionCloseFactor",
|
|
3378
|
-
type: "
|
|
3351
|
+
type: "uint40",
|
|
3379
3352
|
},
|
|
3380
3353
|
],
|
|
3381
3354
|
name: "ProtectionCloseFactorUpdated",
|
|
3382
3355
|
type: "event",
|
|
3383
|
-
signature: "
|
|
3356
|
+
signature: "0x471eb2788149a10519cea684f0149db7c6af0e5fa1182f06b50c5420fe95d12a",
|
|
3384
3357
|
},
|
|
3385
3358
|
{
|
|
3386
3359
|
inputs: [
|
|
@@ -3399,12 +3372,17 @@ const _abi = [
|
|
|
3399
3372
|
name: "_oiDeltaCollateral",
|
|
3400
3373
|
type: "uint256",
|
|
3401
3374
|
},
|
|
3375
|
+
{
|
|
3376
|
+
internalType: "bool",
|
|
3377
|
+
name: "_open",
|
|
3378
|
+
type: "bool",
|
|
3379
|
+
},
|
|
3402
3380
|
],
|
|
3403
3381
|
name: "addPriceImpactOpenInterest",
|
|
3404
3382
|
outputs: [],
|
|
3405
3383
|
stateMutability: "nonpayable",
|
|
3406
3384
|
type: "function",
|
|
3407
|
-
signature: "
|
|
3385
|
+
signature: "0x23ce624b",
|
|
3408
3386
|
},
|
|
3409
3387
|
{
|
|
3410
3388
|
inputs: [
|
|
@@ -3585,45 +3563,6 @@ const _abi = [
|
|
|
3585
3563
|
type: "function",
|
|
3586
3564
|
signature: "0x0d569f27",
|
|
3587
3565
|
},
|
|
3588
|
-
{
|
|
3589
|
-
inputs: [
|
|
3590
|
-
{
|
|
3591
|
-
internalType: "uint256",
|
|
3592
|
-
name: "_pairIndex",
|
|
3593
|
-
type: "uint256",
|
|
3594
|
-
},
|
|
3595
|
-
{
|
|
3596
|
-
internalType: "bool",
|
|
3597
|
-
name: "_long",
|
|
3598
|
-
type: "bool",
|
|
3599
|
-
},
|
|
3600
|
-
],
|
|
3601
|
-
name: "getPriceImpactOi",
|
|
3602
|
-
outputs: [
|
|
3603
|
-
{
|
|
3604
|
-
internalType: "uint256",
|
|
3605
|
-
name: "activeOi",
|
|
3606
|
-
type: "uint256",
|
|
3607
|
-
},
|
|
3608
|
-
],
|
|
3609
|
-
stateMutability: "view",
|
|
3610
|
-
type: "function",
|
|
3611
|
-
signature: "0xb6d92b02",
|
|
3612
|
-
},
|
|
3613
|
-
{
|
|
3614
|
-
inputs: [],
|
|
3615
|
-
name: "getProtectionCloseFactorBlocks",
|
|
3616
|
-
outputs: [
|
|
3617
|
-
{
|
|
3618
|
-
internalType: "uint24",
|
|
3619
|
-
name: "",
|
|
3620
|
-
type: "uint24",
|
|
3621
|
-
},
|
|
3622
|
-
],
|
|
3623
|
-
stateMutability: "view",
|
|
3624
|
-
type: "function",
|
|
3625
|
-
signature: "0xa7059886",
|
|
3626
|
-
},
|
|
3627
3566
|
{
|
|
3628
3567
|
inputs: [
|
|
3629
3568
|
{
|
|
@@ -3632,42 +3571,64 @@ const _abi = [
|
|
|
3632
3571
|
type: "uint256[]",
|
|
3633
3572
|
},
|
|
3634
3573
|
],
|
|
3635
|
-
name: "
|
|
3574
|
+
name: "getPairFactors",
|
|
3636
3575
|
outputs: [
|
|
3637
3576
|
{
|
|
3638
|
-
|
|
3577
|
+
components: [
|
|
3578
|
+
{
|
|
3579
|
+
internalType: "uint40",
|
|
3580
|
+
name: "protectionCloseFactor",
|
|
3581
|
+
type: "uint40",
|
|
3582
|
+
},
|
|
3583
|
+
{
|
|
3584
|
+
internalType: "uint32",
|
|
3585
|
+
name: "protectionCloseFactorBlocks",
|
|
3586
|
+
type: "uint32",
|
|
3587
|
+
},
|
|
3588
|
+
{
|
|
3589
|
+
internalType: "uint40",
|
|
3590
|
+
name: "cumulativeFactor",
|
|
3591
|
+
type: "uint40",
|
|
3592
|
+
},
|
|
3593
|
+
{
|
|
3594
|
+
internalType: "uint144",
|
|
3595
|
+
name: "__placeholder",
|
|
3596
|
+
type: "uint144",
|
|
3597
|
+
},
|
|
3598
|
+
],
|
|
3599
|
+
internalType: "struct IPriceImpact.PairFactors[]",
|
|
3639
3600
|
name: "",
|
|
3640
|
-
type: "
|
|
3601
|
+
type: "tuple[]",
|
|
3641
3602
|
},
|
|
3642
3603
|
],
|
|
3643
3604
|
stateMutability: "view",
|
|
3644
3605
|
type: "function",
|
|
3645
|
-
signature: "
|
|
3606
|
+
signature: "0x8db9e2da",
|
|
3646
3607
|
},
|
|
3647
3608
|
{
|
|
3648
3609
|
inputs: [
|
|
3649
3610
|
{
|
|
3650
|
-
internalType: "
|
|
3651
|
-
name: "
|
|
3652
|
-
type: "
|
|
3611
|
+
internalType: "uint256",
|
|
3612
|
+
name: "_pairIndex",
|
|
3613
|
+
type: "uint256",
|
|
3653
3614
|
},
|
|
3654
3615
|
{
|
|
3655
|
-
internalType: "
|
|
3656
|
-
name: "
|
|
3657
|
-
type: "
|
|
3616
|
+
internalType: "bool",
|
|
3617
|
+
name: "_long",
|
|
3618
|
+
type: "bool",
|
|
3658
3619
|
},
|
|
3659
3620
|
],
|
|
3660
|
-
name: "
|
|
3621
|
+
name: "getPriceImpactOi",
|
|
3661
3622
|
outputs: [
|
|
3662
3623
|
{
|
|
3663
|
-
internalType: "
|
|
3664
|
-
name: "",
|
|
3665
|
-
type: "
|
|
3624
|
+
internalType: "uint256",
|
|
3625
|
+
name: "activeOi",
|
|
3626
|
+
type: "uint256",
|
|
3666
3627
|
},
|
|
3667
3628
|
],
|
|
3668
3629
|
stateMutability: "view",
|
|
3669
3630
|
type: "function",
|
|
3670
|
-
signature: "
|
|
3631
|
+
signature: "0xb6d92b02",
|
|
3671
3632
|
},
|
|
3672
3633
|
{
|
|
3673
3634
|
inputs: [
|
|
@@ -3703,9 +3664,14 @@ const _abi = [
|
|
|
3703
3664
|
},
|
|
3704
3665
|
{
|
|
3705
3666
|
internalType: "uint256",
|
|
3706
|
-
name: "
|
|
3667
|
+
name: "_lastPosIncreaseBlock",
|
|
3707
3668
|
type: "uint256",
|
|
3708
3669
|
},
|
|
3670
|
+
{
|
|
3671
|
+
internalType: "enum ITradingStorage.ContractsVersion",
|
|
3672
|
+
name: "_contractsVersion",
|
|
3673
|
+
type: "uint8",
|
|
3674
|
+
},
|
|
3709
3675
|
],
|
|
3710
3676
|
name: "getTradePriceImpact",
|
|
3711
3677
|
outputs: [
|
|
@@ -3722,44 +3688,36 @@ const _abi = [
|
|
|
3722
3688
|
],
|
|
3723
3689
|
stateMutability: "view",
|
|
3724
3690
|
type: "function",
|
|
3725
|
-
signature: "
|
|
3691
|
+
signature: "0xdd5ef6f1",
|
|
3726
3692
|
},
|
|
3727
3693
|
{
|
|
3728
3694
|
inputs: [
|
|
3729
3695
|
{
|
|
3730
|
-
internalType: "
|
|
3731
|
-
name: "
|
|
3732
|
-
type: "
|
|
3696
|
+
internalType: "uint16[]",
|
|
3697
|
+
name: "_pairIndices",
|
|
3698
|
+
type: "uint16[]",
|
|
3733
3699
|
},
|
|
3734
3700
|
{
|
|
3735
|
-
internalType: "
|
|
3736
|
-
name: "
|
|
3737
|
-
type: "
|
|
3701
|
+
internalType: "uint40[]",
|
|
3702
|
+
name: "_protectionCloseFactors",
|
|
3703
|
+
type: "uint40[]",
|
|
3738
3704
|
},
|
|
3739
|
-
],
|
|
3740
|
-
name: "getTradePriceImpactInfo",
|
|
3741
|
-
outputs: [
|
|
3742
3705
|
{
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
name: "__placeholder",
|
|
3752
|
-
type: "uint128",
|
|
3753
|
-
},
|
|
3754
|
-
],
|
|
3755
|
-
internalType: "struct IPriceImpact.TradePriceImpactInfo",
|
|
3756
|
-
name: "",
|
|
3757
|
-
type: "tuple",
|
|
3706
|
+
internalType: "uint32[]",
|
|
3707
|
+
name: "_protectionCloseFactorBlocks",
|
|
3708
|
+
type: "uint32[]",
|
|
3709
|
+
},
|
|
3710
|
+
{
|
|
3711
|
+
internalType: "uint40[]",
|
|
3712
|
+
name: "_cumulativeFactors",
|
|
3713
|
+
type: "uint40[]",
|
|
3758
3714
|
},
|
|
3759
3715
|
],
|
|
3760
|
-
|
|
3716
|
+
name: "initializePairFactors",
|
|
3717
|
+
outputs: [],
|
|
3718
|
+
stateMutability: "nonpayable",
|
|
3761
3719
|
type: "function",
|
|
3762
|
-
signature: "
|
|
3720
|
+
signature: "0x3d7e587a",
|
|
3763
3721
|
},
|
|
3764
3722
|
{
|
|
3765
3723
|
inputs: [
|
|
@@ -3783,40 +3741,21 @@ const _abi = [
|
|
|
3783
3741
|
{
|
|
3784
3742
|
inputs: [
|
|
3785
3743
|
{
|
|
3786
|
-
internalType: "
|
|
3787
|
-
name: "
|
|
3788
|
-
type: "
|
|
3744
|
+
internalType: "uint16[]",
|
|
3745
|
+
name: "_pairIndices",
|
|
3746
|
+
type: "uint16[]",
|
|
3747
|
+
},
|
|
3748
|
+
{
|
|
3749
|
+
internalType: "uint40[]",
|
|
3750
|
+
name: "_cumulativeFactors",
|
|
3751
|
+
type: "uint40[]",
|
|
3789
3752
|
},
|
|
3790
3753
|
],
|
|
3791
|
-
name: "
|
|
3754
|
+
name: "setCumulativeFactors",
|
|
3792
3755
|
outputs: [],
|
|
3793
3756
|
stateMutability: "nonpayable",
|
|
3794
3757
|
type: "function",
|
|
3795
|
-
signature: "
|
|
3796
|
-
},
|
|
3797
|
-
{
|
|
3798
|
-
inputs: [
|
|
3799
|
-
{
|
|
3800
|
-
internalType: "address",
|
|
3801
|
-
name: "_trader",
|
|
3802
|
-
type: "address",
|
|
3803
|
-
},
|
|
3804
|
-
{
|
|
3805
|
-
internalType: "uint32",
|
|
3806
|
-
name: "_index",
|
|
3807
|
-
type: "uint32",
|
|
3808
|
-
},
|
|
3809
|
-
{
|
|
3810
|
-
internalType: "uint256",
|
|
3811
|
-
name: "_oiDeltaCollateral",
|
|
3812
|
-
type: "uint256",
|
|
3813
|
-
},
|
|
3814
|
-
],
|
|
3815
|
-
name: "removePriceImpactOpenInterest",
|
|
3816
|
-
outputs: [],
|
|
3817
|
-
stateMutability: "nonpayable",
|
|
3818
|
-
type: "function",
|
|
3819
|
-
signature: "0x2f29a9e8",
|
|
3758
|
+
signature: "0xa7d518fc",
|
|
3820
3759
|
},
|
|
3821
3760
|
{
|
|
3822
3761
|
inputs: [
|
|
@@ -3873,16 +3812,21 @@ const _abi = [
|
|
|
3873
3812
|
{
|
|
3874
3813
|
inputs: [
|
|
3875
3814
|
{
|
|
3876
|
-
internalType: "
|
|
3815
|
+
internalType: "uint16[]",
|
|
3816
|
+
name: "_pairIndices",
|
|
3817
|
+
type: "uint16[]",
|
|
3818
|
+
},
|
|
3819
|
+
{
|
|
3820
|
+
internalType: "uint32[]",
|
|
3877
3821
|
name: "_protectionCloseFactorBlocks",
|
|
3878
|
-
type: "
|
|
3822
|
+
type: "uint32[]",
|
|
3879
3823
|
},
|
|
3880
3824
|
],
|
|
3881
3825
|
name: "setProtectionCloseFactorBlocks",
|
|
3882
3826
|
outputs: [],
|
|
3883
3827
|
stateMutability: "nonpayable",
|
|
3884
3828
|
type: "function",
|
|
3885
|
-
signature: "
|
|
3829
|
+
signature: "0x2a4cde4a",
|
|
3886
3830
|
},
|
|
3887
3831
|
{
|
|
3888
3832
|
inputs: [
|
|
@@ -3892,16 +3836,16 @@ const _abi = [
|
|
|
3892
3836
|
type: "uint16[]",
|
|
3893
3837
|
},
|
|
3894
3838
|
{
|
|
3895
|
-
internalType: "
|
|
3839
|
+
internalType: "uint40[]",
|
|
3896
3840
|
name: "_protectionCloseFactors",
|
|
3897
|
-
type: "
|
|
3841
|
+
type: "uint40[]",
|
|
3898
3842
|
},
|
|
3899
3843
|
],
|
|
3900
3844
|
name: "setProtectionCloseFactors",
|
|
3901
3845
|
outputs: [],
|
|
3902
3846
|
stateMutability: "nonpayable",
|
|
3903
3847
|
type: "function",
|
|
3904
|
-
signature: "
|
|
3848
|
+
signature: "0xef0243dc",
|
|
3905
3849
|
},
|
|
3906
3850
|
{
|
|
3907
3851
|
inputs: [],
|
|
@@ -4291,6 +4235,38 @@ const _abi = [
|
|
|
4291
4235
|
type: "event",
|
|
4292
4236
|
signature: "0xce228a7b1b8e239798e94cb2ba581d57501692fc1d29719a891125f1f393826d",
|
|
4293
4237
|
},
|
|
4238
|
+
{
|
|
4239
|
+
anonymous: false,
|
|
4240
|
+
inputs: [
|
|
4241
|
+
{
|
|
4242
|
+
components: [
|
|
4243
|
+
{
|
|
4244
|
+
internalType: "address",
|
|
4245
|
+
name: "user",
|
|
4246
|
+
type: "address",
|
|
4247
|
+
},
|
|
4248
|
+
{
|
|
4249
|
+
internalType: "uint32",
|
|
4250
|
+
name: "index",
|
|
4251
|
+
type: "uint32",
|
|
4252
|
+
},
|
|
4253
|
+
],
|
|
4254
|
+
indexed: false,
|
|
4255
|
+
internalType: "struct ITradingStorage.Id",
|
|
4256
|
+
name: "tradeId",
|
|
4257
|
+
type: "tuple",
|
|
4258
|
+
},
|
|
4259
|
+
{
|
|
4260
|
+
indexed: false,
|
|
4261
|
+
internalType: "uint16",
|
|
4262
|
+
name: "maxClosingSlippageP",
|
|
4263
|
+
type: "uint16",
|
|
4264
|
+
},
|
|
4265
|
+
],
|
|
4266
|
+
name: "TradeMaxClosingSlippagePUpdated",
|
|
4267
|
+
type: "event",
|
|
4268
|
+
signature: "0xb34e0065c48018b4a48b78c4729fd9ffd1968c59d6532e600c4afb42ce093da1",
|
|
4269
|
+
},
|
|
4294
4270
|
{
|
|
4295
4271
|
anonymous: false,
|
|
4296
4272
|
inputs: [
|
|
@@ -4342,10 +4318,16 @@ const _abi = [
|
|
|
4342
4318
|
name: "newSl",
|
|
4343
4319
|
type: "uint64",
|
|
4344
4320
|
},
|
|
4321
|
+
{
|
|
4322
|
+
indexed: false,
|
|
4323
|
+
internalType: "bool",
|
|
4324
|
+
name: "isPartialIncrease",
|
|
4325
|
+
type: "bool",
|
|
4326
|
+
},
|
|
4345
4327
|
],
|
|
4346
4328
|
name: "TradePositionUpdated",
|
|
4347
4329
|
type: "event",
|
|
4348
|
-
signature: "
|
|
4330
|
+
signature: "0x3890801c6f1ea37e9eb6aaae6cb1e57eeb8fe67e3af47b2533ff1fc4d1031ede",
|
|
4349
4331
|
},
|
|
4350
4332
|
{
|
|
4351
4333
|
anonymous: false,
|
|
@@ -4488,9 +4470,19 @@ const _abi = [
|
|
|
4488
4470
|
type: "uint48",
|
|
4489
4471
|
},
|
|
4490
4472
|
{
|
|
4491
|
-
internalType: "
|
|
4473
|
+
internalType: "enum ITradingStorage.ContractsVersion",
|
|
4474
|
+
name: "contractsVersion",
|
|
4475
|
+
type: "uint8",
|
|
4476
|
+
},
|
|
4477
|
+
{
|
|
4478
|
+
internalType: "uint32",
|
|
4479
|
+
name: "lastPosIncreaseBlock",
|
|
4480
|
+
type: "uint32",
|
|
4481
|
+
},
|
|
4482
|
+
{
|
|
4483
|
+
internalType: "uint8",
|
|
4492
4484
|
name: "__placeholder",
|
|
4493
|
-
type: "
|
|
4485
|
+
type: "uint8",
|
|
4494
4486
|
},
|
|
4495
4487
|
],
|
|
4496
4488
|
indexed: false,
|
|
@@ -4506,14 +4498,14 @@ const _abi = [
|
|
|
4506
4498
|
type: "uint40",
|
|
4507
4499
|
},
|
|
4508
4500
|
{
|
|
4509
|
-
internalType: "
|
|
4501
|
+
internalType: "uint40",
|
|
4510
4502
|
name: "startLiqThresholdP",
|
|
4511
|
-
type: "
|
|
4503
|
+
type: "uint40",
|
|
4512
4504
|
},
|
|
4513
4505
|
{
|
|
4514
|
-
internalType: "
|
|
4506
|
+
internalType: "uint40",
|
|
4515
4507
|
name: "endLiqThresholdP",
|
|
4516
|
-
type: "
|
|
4508
|
+
type: "uint40",
|
|
4517
4509
|
},
|
|
4518
4510
|
{
|
|
4519
4511
|
internalType: "uint24",
|
|
@@ -4534,7 +4526,7 @@ const _abi = [
|
|
|
4534
4526
|
],
|
|
4535
4527
|
name: "TradeStored",
|
|
4536
4528
|
type: "event",
|
|
4537
|
-
signature: "
|
|
4529
|
+
signature: "0xb4c8599e992aeeb8f86e02eaee1061646ddf10a354b91f1daa776eb4595387a3",
|
|
4538
4530
|
},
|
|
4539
4531
|
{
|
|
4540
4532
|
anonymous: false,
|
|
@@ -4830,9 +4822,19 @@ const _abi = [
|
|
|
4830
4822
|
type: "uint48",
|
|
4831
4823
|
},
|
|
4832
4824
|
{
|
|
4833
|
-
internalType: "
|
|
4825
|
+
internalType: "enum ITradingStorage.ContractsVersion",
|
|
4826
|
+
name: "contractsVersion",
|
|
4827
|
+
type: "uint8",
|
|
4828
|
+
},
|
|
4829
|
+
{
|
|
4830
|
+
internalType: "uint32",
|
|
4831
|
+
name: "lastPosIncreaseBlock",
|
|
4832
|
+
type: "uint32",
|
|
4833
|
+
},
|
|
4834
|
+
{
|
|
4835
|
+
internalType: "uint8",
|
|
4834
4836
|
name: "__placeholder",
|
|
4835
|
-
type: "
|
|
4837
|
+
type: "uint8",
|
|
4836
4838
|
},
|
|
4837
4839
|
],
|
|
4838
4840
|
internalType: "struct ITradingStorage.TradeInfo[]",
|
|
@@ -4959,14 +4961,14 @@ const _abi = [
|
|
|
4959
4961
|
type: "uint40",
|
|
4960
4962
|
},
|
|
4961
4963
|
{
|
|
4962
|
-
internalType: "
|
|
4964
|
+
internalType: "uint40",
|
|
4963
4965
|
name: "startLiqThresholdP",
|
|
4964
|
-
type: "
|
|
4966
|
+
type: "uint40",
|
|
4965
4967
|
},
|
|
4966
4968
|
{
|
|
4967
|
-
internalType: "
|
|
4969
|
+
internalType: "uint40",
|
|
4968
4970
|
name: "endLiqThresholdP",
|
|
4969
|
-
type: "
|
|
4971
|
+
type: "uint40",
|
|
4970
4972
|
},
|
|
4971
4973
|
{
|
|
4972
4974
|
internalType: "uint24",
|
|
@@ -5152,6 +5154,20 @@ const _abi = [
|
|
|
5152
5154
|
type: "function",
|
|
5153
5155
|
signature: "0x0212f0d6",
|
|
5154
5156
|
},
|
|
5157
|
+
{
|
|
5158
|
+
inputs: [],
|
|
5159
|
+
name: "getCurrentContractsVersion",
|
|
5160
|
+
outputs: [
|
|
5161
|
+
{
|
|
5162
|
+
internalType: "enum ITradingStorage.ContractsVersion",
|
|
5163
|
+
name: "",
|
|
5164
|
+
type: "uint8",
|
|
5165
|
+
},
|
|
5166
|
+
],
|
|
5167
|
+
stateMutability: "pure",
|
|
5168
|
+
type: "function",
|
|
5169
|
+
signature: "0x9095b119",
|
|
5170
|
+
},
|
|
5155
5171
|
{
|
|
5156
5172
|
inputs: [
|
|
5157
5173
|
{
|
|
@@ -5572,9 +5588,19 @@ const _abi = [
|
|
|
5572
5588
|
type: "uint48",
|
|
5573
5589
|
},
|
|
5574
5590
|
{
|
|
5575
|
-
internalType: "
|
|
5591
|
+
internalType: "enum ITradingStorage.ContractsVersion",
|
|
5592
|
+
name: "contractsVersion",
|
|
5593
|
+
type: "uint8",
|
|
5594
|
+
},
|
|
5595
|
+
{
|
|
5596
|
+
internalType: "uint32",
|
|
5597
|
+
name: "lastPosIncreaseBlock",
|
|
5598
|
+
type: "uint32",
|
|
5599
|
+
},
|
|
5600
|
+
{
|
|
5601
|
+
internalType: "uint8",
|
|
5576
5602
|
name: "__placeholder",
|
|
5577
|
-
type: "
|
|
5603
|
+
type: "uint8",
|
|
5578
5604
|
},
|
|
5579
5605
|
],
|
|
5580
5606
|
internalType: "struct ITradingStorage.TradeInfo",
|
|
@@ -5629,9 +5655,19 @@ const _abi = [
|
|
|
5629
5655
|
type: "uint48",
|
|
5630
5656
|
},
|
|
5631
5657
|
{
|
|
5632
|
-
internalType: "
|
|
5658
|
+
internalType: "enum ITradingStorage.ContractsVersion",
|
|
5659
|
+
name: "contractsVersion",
|
|
5660
|
+
type: "uint8",
|
|
5661
|
+
},
|
|
5662
|
+
{
|
|
5663
|
+
internalType: "uint32",
|
|
5664
|
+
name: "lastPosIncreaseBlock",
|
|
5665
|
+
type: "uint32",
|
|
5666
|
+
},
|
|
5667
|
+
{
|
|
5668
|
+
internalType: "uint8",
|
|
5633
5669
|
name: "__placeholder",
|
|
5634
|
-
type: "
|
|
5670
|
+
type: "uint8",
|
|
5635
5671
|
},
|
|
5636
5672
|
],
|
|
5637
5673
|
internalType: "struct ITradingStorage.TradeInfo[]",
|
|
@@ -5666,14 +5702,14 @@ const _abi = [
|
|
|
5666
5702
|
type: "uint40",
|
|
5667
5703
|
},
|
|
5668
5704
|
{
|
|
5669
|
-
internalType: "
|
|
5705
|
+
internalType: "uint40",
|
|
5670
5706
|
name: "startLiqThresholdP",
|
|
5671
|
-
type: "
|
|
5707
|
+
type: "uint40",
|
|
5672
5708
|
},
|
|
5673
5709
|
{
|
|
5674
|
-
internalType: "
|
|
5710
|
+
internalType: "uint40",
|
|
5675
5711
|
name: "endLiqThresholdP",
|
|
5676
|
-
type: "
|
|
5712
|
+
type: "uint40",
|
|
5677
5713
|
},
|
|
5678
5714
|
{
|
|
5679
5715
|
internalType: "uint24",
|
|
@@ -5882,14 +5918,14 @@ const _abi = [
|
|
|
5882
5918
|
type: "uint40",
|
|
5883
5919
|
},
|
|
5884
5920
|
{
|
|
5885
|
-
internalType: "
|
|
5921
|
+
internalType: "uint40",
|
|
5886
5922
|
name: "startLiqThresholdP",
|
|
5887
|
-
type: "
|
|
5923
|
+
type: "uint40",
|
|
5888
5924
|
},
|
|
5889
5925
|
{
|
|
5890
|
-
internalType: "
|
|
5926
|
+
internalType: "uint40",
|
|
5891
5927
|
name: "endLiqThresholdP",
|
|
5892
|
-
type: "
|
|
5928
|
+
type: "uint40",
|
|
5893
5929
|
},
|
|
5894
5930
|
{
|
|
5895
5931
|
internalType: "uint24",
|
|
@@ -6329,9 +6365,19 @@ const _abi = [
|
|
|
6329
6365
|
type: "uint48",
|
|
6330
6366
|
},
|
|
6331
6367
|
{
|
|
6332
|
-
internalType: "
|
|
6368
|
+
internalType: "enum ITradingStorage.ContractsVersion",
|
|
6369
|
+
name: "contractsVersion",
|
|
6370
|
+
type: "uint8",
|
|
6371
|
+
},
|
|
6372
|
+
{
|
|
6373
|
+
internalType: "uint32",
|
|
6374
|
+
name: "lastPosIncreaseBlock",
|
|
6375
|
+
type: "uint32",
|
|
6376
|
+
},
|
|
6377
|
+
{
|
|
6378
|
+
internalType: "uint8",
|
|
6333
6379
|
name: "__placeholder",
|
|
6334
|
-
type: "
|
|
6380
|
+
type: "uint8",
|
|
6335
6381
|
},
|
|
6336
6382
|
],
|
|
6337
6383
|
internalType: "struct ITradingStorage.TradeInfo",
|
|
@@ -6416,7 +6462,7 @@ const _abi = [
|
|
|
6416
6462
|
],
|
|
6417
6463
|
stateMutability: "nonpayable",
|
|
6418
6464
|
type: "function",
|
|
6419
|
-
signature: "
|
|
6465
|
+
signature: "0xd7ec0787",
|
|
6420
6466
|
},
|
|
6421
6467
|
{
|
|
6422
6468
|
inputs: [
|
|
@@ -6528,6 +6574,37 @@ const _abi = [
|
|
|
6528
6574
|
type: "function",
|
|
6529
6575
|
signature: "0x5a68200d",
|
|
6530
6576
|
},
|
|
6577
|
+
{
|
|
6578
|
+
inputs: [
|
|
6579
|
+
{
|
|
6580
|
+
components: [
|
|
6581
|
+
{
|
|
6582
|
+
internalType: "address",
|
|
6583
|
+
name: "user",
|
|
6584
|
+
type: "address",
|
|
6585
|
+
},
|
|
6586
|
+
{
|
|
6587
|
+
internalType: "uint32",
|
|
6588
|
+
name: "index",
|
|
6589
|
+
type: "uint32",
|
|
6590
|
+
},
|
|
6591
|
+
],
|
|
6592
|
+
internalType: "struct ITradingStorage.Id",
|
|
6593
|
+
name: "_tradeId",
|
|
6594
|
+
type: "tuple",
|
|
6595
|
+
},
|
|
6596
|
+
{
|
|
6597
|
+
internalType: "uint16",
|
|
6598
|
+
name: "_maxSlippageP",
|
|
6599
|
+
type: "uint16",
|
|
6600
|
+
},
|
|
6601
|
+
],
|
|
6602
|
+
name: "updateTradeMaxClosingSlippageP",
|
|
6603
|
+
outputs: [],
|
|
6604
|
+
stateMutability: "nonpayable",
|
|
6605
|
+
type: "function",
|
|
6606
|
+
signature: "0x07d426fd",
|
|
6607
|
+
},
|
|
6531
6608
|
{
|
|
6532
6609
|
inputs: [
|
|
6533
6610
|
{
|
|
@@ -6562,12 +6639,17 @@ const _abi = [
|
|
|
6562
6639
|
name: "_openPrice",
|
|
6563
6640
|
type: "uint64",
|
|
6564
6641
|
},
|
|
6642
|
+
{
|
|
6643
|
+
internalType: "bool",
|
|
6644
|
+
name: "_isPartialIncrease",
|
|
6645
|
+
type: "bool",
|
|
6646
|
+
},
|
|
6565
6647
|
],
|
|
6566
6648
|
name: "updateTradePosition",
|
|
6567
6649
|
outputs: [],
|
|
6568
6650
|
stateMutability: "nonpayable",
|
|
6569
6651
|
type: "function",
|
|
6570
|
-
signature: "
|
|
6652
|
+
signature: "0x72570e24",
|
|
6571
6653
|
},
|
|
6572
6654
|
{
|
|
6573
6655
|
inputs: [
|
|
@@ -6930,11 +7012,6 @@ const _abi = [
|
|
|
6930
7012
|
name: "WrongLeverage",
|
|
6931
7013
|
type: "error",
|
|
6932
7014
|
},
|
|
6933
|
-
{
|
|
6934
|
-
inputs: [],
|
|
6935
|
-
name: "WrongOrderType",
|
|
6936
|
-
type: "error",
|
|
6937
|
-
},
|
|
6938
7015
|
{
|
|
6939
7016
|
inputs: [],
|
|
6940
7017
|
name: "WrongSl",
|
|
@@ -7810,12 +7887,17 @@ const _abi = [
|
|
|
7810
7887
|
name: "_index",
|
|
7811
7888
|
type: "uint32",
|
|
7812
7889
|
},
|
|
7890
|
+
{
|
|
7891
|
+
internalType: "uint64",
|
|
7892
|
+
name: "_expectedPrice",
|
|
7893
|
+
type: "uint64",
|
|
7894
|
+
},
|
|
7813
7895
|
],
|
|
7814
7896
|
name: "closeTradeMarket",
|
|
7815
7897
|
outputs: [],
|
|
7816
7898
|
stateMutability: "nonpayable",
|
|
7817
7899
|
type: "function",
|
|
7818
|
-
signature: "
|
|
7900
|
+
signature: "0x36ce736b",
|
|
7819
7901
|
},
|
|
7820
7902
|
{
|
|
7821
7903
|
inputs: [
|
|
@@ -7834,12 +7916,17 @@ const _abi = [
|
|
|
7834
7916
|
name: "_leverageDelta",
|
|
7835
7917
|
type: "uint24",
|
|
7836
7918
|
},
|
|
7919
|
+
{
|
|
7920
|
+
internalType: "uint64",
|
|
7921
|
+
name: "_expectedPrice",
|
|
7922
|
+
type: "uint64",
|
|
7923
|
+
},
|
|
7837
7924
|
],
|
|
7838
7925
|
name: "decreasePositionSize",
|
|
7839
7926
|
outputs: [],
|
|
7840
7927
|
stateMutability: "nonpayable",
|
|
7841
7928
|
type: "function",
|
|
7842
|
-
signature: "
|
|
7929
|
+
signature: "0xa7cac572",
|
|
7843
7930
|
},
|
|
7844
7931
|
{
|
|
7845
7932
|
inputs: [
|
|
@@ -8277,6 +8364,25 @@ const _abi = [
|
|
|
8277
8364
|
type: "function",
|
|
8278
8365
|
signature: "0x52d029d2",
|
|
8279
8366
|
},
|
|
8367
|
+
{
|
|
8368
|
+
inputs: [
|
|
8369
|
+
{
|
|
8370
|
+
internalType: "uint32",
|
|
8371
|
+
name: "_index",
|
|
8372
|
+
type: "uint32",
|
|
8373
|
+
},
|
|
8374
|
+
{
|
|
8375
|
+
internalType: "uint16",
|
|
8376
|
+
name: "_maxSlippageP",
|
|
8377
|
+
type: "uint16",
|
|
8378
|
+
},
|
|
8379
|
+
],
|
|
8380
|
+
name: "updateMaxClosingSlippageP",
|
|
8381
|
+
outputs: [],
|
|
8382
|
+
stateMutability: "nonpayable",
|
|
8383
|
+
type: "function",
|
|
8384
|
+
signature: "0x9e8433d0",
|
|
8385
|
+
},
|
|
8280
8386
|
{
|
|
8281
8387
|
inputs: [
|
|
8282
8388
|
{
|
|
@@ -9436,26 +9542,376 @@ const _abi = [
|
|
|
9436
9542
|
signature: "0xcbc8e6f2",
|
|
9437
9543
|
},
|
|
9438
9544
|
{
|
|
9439
|
-
inputs: [],
|
|
9440
|
-
name: "BorrowingWrongExponent",
|
|
9441
|
-
type: "error",
|
|
9442
|
-
},
|
|
9443
|
-
{
|
|
9444
|
-
inputs: [],
|
|
9445
|
-
name: "BorrowingZeroGroup",
|
|
9446
|
-
type: "error",
|
|
9447
|
-
},
|
|
9448
|
-
{
|
|
9449
|
-
anonymous: false,
|
|
9450
9545
|
inputs: [
|
|
9451
9546
|
{
|
|
9452
|
-
|
|
9453
|
-
|
|
9454
|
-
|
|
9455
|
-
|
|
9547
|
+
components: [
|
|
9548
|
+
{
|
|
9549
|
+
internalType: "address",
|
|
9550
|
+
name: "user",
|
|
9551
|
+
type: "address",
|
|
9552
|
+
},
|
|
9553
|
+
{
|
|
9554
|
+
internalType: "uint32",
|
|
9555
|
+
name: "index",
|
|
9556
|
+
type: "uint32",
|
|
9557
|
+
},
|
|
9558
|
+
],
|
|
9559
|
+
internalType: "struct ITradingStorage.Id",
|
|
9560
|
+
name: "_tradeId",
|
|
9561
|
+
type: "tuple",
|
|
9456
9562
|
},
|
|
9457
9563
|
{
|
|
9458
|
-
|
|
9564
|
+
internalType: "enum ITradingStorage.PendingOrderType",
|
|
9565
|
+
name: "_orderType",
|
|
9566
|
+
type: "uint8",
|
|
9567
|
+
},
|
|
9568
|
+
{
|
|
9569
|
+
internalType: "uint64",
|
|
9570
|
+
name: "_open",
|
|
9571
|
+
type: "uint64",
|
|
9572
|
+
},
|
|
9573
|
+
{
|
|
9574
|
+
internalType: "uint64",
|
|
9575
|
+
name: "_high",
|
|
9576
|
+
type: "uint64",
|
|
9577
|
+
},
|
|
9578
|
+
{
|
|
9579
|
+
internalType: "uint64",
|
|
9580
|
+
name: "_low",
|
|
9581
|
+
type: "uint64",
|
|
9582
|
+
},
|
|
9583
|
+
],
|
|
9584
|
+
name: "validateTriggerCloseOrderCallback",
|
|
9585
|
+
outputs: [
|
|
9586
|
+
{
|
|
9587
|
+
components: [
|
|
9588
|
+
{
|
|
9589
|
+
internalType: "address",
|
|
9590
|
+
name: "user",
|
|
9591
|
+
type: "address",
|
|
9592
|
+
},
|
|
9593
|
+
{
|
|
9594
|
+
internalType: "uint32",
|
|
9595
|
+
name: "index",
|
|
9596
|
+
type: "uint32",
|
|
9597
|
+
},
|
|
9598
|
+
{
|
|
9599
|
+
internalType: "uint16",
|
|
9600
|
+
name: "pairIndex",
|
|
9601
|
+
type: "uint16",
|
|
9602
|
+
},
|
|
9603
|
+
{
|
|
9604
|
+
internalType: "uint24",
|
|
9605
|
+
name: "leverage",
|
|
9606
|
+
type: "uint24",
|
|
9607
|
+
},
|
|
9608
|
+
{
|
|
9609
|
+
internalType: "bool",
|
|
9610
|
+
name: "long",
|
|
9611
|
+
type: "bool",
|
|
9612
|
+
},
|
|
9613
|
+
{
|
|
9614
|
+
internalType: "bool",
|
|
9615
|
+
name: "isOpen",
|
|
9616
|
+
type: "bool",
|
|
9617
|
+
},
|
|
9618
|
+
{
|
|
9619
|
+
internalType: "uint8",
|
|
9620
|
+
name: "collateralIndex",
|
|
9621
|
+
type: "uint8",
|
|
9622
|
+
},
|
|
9623
|
+
{
|
|
9624
|
+
internalType: "enum ITradingStorage.TradeType",
|
|
9625
|
+
name: "tradeType",
|
|
9626
|
+
type: "uint8",
|
|
9627
|
+
},
|
|
9628
|
+
{
|
|
9629
|
+
internalType: "uint120",
|
|
9630
|
+
name: "collateralAmount",
|
|
9631
|
+
type: "uint120",
|
|
9632
|
+
},
|
|
9633
|
+
{
|
|
9634
|
+
internalType: "uint64",
|
|
9635
|
+
name: "openPrice",
|
|
9636
|
+
type: "uint64",
|
|
9637
|
+
},
|
|
9638
|
+
{
|
|
9639
|
+
internalType: "uint64",
|
|
9640
|
+
name: "tp",
|
|
9641
|
+
type: "uint64",
|
|
9642
|
+
},
|
|
9643
|
+
{
|
|
9644
|
+
internalType: "uint64",
|
|
9645
|
+
name: "sl",
|
|
9646
|
+
type: "uint64",
|
|
9647
|
+
},
|
|
9648
|
+
{
|
|
9649
|
+
internalType: "uint192",
|
|
9650
|
+
name: "__placeholder",
|
|
9651
|
+
type: "uint192",
|
|
9652
|
+
},
|
|
9653
|
+
],
|
|
9654
|
+
internalType: "struct ITradingStorage.Trade",
|
|
9655
|
+
name: "t",
|
|
9656
|
+
type: "tuple",
|
|
9657
|
+
},
|
|
9658
|
+
{
|
|
9659
|
+
internalType: "enum ITradingCallbacks.CancelReason",
|
|
9660
|
+
name: "cancelReason",
|
|
9661
|
+
type: "uint8",
|
|
9662
|
+
},
|
|
9663
|
+
{
|
|
9664
|
+
components: [
|
|
9665
|
+
{
|
|
9666
|
+
internalType: "uint256",
|
|
9667
|
+
name: "positionSizeCollateral",
|
|
9668
|
+
type: "uint256",
|
|
9669
|
+
},
|
|
9670
|
+
{
|
|
9671
|
+
internalType: "uint256",
|
|
9672
|
+
name: "gnsPriceCollateral",
|
|
9673
|
+
type: "uint256",
|
|
9674
|
+
},
|
|
9675
|
+
{
|
|
9676
|
+
internalType: "int256",
|
|
9677
|
+
name: "profitP",
|
|
9678
|
+
type: "int256",
|
|
9679
|
+
},
|
|
9680
|
+
{
|
|
9681
|
+
internalType: "uint256",
|
|
9682
|
+
name: "executionPrice",
|
|
9683
|
+
type: "uint256",
|
|
9684
|
+
},
|
|
9685
|
+
{
|
|
9686
|
+
internalType: "uint256",
|
|
9687
|
+
name: "liqPrice",
|
|
9688
|
+
type: "uint256",
|
|
9689
|
+
},
|
|
9690
|
+
{
|
|
9691
|
+
internalType: "uint256",
|
|
9692
|
+
name: "amountSentToTrader",
|
|
9693
|
+
type: "uint256",
|
|
9694
|
+
},
|
|
9695
|
+
{
|
|
9696
|
+
internalType: "uint256",
|
|
9697
|
+
name: "reward1",
|
|
9698
|
+
type: "uint256",
|
|
9699
|
+
},
|
|
9700
|
+
{
|
|
9701
|
+
internalType: "uint256",
|
|
9702
|
+
name: "reward2",
|
|
9703
|
+
type: "uint256",
|
|
9704
|
+
},
|
|
9705
|
+
{
|
|
9706
|
+
internalType: "uint256",
|
|
9707
|
+
name: "reward3",
|
|
9708
|
+
type: "uint256",
|
|
9709
|
+
},
|
|
9710
|
+
{
|
|
9711
|
+
internalType: "uint128",
|
|
9712
|
+
name: "collateralPrecisionDelta",
|
|
9713
|
+
type: "uint128",
|
|
9714
|
+
},
|
|
9715
|
+
{
|
|
9716
|
+
internalType: "uint256",
|
|
9717
|
+
name: "collateralPriceUsd",
|
|
9718
|
+
type: "uint256",
|
|
9719
|
+
},
|
|
9720
|
+
{
|
|
9721
|
+
internalType: "bool",
|
|
9722
|
+
name: "exactExecution",
|
|
9723
|
+
type: "bool",
|
|
9724
|
+
},
|
|
9725
|
+
{
|
|
9726
|
+
internalType: "uint256",
|
|
9727
|
+
name: "closingFeeCollateral",
|
|
9728
|
+
type: "uint256",
|
|
9729
|
+
},
|
|
9730
|
+
{
|
|
9731
|
+
internalType: "uint256",
|
|
9732
|
+
name: "triggerFeeCollateral",
|
|
9733
|
+
type: "uint256",
|
|
9734
|
+
},
|
|
9735
|
+
{
|
|
9736
|
+
internalType: "uint256",
|
|
9737
|
+
name: "collateralLeftInStorage",
|
|
9738
|
+
type: "uint256",
|
|
9739
|
+
},
|
|
9740
|
+
],
|
|
9741
|
+
internalType: "struct ITradingCallbacks.Values",
|
|
9742
|
+
name: "v",
|
|
9743
|
+
type: "tuple",
|
|
9744
|
+
},
|
|
9745
|
+
{
|
|
9746
|
+
internalType: "uint256",
|
|
9747
|
+
name: "priceImpactP",
|
|
9748
|
+
type: "uint256",
|
|
9749
|
+
},
|
|
9750
|
+
],
|
|
9751
|
+
stateMutability: "view",
|
|
9752
|
+
type: "function",
|
|
9753
|
+
signature: "0x85ea3c78",
|
|
9754
|
+
},
|
|
9755
|
+
{
|
|
9756
|
+
inputs: [
|
|
9757
|
+
{
|
|
9758
|
+
components: [
|
|
9759
|
+
{
|
|
9760
|
+
internalType: "address",
|
|
9761
|
+
name: "user",
|
|
9762
|
+
type: "address",
|
|
9763
|
+
},
|
|
9764
|
+
{
|
|
9765
|
+
internalType: "uint32",
|
|
9766
|
+
name: "index",
|
|
9767
|
+
type: "uint32",
|
|
9768
|
+
},
|
|
9769
|
+
],
|
|
9770
|
+
internalType: "struct ITradingStorage.Id",
|
|
9771
|
+
name: "_tradeId",
|
|
9772
|
+
type: "tuple",
|
|
9773
|
+
},
|
|
9774
|
+
{
|
|
9775
|
+
internalType: "enum ITradingStorage.PendingOrderType",
|
|
9776
|
+
name: "_orderType",
|
|
9777
|
+
type: "uint8",
|
|
9778
|
+
},
|
|
9779
|
+
{
|
|
9780
|
+
internalType: "uint64",
|
|
9781
|
+
name: "_open",
|
|
9782
|
+
type: "uint64",
|
|
9783
|
+
},
|
|
9784
|
+
{
|
|
9785
|
+
internalType: "uint64",
|
|
9786
|
+
name: "_high",
|
|
9787
|
+
type: "uint64",
|
|
9788
|
+
},
|
|
9789
|
+
{
|
|
9790
|
+
internalType: "uint64",
|
|
9791
|
+
name: "_low",
|
|
9792
|
+
type: "uint64",
|
|
9793
|
+
},
|
|
9794
|
+
],
|
|
9795
|
+
name: "validateTriggerOpenOrderCallback",
|
|
9796
|
+
outputs: [
|
|
9797
|
+
{
|
|
9798
|
+
components: [
|
|
9799
|
+
{
|
|
9800
|
+
internalType: "address",
|
|
9801
|
+
name: "user",
|
|
9802
|
+
type: "address",
|
|
9803
|
+
},
|
|
9804
|
+
{
|
|
9805
|
+
internalType: "uint32",
|
|
9806
|
+
name: "index",
|
|
9807
|
+
type: "uint32",
|
|
9808
|
+
},
|
|
9809
|
+
{
|
|
9810
|
+
internalType: "uint16",
|
|
9811
|
+
name: "pairIndex",
|
|
9812
|
+
type: "uint16",
|
|
9813
|
+
},
|
|
9814
|
+
{
|
|
9815
|
+
internalType: "uint24",
|
|
9816
|
+
name: "leverage",
|
|
9817
|
+
type: "uint24",
|
|
9818
|
+
},
|
|
9819
|
+
{
|
|
9820
|
+
internalType: "bool",
|
|
9821
|
+
name: "long",
|
|
9822
|
+
type: "bool",
|
|
9823
|
+
},
|
|
9824
|
+
{
|
|
9825
|
+
internalType: "bool",
|
|
9826
|
+
name: "isOpen",
|
|
9827
|
+
type: "bool",
|
|
9828
|
+
},
|
|
9829
|
+
{
|
|
9830
|
+
internalType: "uint8",
|
|
9831
|
+
name: "collateralIndex",
|
|
9832
|
+
type: "uint8",
|
|
9833
|
+
},
|
|
9834
|
+
{
|
|
9835
|
+
internalType: "enum ITradingStorage.TradeType",
|
|
9836
|
+
name: "tradeType",
|
|
9837
|
+
type: "uint8",
|
|
9838
|
+
},
|
|
9839
|
+
{
|
|
9840
|
+
internalType: "uint120",
|
|
9841
|
+
name: "collateralAmount",
|
|
9842
|
+
type: "uint120",
|
|
9843
|
+
},
|
|
9844
|
+
{
|
|
9845
|
+
internalType: "uint64",
|
|
9846
|
+
name: "openPrice",
|
|
9847
|
+
type: "uint64",
|
|
9848
|
+
},
|
|
9849
|
+
{
|
|
9850
|
+
internalType: "uint64",
|
|
9851
|
+
name: "tp",
|
|
9852
|
+
type: "uint64",
|
|
9853
|
+
},
|
|
9854
|
+
{
|
|
9855
|
+
internalType: "uint64",
|
|
9856
|
+
name: "sl",
|
|
9857
|
+
type: "uint64",
|
|
9858
|
+
},
|
|
9859
|
+
{
|
|
9860
|
+
internalType: "uint192",
|
|
9861
|
+
name: "__placeholder",
|
|
9862
|
+
type: "uint192",
|
|
9863
|
+
},
|
|
9864
|
+
],
|
|
9865
|
+
internalType: "struct ITradingStorage.Trade",
|
|
9866
|
+
name: "t",
|
|
9867
|
+
type: "tuple",
|
|
9868
|
+
},
|
|
9869
|
+
{
|
|
9870
|
+
internalType: "enum ITradingCallbacks.CancelReason",
|
|
9871
|
+
name: "cancelReason",
|
|
9872
|
+
type: "uint8",
|
|
9873
|
+
},
|
|
9874
|
+
{
|
|
9875
|
+
internalType: "uint256",
|
|
9876
|
+
name: "priceImpactP",
|
|
9877
|
+
type: "uint256",
|
|
9878
|
+
},
|
|
9879
|
+
{
|
|
9880
|
+
internalType: "uint256",
|
|
9881
|
+
name: "priceAfterImpact",
|
|
9882
|
+
type: "uint256",
|
|
9883
|
+
},
|
|
9884
|
+
{
|
|
9885
|
+
internalType: "bool",
|
|
9886
|
+
name: "exactExecution",
|
|
9887
|
+
type: "bool",
|
|
9888
|
+
},
|
|
9889
|
+
],
|
|
9890
|
+
stateMutability: "view",
|
|
9891
|
+
type: "function",
|
|
9892
|
+
signature: "0xa96ae63b",
|
|
9893
|
+
},
|
|
9894
|
+
{
|
|
9895
|
+
inputs: [],
|
|
9896
|
+
name: "BorrowingWrongExponent",
|
|
9897
|
+
type: "error",
|
|
9898
|
+
},
|
|
9899
|
+
{
|
|
9900
|
+
inputs: [],
|
|
9901
|
+
name: "BorrowingZeroGroup",
|
|
9902
|
+
type: "error",
|
|
9903
|
+
},
|
|
9904
|
+
{
|
|
9905
|
+
anonymous: false,
|
|
9906
|
+
inputs: [
|
|
9907
|
+
{
|
|
9908
|
+
indexed: true,
|
|
9909
|
+
internalType: "uint8",
|
|
9910
|
+
name: "collateralIndex",
|
|
9911
|
+
type: "uint8",
|
|
9912
|
+
},
|
|
9913
|
+
{
|
|
9914
|
+
indexed: true,
|
|
9459
9915
|
internalType: "uint16",
|
|
9460
9916
|
name: "groupIndex",
|
|
9461
9917
|
type: "uint16",
|
|
@@ -10683,6 +11139,38 @@ const _abi = [
|
|
|
10683
11139
|
name: "useBorrowingFees",
|
|
10684
11140
|
type: "bool",
|
|
10685
11141
|
},
|
|
11142
|
+
{
|
|
11143
|
+
components: [
|
|
11144
|
+
{
|
|
11145
|
+
internalType: "uint40",
|
|
11146
|
+
name: "maxLiqSpreadP",
|
|
11147
|
+
type: "uint40",
|
|
11148
|
+
},
|
|
11149
|
+
{
|
|
11150
|
+
internalType: "uint40",
|
|
11151
|
+
name: "startLiqThresholdP",
|
|
11152
|
+
type: "uint40",
|
|
11153
|
+
},
|
|
11154
|
+
{
|
|
11155
|
+
internalType: "uint40",
|
|
11156
|
+
name: "endLiqThresholdP",
|
|
11157
|
+
type: "uint40",
|
|
11158
|
+
},
|
|
11159
|
+
{
|
|
11160
|
+
internalType: "uint24",
|
|
11161
|
+
name: "startLeverage",
|
|
11162
|
+
type: "uint24",
|
|
11163
|
+
},
|
|
11164
|
+
{
|
|
11165
|
+
internalType: "uint24",
|
|
11166
|
+
name: "endLeverage",
|
|
11167
|
+
type: "uint24",
|
|
11168
|
+
},
|
|
11169
|
+
],
|
|
11170
|
+
internalType: "struct IPairsStorage.GroupLiquidationParams",
|
|
11171
|
+
name: "liquidationParams",
|
|
11172
|
+
type: "tuple",
|
|
11173
|
+
},
|
|
10686
11174
|
],
|
|
10687
11175
|
internalType: "struct IBorrowingFees.LiqPriceInput",
|
|
10688
11176
|
name: "_input",
|
|
@@ -10699,7 +11187,7 @@ const _abi = [
|
|
|
10699
11187
|
],
|
|
10700
11188
|
stateMutability: "view",
|
|
10701
11189
|
type: "function",
|
|
10702
|
-
signature: "
|
|
11190
|
+
signature: "0x61ddacb0",
|
|
10703
11191
|
},
|
|
10704
11192
|
{
|
|
10705
11193
|
inputs: [
|
|
@@ -11013,11 +11501,6 @@ const _abi = [
|
|
|
11013
11501
|
name: "SourceNotOracleOfRequest",
|
|
11014
11502
|
type: "error",
|
|
11015
11503
|
},
|
|
11016
|
-
{
|
|
11017
|
-
inputs: [],
|
|
11018
|
-
name: "T",
|
|
11019
|
-
type: "error",
|
|
11020
|
-
},
|
|
11021
11504
|
{
|
|
11022
11505
|
inputs: [],
|
|
11023
11506
|
name: "TransferAndCallToOracleFailed",
|
|
@@ -11028,34 +11511,6 @@ const _abi = [
|
|
|
11028
11511
|
name: "WrongCollateralUsdDecimals",
|
|
11029
11512
|
type: "error",
|
|
11030
11513
|
},
|
|
11031
|
-
{
|
|
11032
|
-
anonymous: false,
|
|
11033
|
-
inputs: [
|
|
11034
|
-
{
|
|
11035
|
-
indexed: true,
|
|
11036
|
-
internalType: "bytes32",
|
|
11037
|
-
name: "id",
|
|
11038
|
-
type: "bytes32",
|
|
11039
|
-
},
|
|
11040
|
-
],
|
|
11041
|
-
name: "ChainlinkFulfilled",
|
|
11042
|
-
type: "event",
|
|
11043
|
-
signature: "0x7cc135e0cebb02c3480ae5d74d377283180a2601f8f644edf7987b009316c63a",
|
|
11044
|
-
},
|
|
11045
|
-
{
|
|
11046
|
-
anonymous: false,
|
|
11047
|
-
inputs: [
|
|
11048
|
-
{
|
|
11049
|
-
indexed: true,
|
|
11050
|
-
internalType: "bytes32",
|
|
11051
|
-
name: "id",
|
|
11052
|
-
type: "bytes32",
|
|
11053
|
-
},
|
|
11054
|
-
],
|
|
11055
|
-
name: "ChainlinkRequested",
|
|
11056
|
-
type: "event",
|
|
11057
|
-
signature: "0xb5e6e01e79f91267dc17b4e6314d5d4d03593d2ceee0fbb452b750bd70ea5af9",
|
|
11058
|
-
},
|
|
11059
11514
|
{
|
|
11060
11515
|
anonymous: false,
|
|
11061
11516
|
inputs: [
|
|
@@ -11364,18 +11819,30 @@ const _abi = [
|
|
|
11364
11819
|
name: "collateralIndex",
|
|
11365
11820
|
type: "uint8",
|
|
11366
11821
|
},
|
|
11367
|
-
{
|
|
11368
|
-
indexed: true,
|
|
11369
|
-
internalType: "address",
|
|
11370
|
-
name: "trader",
|
|
11371
|
-
type: "address",
|
|
11372
|
-
},
|
|
11373
11822
|
{
|
|
11374
11823
|
indexed: true,
|
|
11375
11824
|
internalType: "uint256",
|
|
11376
11825
|
name: "pairIndex",
|
|
11377
11826
|
type: "uint256",
|
|
11378
11827
|
},
|
|
11828
|
+
{
|
|
11829
|
+
components: [
|
|
11830
|
+
{
|
|
11831
|
+
internalType: "address",
|
|
11832
|
+
name: "user",
|
|
11833
|
+
type: "address",
|
|
11834
|
+
},
|
|
11835
|
+
{
|
|
11836
|
+
internalType: "uint32",
|
|
11837
|
+
name: "index",
|
|
11838
|
+
type: "uint32",
|
|
11839
|
+
},
|
|
11840
|
+
],
|
|
11841
|
+
indexed: false,
|
|
11842
|
+
internalType: "struct ITradingStorage.Id",
|
|
11843
|
+
name: "tradeId",
|
|
11844
|
+
type: "tuple",
|
|
11845
|
+
},
|
|
11379
11846
|
{
|
|
11380
11847
|
components: [
|
|
11381
11848
|
{
|
|
@@ -11433,7 +11900,7 @@ const _abi = [
|
|
|
11433
11900
|
],
|
|
11434
11901
|
name: "PriceRequested",
|
|
11435
11902
|
type: "event",
|
|
11436
|
-
signature: "
|
|
11903
|
+
signature: "0x59fd16e7bbed6457d473d57a799cffde3ff43e27a3a87479a5a431b4801f754f",
|
|
11437
11904
|
},
|
|
11438
11905
|
{
|
|
11439
11906
|
anonymous: false,
|
|
@@ -11887,16 +12354,28 @@ const _abi = [
|
|
|
11887
12354
|
name: "_collateralIndex",
|
|
11888
12355
|
type: "uint8",
|
|
11889
12356
|
},
|
|
11890
|
-
{
|
|
11891
|
-
internalType: "address",
|
|
11892
|
-
name: "_trader",
|
|
11893
|
-
type: "address",
|
|
11894
|
-
},
|
|
11895
12357
|
{
|
|
11896
12358
|
internalType: "uint16",
|
|
11897
12359
|
name: "_pairIndex",
|
|
11898
12360
|
type: "uint16",
|
|
11899
12361
|
},
|
|
12362
|
+
{
|
|
12363
|
+
components: [
|
|
12364
|
+
{
|
|
12365
|
+
internalType: "address",
|
|
12366
|
+
name: "user",
|
|
12367
|
+
type: "address",
|
|
12368
|
+
},
|
|
12369
|
+
{
|
|
12370
|
+
internalType: "uint32",
|
|
12371
|
+
name: "index",
|
|
12372
|
+
type: "uint32",
|
|
12373
|
+
},
|
|
12374
|
+
],
|
|
12375
|
+
internalType: "struct ITradingStorage.Id",
|
|
12376
|
+
name: "_tradeId",
|
|
12377
|
+
type: "tuple",
|
|
12378
|
+
},
|
|
11900
12379
|
{
|
|
11901
12380
|
components: [
|
|
11902
12381
|
{
|
|
@@ -11934,7 +12413,7 @@ const _abi = [
|
|
|
11934
12413
|
outputs: [],
|
|
11935
12414
|
stateMutability: "nonpayable",
|
|
11936
12415
|
type: "function",
|
|
11937
|
-
signature: "
|
|
12416
|
+
signature: "0x7e156b8c",
|
|
11938
12417
|
},
|
|
11939
12418
|
{
|
|
11940
12419
|
inputs: [
|