@gmx-io/sdk 0.0.9 → 0.1.1-alpha-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -7
- package/build/scripts/prebuild/index.js +2 -0
- package/build/scripts/prebuild/prebuildKinkModelMarketRatesKeys.d.ts +1 -0
- package/build/scripts/prebuild/prebuildKinkModelMarketRatesKeys.js +44 -0
- package/build/src/abis/ExchangeRouter.json +203 -0
- package/build/src/abis/GlvReader.json +0 -10
- package/build/src/abis/GlvRouter.json +96 -2
- package/build/src/abis/RewardRouter.json +323 -68
- package/build/src/abis/SubaccountRouter.json +10 -0
- package/build/src/abis/SyntheticsReader.json +196 -64
- package/build/src/configs/batch.js +1 -13
- package/build/src/configs/chains.d.ts +0 -1
- package/build/src/configs/chains.js +1 -7
- package/build/src/configs/contracts.d.ts +2 -1
- package/build/src/configs/contracts.js +27 -66
- package/build/src/configs/dataStore.d.ts +4 -1
- package/build/src/configs/dataStore.js +5 -2
- package/build/src/configs/factors.d.ts +0 -12
- package/build/src/configs/factors.js +0 -12
- package/build/src/configs/markets.js +147 -0
- package/build/src/configs/tokens.d.ts +5 -2
- package/build/src/configs/tokens.js +297 -221
- package/build/src/index.d.ts +3 -17
- package/build/src/index.js +5 -182
- package/build/src/modules/markets/index.js +2 -3
- package/build/src/modules/markets/markets.spec.js +1 -7
- package/build/src/modules/markets/types.d.ts +8 -0
- package/build/src/modules/oracle.js +1 -16
- package/build/src/modules/orders/orders.d.ts +2 -1
- package/build/src/modules/orders/orders.js +9 -8
- package/build/src/modules/orders/transactions/cancelOrdersTxn.js +1 -1
- package/build/src/modules/orders/transactions/createDecreaseOrderTxn.js +1 -0
- package/build/src/modules/orders/transactions/createIncreaseOrderTxn.d.ts +1 -0
- package/build/src/modules/orders/transactions/createIncreaseOrderTxn.js +3 -1
- package/build/src/modules/orders/transactions/createSwapOrderTxn.js +1 -0
- package/build/src/modules/orders/transactions/createWrapOrUnwrapTxn.d.ts +1 -1
- package/build/src/modules/orders/transactions/updateOrderTxn.d.ts +3 -1
- package/build/src/modules/orders/transactions/updateOrderTxn.js +7 -5
- package/build/src/modules/orders/utils.js +1 -1
- package/build/src/modules/positions/positions.d.ts +1 -1
- package/build/src/modules/positions/positions.js +10 -86
- package/build/src/modules/trades/trades.js +1 -2
- package/build/src/modules/utils/utils.d.ts +20 -0
- package/build/src/modules/utils/utils.js +183 -0
- package/build/src/prebuilt/hashedKinkModelMarketRatesKeys.json +760 -0
- package/build/src/prebuilt/hashedMarketConfigKeys.json +1050 -0
- package/build/src/prebuilt/hashedMarketValuesKeys.json +315 -0
- package/build/src/prebuilt/index.d.ts +8 -2
- package/build/src/prebuilt/index.js +3 -1
- package/build/src/prebuilt/index.ts +19 -2
- package/build/src/types/amounts.d.ts +1 -1
- package/build/src/types/fees.d.ts +1 -2
- package/build/src/types/orders.d.ts +2 -2
- package/build/src/types/positions.d.ts +2 -2
- package/build/src/types/sdk.d.ts +4 -4
- package/build/src/types/syntheticsEvents.d.ts +3 -3
- package/build/src/types/tokens.d.ts +4 -0
- package/build/src/types/trade.d.ts +1 -1
- package/build/src/utils/fees/executionFee.d.ts +1 -5
- package/build/src/utils/fees/executionFee.js +3 -12
- package/build/src/utils/objects.d.ts +0 -5
- package/build/src/utils/objects.js +0 -17
- package/build/src/utils/orders.js +0 -8
- package/build/src/utils/simulateExecuteOrder.js +8 -21
- package/build/src/utils/testUtil.d.ts +2 -3
- package/build/src/utils/testUtil.js +2 -3
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
- package/build/src/configs/subgraph.d.ts +0 -3
- package/build/src/configs/subgraph.js +0 -3
- package/build/src/utils/slidingWindowFallbackSwitcher.d.ts +0 -24
- package/build/src/utils/slidingWindowFallbackSwitcher.js +0 -40
|
@@ -124,12 +124,12 @@
|
|
|
124
124
|
},
|
|
125
125
|
{
|
|
126
126
|
"internalType": "uint256",
|
|
127
|
-
"name": "
|
|
127
|
+
"name": "updatedAtTime",
|
|
128
128
|
"type": "uint256"
|
|
129
129
|
},
|
|
130
130
|
{
|
|
131
131
|
"internalType": "uint256",
|
|
132
|
-
"name": "
|
|
132
|
+
"name": "validFromTime",
|
|
133
133
|
"type": "uint256"
|
|
134
134
|
}
|
|
135
135
|
],
|
|
@@ -334,16 +334,6 @@
|
|
|
334
334
|
"name": "shortTokenClaimableFundingAmountPerSize",
|
|
335
335
|
"type": "uint256"
|
|
336
336
|
},
|
|
337
|
-
{
|
|
338
|
-
"internalType": "uint256",
|
|
339
|
-
"name": "increasedAtBlock",
|
|
340
|
-
"type": "uint256"
|
|
341
|
-
},
|
|
342
|
-
{
|
|
343
|
-
"internalType": "uint256",
|
|
344
|
-
"name": "decreasedAtBlock",
|
|
345
|
-
"type": "uint256"
|
|
346
|
-
},
|
|
347
337
|
{
|
|
348
338
|
"internalType": "uint256",
|
|
349
339
|
"name": "increasedAtTime",
|
|
@@ -400,6 +390,16 @@
|
|
|
400
390
|
"name": "totalRebateFactor",
|
|
401
391
|
"type": "uint256"
|
|
402
392
|
},
|
|
393
|
+
{
|
|
394
|
+
"internalType": "uint256",
|
|
395
|
+
"name": "affiliateRewardFactor",
|
|
396
|
+
"type": "uint256"
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"internalType": "uint256",
|
|
400
|
+
"name": "adjustedAffiliateRewardFactor",
|
|
401
|
+
"type": "uint256"
|
|
402
|
+
},
|
|
403
403
|
{
|
|
404
404
|
"internalType": "uint256",
|
|
405
405
|
"name": "traderDiscountFactor",
|
|
@@ -425,6 +425,28 @@
|
|
|
425
425
|
"name": "referral",
|
|
426
426
|
"type": "tuple"
|
|
427
427
|
},
|
|
428
|
+
{
|
|
429
|
+
"components": [
|
|
430
|
+
{
|
|
431
|
+
"internalType": "uint256",
|
|
432
|
+
"name": "traderTier",
|
|
433
|
+
"type": "uint256"
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
"internalType": "uint256",
|
|
437
|
+
"name": "traderDiscountFactor",
|
|
438
|
+
"type": "uint256"
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
"internalType": "uint256",
|
|
442
|
+
"name": "traderDiscountAmount",
|
|
443
|
+
"type": "uint256"
|
|
444
|
+
}
|
|
445
|
+
],
|
|
446
|
+
"internalType": "struct PositionPricingUtils.PositionProFees",
|
|
447
|
+
"name": "pro",
|
|
448
|
+
"type": "tuple"
|
|
449
|
+
},
|
|
428
450
|
{
|
|
429
451
|
"components": [
|
|
430
452
|
{
|
|
@@ -511,6 +533,33 @@
|
|
|
511
533
|
"name": "ui",
|
|
512
534
|
"type": "tuple"
|
|
513
535
|
},
|
|
536
|
+
{
|
|
537
|
+
"components": [
|
|
538
|
+
{
|
|
539
|
+
"internalType": "uint256",
|
|
540
|
+
"name": "liquidationFeeUsd",
|
|
541
|
+
"type": "uint256"
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
"internalType": "uint256",
|
|
545
|
+
"name": "liquidationFeeAmount",
|
|
546
|
+
"type": "uint256"
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
"internalType": "uint256",
|
|
550
|
+
"name": "liquidationFeeReceiverFactor",
|
|
551
|
+
"type": "uint256"
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
"internalType": "uint256",
|
|
555
|
+
"name": "liquidationFeeAmountForFeeReceiver",
|
|
556
|
+
"type": "uint256"
|
|
557
|
+
}
|
|
558
|
+
],
|
|
559
|
+
"internalType": "struct PositionPricingUtils.PositionLiquidationFees",
|
|
560
|
+
"name": "liquidation",
|
|
561
|
+
"type": "tuple"
|
|
562
|
+
},
|
|
514
563
|
{
|
|
515
564
|
"components": [
|
|
516
565
|
{
|
|
@@ -572,6 +621,11 @@
|
|
|
572
621
|
"internalType": "uint256",
|
|
573
622
|
"name": "totalCostAmount",
|
|
574
623
|
"type": "uint256"
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
"internalType": "uint256",
|
|
627
|
+
"name": "totalDiscountAmount",
|
|
628
|
+
"type": "uint256"
|
|
575
629
|
}
|
|
576
630
|
],
|
|
577
631
|
"internalType": "struct PositionPricingUtils.PositionFees",
|
|
@@ -710,16 +764,6 @@
|
|
|
710
764
|
"name": "shortTokenClaimableFundingAmountPerSize",
|
|
711
765
|
"type": "uint256"
|
|
712
766
|
},
|
|
713
|
-
{
|
|
714
|
-
"internalType": "uint256",
|
|
715
|
-
"name": "increasedAtBlock",
|
|
716
|
-
"type": "uint256"
|
|
717
|
-
},
|
|
718
|
-
{
|
|
719
|
-
"internalType": "uint256",
|
|
720
|
-
"name": "decreasedAtBlock",
|
|
721
|
-
"type": "uint256"
|
|
722
|
-
},
|
|
723
767
|
{
|
|
724
768
|
"internalType": "uint256",
|
|
725
769
|
"name": "increasedAtTime",
|
|
@@ -944,11 +988,6 @@
|
|
|
944
988
|
"name": "minMarketTokens",
|
|
945
989
|
"type": "uint256"
|
|
946
990
|
},
|
|
947
|
-
{
|
|
948
|
-
"internalType": "uint256",
|
|
949
|
-
"name": "updatedAtBlock",
|
|
950
|
-
"type": "uint256"
|
|
951
|
-
},
|
|
952
991
|
{
|
|
953
992
|
"internalType": "uint256",
|
|
954
993
|
"name": "updatedAtTime",
|
|
@@ -2450,12 +2489,12 @@
|
|
|
2450
2489
|
},
|
|
2451
2490
|
{
|
|
2452
2491
|
"internalType": "uint256",
|
|
2453
|
-
"name": "
|
|
2492
|
+
"name": "updatedAtTime",
|
|
2454
2493
|
"type": "uint256"
|
|
2455
2494
|
},
|
|
2456
2495
|
{
|
|
2457
2496
|
"internalType": "uint256",
|
|
2458
|
-
"name": "
|
|
2497
|
+
"name": "validFromTime",
|
|
2459
2498
|
"type": "uint256"
|
|
2460
2499
|
}
|
|
2461
2500
|
],
|
|
@@ -2740,16 +2779,6 @@
|
|
|
2740
2779
|
"name": "shortTokenClaimableFundingAmountPerSize",
|
|
2741
2780
|
"type": "uint256"
|
|
2742
2781
|
},
|
|
2743
|
-
{
|
|
2744
|
-
"internalType": "uint256",
|
|
2745
|
-
"name": "increasedAtBlock",
|
|
2746
|
-
"type": "uint256"
|
|
2747
|
-
},
|
|
2748
|
-
{
|
|
2749
|
-
"internalType": "uint256",
|
|
2750
|
-
"name": "decreasedAtBlock",
|
|
2751
|
-
"type": "uint256"
|
|
2752
|
-
},
|
|
2753
2782
|
{
|
|
2754
2783
|
"internalType": "uint256",
|
|
2755
2784
|
"name": "increasedAtTime",
|
|
@@ -2942,16 +2971,6 @@
|
|
|
2942
2971
|
"name": "shortTokenClaimableFundingAmountPerSize",
|
|
2943
2972
|
"type": "uint256"
|
|
2944
2973
|
},
|
|
2945
|
-
{
|
|
2946
|
-
"internalType": "uint256",
|
|
2947
|
-
"name": "increasedAtBlock",
|
|
2948
|
-
"type": "uint256"
|
|
2949
|
-
},
|
|
2950
|
-
{
|
|
2951
|
-
"internalType": "uint256",
|
|
2952
|
-
"name": "decreasedAtBlock",
|
|
2953
|
-
"type": "uint256"
|
|
2954
|
-
},
|
|
2955
2974
|
{
|
|
2956
2975
|
"internalType": "uint256",
|
|
2957
2976
|
"name": "increasedAtTime",
|
|
@@ -3008,6 +3027,16 @@
|
|
|
3008
3027
|
"name": "totalRebateFactor",
|
|
3009
3028
|
"type": "uint256"
|
|
3010
3029
|
},
|
|
3030
|
+
{
|
|
3031
|
+
"internalType": "uint256",
|
|
3032
|
+
"name": "affiliateRewardFactor",
|
|
3033
|
+
"type": "uint256"
|
|
3034
|
+
},
|
|
3035
|
+
{
|
|
3036
|
+
"internalType": "uint256",
|
|
3037
|
+
"name": "adjustedAffiliateRewardFactor",
|
|
3038
|
+
"type": "uint256"
|
|
3039
|
+
},
|
|
3011
3040
|
{
|
|
3012
3041
|
"internalType": "uint256",
|
|
3013
3042
|
"name": "traderDiscountFactor",
|
|
@@ -3033,6 +3062,28 @@
|
|
|
3033
3062
|
"name": "referral",
|
|
3034
3063
|
"type": "tuple"
|
|
3035
3064
|
},
|
|
3065
|
+
{
|
|
3066
|
+
"components": [
|
|
3067
|
+
{
|
|
3068
|
+
"internalType": "uint256",
|
|
3069
|
+
"name": "traderTier",
|
|
3070
|
+
"type": "uint256"
|
|
3071
|
+
},
|
|
3072
|
+
{
|
|
3073
|
+
"internalType": "uint256",
|
|
3074
|
+
"name": "traderDiscountFactor",
|
|
3075
|
+
"type": "uint256"
|
|
3076
|
+
},
|
|
3077
|
+
{
|
|
3078
|
+
"internalType": "uint256",
|
|
3079
|
+
"name": "traderDiscountAmount",
|
|
3080
|
+
"type": "uint256"
|
|
3081
|
+
}
|
|
3082
|
+
],
|
|
3083
|
+
"internalType": "struct PositionPricingUtils.PositionProFees",
|
|
3084
|
+
"name": "pro",
|
|
3085
|
+
"type": "tuple"
|
|
3086
|
+
},
|
|
3036
3087
|
{
|
|
3037
3088
|
"components": [
|
|
3038
3089
|
{
|
|
@@ -3119,6 +3170,33 @@
|
|
|
3119
3170
|
"name": "ui",
|
|
3120
3171
|
"type": "tuple"
|
|
3121
3172
|
},
|
|
3173
|
+
{
|
|
3174
|
+
"components": [
|
|
3175
|
+
{
|
|
3176
|
+
"internalType": "uint256",
|
|
3177
|
+
"name": "liquidationFeeUsd",
|
|
3178
|
+
"type": "uint256"
|
|
3179
|
+
},
|
|
3180
|
+
{
|
|
3181
|
+
"internalType": "uint256",
|
|
3182
|
+
"name": "liquidationFeeAmount",
|
|
3183
|
+
"type": "uint256"
|
|
3184
|
+
},
|
|
3185
|
+
{
|
|
3186
|
+
"internalType": "uint256",
|
|
3187
|
+
"name": "liquidationFeeReceiverFactor",
|
|
3188
|
+
"type": "uint256"
|
|
3189
|
+
},
|
|
3190
|
+
{
|
|
3191
|
+
"internalType": "uint256",
|
|
3192
|
+
"name": "liquidationFeeAmountForFeeReceiver",
|
|
3193
|
+
"type": "uint256"
|
|
3194
|
+
}
|
|
3195
|
+
],
|
|
3196
|
+
"internalType": "struct PositionPricingUtils.PositionLiquidationFees",
|
|
3197
|
+
"name": "liquidation",
|
|
3198
|
+
"type": "tuple"
|
|
3199
|
+
},
|
|
3122
3200
|
{
|
|
3123
3201
|
"components": [
|
|
3124
3202
|
{
|
|
@@ -3180,6 +3258,11 @@
|
|
|
3180
3258
|
"internalType": "uint256",
|
|
3181
3259
|
"name": "totalCostAmount",
|
|
3182
3260
|
"type": "uint256"
|
|
3261
|
+
},
|
|
3262
|
+
{
|
|
3263
|
+
"internalType": "uint256",
|
|
3264
|
+
"name": "totalDiscountAmount",
|
|
3265
|
+
"type": "uint256"
|
|
3183
3266
|
}
|
|
3184
3267
|
],
|
|
3185
3268
|
"internalType": "struct PositionPricingUtils.PositionFees",
|
|
@@ -3378,16 +3461,6 @@
|
|
|
3378
3461
|
"name": "shortTokenClaimableFundingAmountPerSize",
|
|
3379
3462
|
"type": "uint256"
|
|
3380
3463
|
},
|
|
3381
|
-
{
|
|
3382
|
-
"internalType": "uint256",
|
|
3383
|
-
"name": "increasedAtBlock",
|
|
3384
|
-
"type": "uint256"
|
|
3385
|
-
},
|
|
3386
|
-
{
|
|
3387
|
-
"internalType": "uint256",
|
|
3388
|
-
"name": "decreasedAtBlock",
|
|
3389
|
-
"type": "uint256"
|
|
3390
|
-
},
|
|
3391
3464
|
{
|
|
3392
3465
|
"internalType": "uint256",
|
|
3393
3466
|
"name": "increasedAtTime",
|
|
@@ -3444,6 +3517,16 @@
|
|
|
3444
3517
|
"name": "totalRebateFactor",
|
|
3445
3518
|
"type": "uint256"
|
|
3446
3519
|
},
|
|
3520
|
+
{
|
|
3521
|
+
"internalType": "uint256",
|
|
3522
|
+
"name": "affiliateRewardFactor",
|
|
3523
|
+
"type": "uint256"
|
|
3524
|
+
},
|
|
3525
|
+
{
|
|
3526
|
+
"internalType": "uint256",
|
|
3527
|
+
"name": "adjustedAffiliateRewardFactor",
|
|
3528
|
+
"type": "uint256"
|
|
3529
|
+
},
|
|
3447
3530
|
{
|
|
3448
3531
|
"internalType": "uint256",
|
|
3449
3532
|
"name": "traderDiscountFactor",
|
|
@@ -3469,6 +3552,28 @@
|
|
|
3469
3552
|
"name": "referral",
|
|
3470
3553
|
"type": "tuple"
|
|
3471
3554
|
},
|
|
3555
|
+
{
|
|
3556
|
+
"components": [
|
|
3557
|
+
{
|
|
3558
|
+
"internalType": "uint256",
|
|
3559
|
+
"name": "traderTier",
|
|
3560
|
+
"type": "uint256"
|
|
3561
|
+
},
|
|
3562
|
+
{
|
|
3563
|
+
"internalType": "uint256",
|
|
3564
|
+
"name": "traderDiscountFactor",
|
|
3565
|
+
"type": "uint256"
|
|
3566
|
+
},
|
|
3567
|
+
{
|
|
3568
|
+
"internalType": "uint256",
|
|
3569
|
+
"name": "traderDiscountAmount",
|
|
3570
|
+
"type": "uint256"
|
|
3571
|
+
}
|
|
3572
|
+
],
|
|
3573
|
+
"internalType": "struct PositionPricingUtils.PositionProFees",
|
|
3574
|
+
"name": "pro",
|
|
3575
|
+
"type": "tuple"
|
|
3576
|
+
},
|
|
3472
3577
|
{
|
|
3473
3578
|
"components": [
|
|
3474
3579
|
{
|
|
@@ -3555,6 +3660,33 @@
|
|
|
3555
3660
|
"name": "ui",
|
|
3556
3661
|
"type": "tuple"
|
|
3557
3662
|
},
|
|
3663
|
+
{
|
|
3664
|
+
"components": [
|
|
3665
|
+
{
|
|
3666
|
+
"internalType": "uint256",
|
|
3667
|
+
"name": "liquidationFeeUsd",
|
|
3668
|
+
"type": "uint256"
|
|
3669
|
+
},
|
|
3670
|
+
{
|
|
3671
|
+
"internalType": "uint256",
|
|
3672
|
+
"name": "liquidationFeeAmount",
|
|
3673
|
+
"type": "uint256"
|
|
3674
|
+
},
|
|
3675
|
+
{
|
|
3676
|
+
"internalType": "uint256",
|
|
3677
|
+
"name": "liquidationFeeReceiverFactor",
|
|
3678
|
+
"type": "uint256"
|
|
3679
|
+
},
|
|
3680
|
+
{
|
|
3681
|
+
"internalType": "uint256",
|
|
3682
|
+
"name": "liquidationFeeAmountForFeeReceiver",
|
|
3683
|
+
"type": "uint256"
|
|
3684
|
+
}
|
|
3685
|
+
],
|
|
3686
|
+
"internalType": "struct PositionPricingUtils.PositionLiquidationFees",
|
|
3687
|
+
"name": "liquidation",
|
|
3688
|
+
"type": "tuple"
|
|
3689
|
+
},
|
|
3558
3690
|
{
|
|
3559
3691
|
"components": [
|
|
3560
3692
|
{
|
|
@@ -3616,6 +3748,11 @@
|
|
|
3616
3748
|
"internalType": "uint256",
|
|
3617
3749
|
"name": "totalCostAmount",
|
|
3618
3750
|
"type": "uint256"
|
|
3751
|
+
},
|
|
3752
|
+
{
|
|
3753
|
+
"internalType": "uint256",
|
|
3754
|
+
"name": "totalDiscountAmount",
|
|
3755
|
+
"type": "uint256"
|
|
3619
3756
|
}
|
|
3620
3757
|
],
|
|
3621
3758
|
"internalType": "struct PositionPricingUtils.PositionFees",
|
|
@@ -4207,11 +4344,6 @@
|
|
|
4207
4344
|
"name": "minShortTokenAmount",
|
|
4208
4345
|
"type": "uint256"
|
|
4209
4346
|
},
|
|
4210
|
-
{
|
|
4211
|
-
"internalType": "uint256",
|
|
4212
|
-
"name": "updatedAtBlock",
|
|
4213
|
-
"type": "uint256"
|
|
4214
|
-
},
|
|
4215
4347
|
{
|
|
4216
4348
|
"internalType": "uint256",
|
|
4217
4349
|
"name": "updatedAtTime",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ARBITRUM,
|
|
1
|
+
import { ARBITRUM, AVALANCHE, AVALANCHE_FUJI } from "./chains";
|
|
2
2
|
export const BATCH_CONFIGS = {
|
|
3
3
|
[ARBITRUM]: {
|
|
4
4
|
http: {
|
|
@@ -36,16 +36,4 @@ export const BATCH_CONFIGS = {
|
|
|
36
36
|
},
|
|
37
37
|
},
|
|
38
38
|
},
|
|
39
|
-
[ARBITRUM_GOERLI]: {
|
|
40
|
-
http: {
|
|
41
|
-
batchSize: 0,
|
|
42
|
-
wait: 0,
|
|
43
|
-
},
|
|
44
|
-
client: {
|
|
45
|
-
multicall: {
|
|
46
|
-
batchSize: 1024 * 1024,
|
|
47
|
-
wait: 0,
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
39
|
};
|
|
@@ -2,7 +2,6 @@ import { Chain } from "viem/chains";
|
|
|
2
2
|
export declare const AVALANCHE = 43114;
|
|
3
3
|
export declare const AVALANCHE_FUJI = 43113;
|
|
4
4
|
export declare const ARBITRUM = 42161;
|
|
5
|
-
export declare const ARBITRUM_GOERLI = 421613;
|
|
6
5
|
export declare const SUPPORTED_CHAIN_IDS: number[];
|
|
7
6
|
export declare const HIGH_EXECUTION_FEES_MAP: {
|
|
8
7
|
42161: number;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { arbitrum,
|
|
1
|
+
import { arbitrum, avalanche, avalancheFuji } from "viem/chains";
|
|
2
2
|
export const AVALANCHE = 43114;
|
|
3
3
|
export const AVALANCHE_FUJI = 43113;
|
|
4
4
|
export const ARBITRUM = 42161;
|
|
5
|
-
export const ARBITRUM_GOERLI = 421613;
|
|
6
5
|
export const SUPPORTED_CHAIN_IDS = [ARBITRUM, AVALANCHE];
|
|
7
6
|
export const HIGH_EXECUTION_FEES_MAP = {
|
|
8
7
|
[ARBITRUM]: 5, // 5 USD
|
|
@@ -54,7 +53,6 @@ export const GAS_PRICE_BUFFER_MAP = {
|
|
|
54
53
|
};
|
|
55
54
|
const CHAIN_BY_CHAIN_ID = {
|
|
56
55
|
[AVALANCHE_FUJI]: avalancheFuji,
|
|
57
|
-
[ARBITRUM_GOERLI]: arbitrumGoerli,
|
|
58
56
|
[ARBITRUM]: arbitrum,
|
|
59
57
|
[AVALANCHE]: avalanche,
|
|
60
58
|
};
|
|
@@ -83,8 +81,4 @@ export const EXECUTION_FEE_CONFIG_V2 = {
|
|
|
83
81
|
shouldUseMaxPriorityFeePerGas: false,
|
|
84
82
|
defaultBufferBps: 3000, // 30%
|
|
85
83
|
},
|
|
86
|
-
[ARBITRUM_GOERLI]: {
|
|
87
|
-
shouldUseMaxPriorityFeePerGas: false,
|
|
88
|
-
defaultBufferBps: 1000, // 10%
|
|
89
|
-
},
|
|
90
84
|
};
|
|
@@ -1,54 +1,12 @@
|
|
|
1
|
-
import { ARBITRUM, ARBITRUM_GOERLI, AVALANCHE, AVALANCHE_FUJI } from "./chains";
|
|
2
1
|
import { zeroAddress } from "viem";
|
|
2
|
+
import { ARBITRUM, AVALANCHE, AVALANCHE_FUJI } from "./chains";
|
|
3
|
+
export const XGMT_EXCLUDED_ACCOUNTS = [
|
|
4
|
+
"0x330eef6b9b1ea6edd620c825c9919dc8b611d5d5",
|
|
5
|
+
"0xd9b1c23411adbb984b1c4be515fafc47a12898b2",
|
|
6
|
+
"0xa633158288520807f91ccc98aa58e0ea43acb400",
|
|
7
|
+
"0xffd0a93b4362052a336a7b22494f1b77018dd34b",
|
|
8
|
+
];
|
|
3
9
|
const CONTRACTS = {
|
|
4
|
-
[ARBITRUM_GOERLI]: {
|
|
5
|
-
// arbitrum testnet
|
|
6
|
-
Vault: zeroAddress,
|
|
7
|
-
Router: zeroAddress,
|
|
8
|
-
VaultReader: zeroAddress,
|
|
9
|
-
Reader: zeroAddress,
|
|
10
|
-
GlpManager: zeroAddress,
|
|
11
|
-
RewardRouter: zeroAddress,
|
|
12
|
-
RewardReader: zeroAddress,
|
|
13
|
-
GlpRewardRouter: zeroAddress,
|
|
14
|
-
NATIVE_TOKEN: "0xe39Ab88f8A4777030A534146A9Ca3B52bd5D43A3",
|
|
15
|
-
GLP: zeroAddress,
|
|
16
|
-
GMX: zeroAddress,
|
|
17
|
-
ES_GMX: zeroAddress,
|
|
18
|
-
BN_GMX: zeroAddress,
|
|
19
|
-
USDG: zeroAddress,
|
|
20
|
-
ES_GMX_IOU: zeroAddress,
|
|
21
|
-
StakedGmxTracker: zeroAddress,
|
|
22
|
-
BonusGmxTracker: zeroAddress,
|
|
23
|
-
FeeGmxTracker: zeroAddress,
|
|
24
|
-
StakedGlpTracker: zeroAddress,
|
|
25
|
-
FeeGlpTracker: zeroAddress,
|
|
26
|
-
StakedGmxDistributor: zeroAddress,
|
|
27
|
-
StakedGlpDistributor: zeroAddress,
|
|
28
|
-
GmxVester: zeroAddress,
|
|
29
|
-
GlpVester: zeroAddress,
|
|
30
|
-
AffiliateVester: zeroAddress,
|
|
31
|
-
OrderBook: zeroAddress,
|
|
32
|
-
OrderExecutor: zeroAddress,
|
|
33
|
-
OrderBookReader: zeroAddress,
|
|
34
|
-
PositionRouter: zeroAddress,
|
|
35
|
-
PositionManager: zeroAddress,
|
|
36
|
-
TraderJoeGmxAvaxPool: zeroAddress,
|
|
37
|
-
ReferralStorage: "0x995E905E471D53B7c5d0dbf6406860Cb3C029e95",
|
|
38
|
-
ReferralReader: zeroAddress,
|
|
39
|
-
// Synthetics
|
|
40
|
-
DataStore: "0xbA2314b0f71ebC705aeEBeA672cc3bcEc510D03b",
|
|
41
|
-
EventEmitter: "0x2fbE45fCb58B7106CF0a3Be9225D5Ed5A1004cc4",
|
|
42
|
-
ExchangeRouter: "0xFE98518C9c8F1c5a216E999816c2dE3199f295D2",
|
|
43
|
-
SubaccountRouter: "0x4Ae6ecDD55ee1066477Ee4B5Fc9f4D04C4CE66E9",
|
|
44
|
-
DepositVault: "0x838a9bdf8736eD522A60F5f715e4F3FC2BC91A08",
|
|
45
|
-
WithdrawalVault: "0xaAac001C2a2727Ff2d484C4Ad7d2079C7094e7Ef",
|
|
46
|
-
OrderVault: "0x82aFd2590814a7Ce3d7ea6b63F80481F8b227bA9",
|
|
47
|
-
SyntheticsReader: "0xab747a7bb64B74D78C6527C1F148808a19120475",
|
|
48
|
-
SyntheticsRouter: "0xa960786Bc30F8587279df6116F9E0B15C5b034dE",
|
|
49
|
-
Timelock: zeroAddress,
|
|
50
|
-
Multicall: "0x6d85594c9BD6b0833bC85AE62B360654A1e52D70",
|
|
51
|
-
},
|
|
52
10
|
[ARBITRUM]: {
|
|
53
11
|
// arbitrum mainnet
|
|
54
12
|
Vault: "0x489ee077994B6658eAfA855C308275EAd8097C4A",
|
|
@@ -56,7 +14,7 @@ const CONTRACTS = {
|
|
|
56
14
|
VaultReader: "0xfebB9f4CAC4cD523598fE1C5771181440143F24A",
|
|
57
15
|
Reader: "0x2b43c90D1B727cEe1Df34925bcd5Ace52Ec37694",
|
|
58
16
|
GlpManager: "0x3963FfC9dff443c2A94f21b129D429891E32ec18",
|
|
59
|
-
RewardRouter: "
|
|
17
|
+
RewardRouter: "0x5E4766F932ce00aA4a1A82d3Da85adf15C5694A1",
|
|
60
18
|
GlpRewardRouter: "0xB95DB5B167D75e6d04227CfFFA61069348d271F5",
|
|
61
19
|
RewardReader: "0x8BFb8e82Ee4569aee78D03235ff465Bd436D40E0",
|
|
62
20
|
GovToken: "0x2A29D3a792000750807cc401806d6fd539928481",
|
|
@@ -72,6 +30,7 @@ const CONTRACTS = {
|
|
|
72
30
|
FeeGmxTracker: "0xd2D1162512F927a7e282Ef43a362659E4F2a728F",
|
|
73
31
|
StakedGlpTracker: "0x1aDDD80E6039594eE970E5872D247bf0414C8903",
|
|
74
32
|
FeeGlpTracker: "0x4e971a87900b931fF39d1Aad67697F49835400b6",
|
|
33
|
+
ExtendedGmxTracker: "0x0755D33e45eD2B874c9ebF5B279023c8Bd1e5E93",
|
|
75
34
|
StakedGmxDistributor: "0x23208B91A98c7C1CD9FE63085BFf68311494F193",
|
|
76
35
|
StakedGlpDistributor: "0x60519b48ec4183a61ca2B8e37869E675FD203b34",
|
|
77
36
|
GmxVester: "0x199070DDfd1CFb69173aa2F7e20906F26B363004",
|
|
@@ -89,16 +48,16 @@ const CONTRACTS = {
|
|
|
89
48
|
// Synthetics
|
|
90
49
|
DataStore: "0xFD70de6b91282D8017aA4E741e9Ae325CAb992d8",
|
|
91
50
|
EventEmitter: "0xC8ee91A54287DB53897056e12D9819156D3822Fb",
|
|
92
|
-
SubaccountRouter: "
|
|
93
|
-
ExchangeRouter: "
|
|
51
|
+
SubaccountRouter: "0xa329221a77BE08485f59310b873b14815c82E10D",
|
|
52
|
+
ExchangeRouter: "0x900173A66dbD345006C51fA35fA3aB760FcD843b",
|
|
94
53
|
DepositVault: "0xF89e77e8Dc11691C9e8757e84aaFbCD8A67d7A55",
|
|
95
54
|
WithdrawalVault: "0x0628D46b5D145f183AdB6Ef1f2c97eD1C4701C55",
|
|
96
55
|
OrderVault: "0x31eF83a530Fde1B38EE9A18093A333D8Bbbc40D5",
|
|
97
56
|
ShiftVault: "0xfe99609C4AA83ff6816b64563Bdffd7fa68753Ab",
|
|
98
|
-
SyntheticsReader: "
|
|
57
|
+
SyntheticsReader: "0x0537C767cDAC0726c76Bb89e92904fe28fd02fE1",
|
|
99
58
|
SyntheticsRouter: "0x7452c558d45f8afC8c83dAe62C3f8A5BE19c71f6",
|
|
100
|
-
GlvReader: "
|
|
101
|
-
GlvRouter: "
|
|
59
|
+
GlvReader: "0x6a9505D0B44cFA863d9281EA5B0b34cB36243b45",
|
|
60
|
+
GlvRouter: "0x105b5aFe50FBCe7759051974fB1710ce331C77B3",
|
|
102
61
|
GlvVault: "0x393053B58f9678C9c28c2cE941fF6cac49C3F8f9",
|
|
103
62
|
Multicall: "0x842ec2c7d803033edf55e478f461fc547bc54eb2",
|
|
104
63
|
},
|
|
@@ -109,7 +68,7 @@ const CONTRACTS = {
|
|
|
109
68
|
VaultReader: "0x66eC8fc33A26feAEAe156afA3Cb46923651F6f0D",
|
|
110
69
|
Reader: "0x2eFEE1950ededC65De687b40Fd30a7B5f4544aBd",
|
|
111
70
|
GlpManager: "0xD152c7F25db7F4B95b7658323c5F33d176818EE4",
|
|
112
|
-
RewardRouter: "
|
|
71
|
+
RewardRouter: "0x091eD806490Cc58Fd514441499e58984cCce0630",
|
|
113
72
|
GlpRewardRouter: "0xB70B91CE0771d3f4c81D87660f71Da31d48eB3B3",
|
|
114
73
|
RewardReader: "0x04Fc11Bd28763872d143637a7c768bD96E44c1b6",
|
|
115
74
|
GovToken: "0x0ff183E29f1924ad10475506D7722169010CecCb",
|
|
@@ -125,6 +84,7 @@ const CONTRACTS = {
|
|
|
125
84
|
FeeGmxTracker: "0x4d268a7d4C16ceB5a606c173Bd974984343fea13",
|
|
126
85
|
StakedGlpTracker: "0x9e295B5B976a184B14aD8cd72413aD846C299660",
|
|
127
86
|
FeeGlpTracker: "0xd2D1162512F927a7e282Ef43a362659E4F2a728F",
|
|
87
|
+
ExtendedGmxTracker: "0xB0D12Bf95CC1341d6C845C978daaf36F70b5910d",
|
|
128
88
|
StakedGmxDistributor: "0xfc5A1A6EB076a2C7aD06eD22C90d7E710E35ad0a",
|
|
129
89
|
StakedGlpDistributor: "0xDd593Cf40734199afc9207eBe9ffF23dA4Bf7720",
|
|
130
90
|
GmxVester: "0x472361d3cA5F49c8E633FB50385BfaD1e018b445",
|
|
@@ -142,16 +102,16 @@ const CONTRACTS = {
|
|
|
142
102
|
// Synthetics
|
|
143
103
|
DataStore: "0x2F0b22339414ADeD7D5F06f9D604c7fF5b2fe3f6",
|
|
144
104
|
EventEmitter: "0xDb17B211c34240B014ab6d61d4A31FA0C0e20c26",
|
|
145
|
-
SubaccountRouter: "
|
|
146
|
-
ExchangeRouter: "
|
|
105
|
+
SubaccountRouter: "0x5aEb6AD978f59e220aA9099e09574e1c5E03AafD",
|
|
106
|
+
ExchangeRouter: "0x2b76df209E1343da5698AF0f8757f6170162e78b",
|
|
147
107
|
DepositVault: "0x90c670825d0C62ede1c5ee9571d6d9a17A722DFF",
|
|
148
108
|
WithdrawalVault: "0xf5F30B10141E1F63FC11eD772931A8294a591996",
|
|
149
109
|
OrderVault: "0xD3D60D22d415aD43b7e64b510D86A30f19B1B12C",
|
|
150
110
|
ShiftVault: "0x7fC46CCb386e9bbBFB49A2639002734C3Ec52b39",
|
|
151
|
-
SyntheticsReader: "
|
|
111
|
+
SyntheticsReader: "0x618fCEe30D9A26e8533C3B244CAd2D6486AFf655",
|
|
152
112
|
SyntheticsRouter: "0x820F5FfC5b525cD4d88Cd91aCf2c28F16530Cc68",
|
|
153
|
-
GlvReader: "
|
|
154
|
-
GlvRouter: "
|
|
113
|
+
GlvReader: "0xae9596a1C438675AcC75f69d32E21Ac9c8fF99bD",
|
|
114
|
+
GlvRouter: "0x6BE75346C0262015E45c6fC0e3268BBa73e87D1a",
|
|
155
115
|
GlvVault: "0x527FB0bCfF63C47761039bB386cFE181A92a4701",
|
|
156
116
|
Multicall: "0xcA11bde05977b3631167028862bE2a173976CA11",
|
|
157
117
|
},
|
|
@@ -176,6 +136,7 @@ const CONTRACTS = {
|
|
|
176
136
|
FeeGmxTracker: zeroAddress,
|
|
177
137
|
StakedGlpTracker: zeroAddress,
|
|
178
138
|
FeeGlpTracker: zeroAddress,
|
|
139
|
+
ExtendedGmxTracker: zeroAddress,
|
|
179
140
|
StakedGmxDistributor: zeroAddress,
|
|
180
141
|
StakedGlpDistributor: zeroAddress,
|
|
181
142
|
GmxVester: zeroAddress,
|
|
@@ -192,17 +153,17 @@ const CONTRACTS = {
|
|
|
192
153
|
// Synthetics
|
|
193
154
|
DataStore: "0xEA1BFb4Ea9A412dCCd63454AbC127431eBB0F0d4",
|
|
194
155
|
EventEmitter: "0xc67D98AC5803aFD776958622CeEE332A0B2CabB9",
|
|
195
|
-
ExchangeRouter: "
|
|
196
|
-
SubaccountRouter: "
|
|
156
|
+
ExchangeRouter: "0x52A1c10c462ca4e5219d0Eb4da5052cc73F9050D",
|
|
157
|
+
SubaccountRouter: "0x0595f01860aa5c4C6091EED096515b4b9FE372CE",
|
|
197
158
|
DepositVault: "0x2964d242233036C8BDC1ADC795bB4DeA6fb929f2",
|
|
198
159
|
WithdrawalVault: "0x74d49B6A630Bf519bDb6E4efc4354C420418A6A2",
|
|
199
160
|
OrderVault: "0x25D23e8E655727F2687CC808BB9589525A6F599B",
|
|
200
161
|
ShiftVault: "0x257D0EA0B040E2Cd1D456fB4C66d7814102aD346",
|
|
201
|
-
SyntheticsReader: "
|
|
162
|
+
SyntheticsReader: "0x16Fb5b8846fbfAe09c034fCdF3D3F9492484DA80",
|
|
202
163
|
SyntheticsRouter: "0x5e7d61e4C52123ADF651961e4833aCc349b61491",
|
|
203
164
|
Timelock: zeroAddress,
|
|
204
|
-
GlvReader: "
|
|
205
|
-
GlvRouter: "
|
|
165
|
+
GlvReader: "0x4599Ed5939C673505B7AFcd020E1d603b0dCAf69",
|
|
166
|
+
GlvRouter: "0x377d979AB35Cd848497707ffa6Ee91783f925b80",
|
|
206
167
|
GlvVault: "0x76f93b5240DF811a3fc32bEDd58daA5784e46C96",
|
|
207
168
|
Multicall: "0x0f53e512b49202a37c81c6085417C9a9005F2196",
|
|
208
169
|
},
|
|
@@ -84,6 +84,9 @@ export declare const GLV_DEPOSIT_GAS_LIMIT: string;
|
|
|
84
84
|
export declare const GLV_WITHDRAWAL_GAS_LIMIT: string;
|
|
85
85
|
export declare const GLV_PER_MARKET_GAS_LIMIT: string;
|
|
86
86
|
export declare const MAX_AUTO_CANCEL_ORDERS_KEY: string;
|
|
87
|
+
export declare const OPTIMAL_USAGE_FACTOR: string;
|
|
88
|
+
export declare const BASE_BORROWING_FACTOR: string;
|
|
89
|
+
export declare const ABOVE_OPTIMAL_USAGE_BORROWING_FACTOR: string;
|
|
87
90
|
export declare function glvShiftLastExecutedAtKey(glvAddress: string): string;
|
|
88
91
|
export declare function glvShiftMinIntervalKey(glvAddress: string): string;
|
|
89
92
|
export declare function glvMaxMarketTokenBalanceUsdKey(glvAddress: string, market: string): string;
|
|
@@ -121,7 +124,7 @@ export declare function positionImpactPoolDistributionRateKey(market: string): s
|
|
|
121
124
|
export declare function maxPositionImpactFactorForLiquidationsKey(market: string): string;
|
|
122
125
|
export declare function swapImpactPoolAmountKey(market: string, token: string): string;
|
|
123
126
|
export declare function orderKey(dataStoreAddress: string, nonce: bigint): string;
|
|
124
|
-
export declare function depositGasLimitKey(
|
|
127
|
+
export declare function depositGasLimitKey(): string;
|
|
125
128
|
export declare function withdrawalGasLimitKey(): string;
|
|
126
129
|
export declare function shiftGasLimitKey(): string;
|
|
127
130
|
export declare function singleSwapGasLimitKey(): string;
|