@drift-labs/sdk 2.149.1 → 2.150.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env +4 -0
- package/VERSION +1 -1
- package/lib/browser/constants/perpMarkets.js +11 -0
- package/lib/browser/constants/spotMarkets.js +13 -0
- package/lib/browser/decode/user.js +2 -2
- package/lib/browser/driftClient.d.ts +20 -8
- package/lib/browser/driftClient.js +216 -17
- package/lib/browser/idl/drift.json +225 -21
- package/lib/browser/math/margin.js +2 -1
- package/lib/browser/math/position.d.ts +1 -0
- package/lib/browser/math/position.js +10 -2
- package/lib/browser/math/superStake.d.ts +3 -2
- package/lib/browser/types.d.ts +12 -6
- package/lib/browser/types.js +11 -6
- package/lib/browser/user.d.ts +3 -2
- package/lib/browser/user.js +24 -8
- package/lib/node/constants/perpMarkets.d.ts.map +1 -1
- package/lib/node/constants/perpMarkets.js +11 -0
- package/lib/node/constants/spotMarkets.d.ts.map +1 -1
- package/lib/node/constants/spotMarkets.js +13 -0
- package/lib/node/decode/user.d.ts.map +1 -1
- package/lib/node/decode/user.js +2 -2
- package/lib/node/driftClient.d.ts +20 -8
- package/lib/node/driftClient.d.ts.map +1 -1
- package/lib/node/driftClient.js +216 -17
- package/lib/node/idl/drift.json +225 -21
- package/lib/node/math/margin.d.ts.map +1 -1
- package/lib/node/math/margin.js +2 -1
- package/lib/node/math/position.d.ts +1 -0
- package/lib/node/math/position.d.ts.map +1 -1
- package/lib/node/math/position.js +10 -2
- package/lib/node/math/spotBalance.d.ts.map +1 -1
- package/lib/node/math/superStake.d.ts +3 -2
- package/lib/node/math/superStake.d.ts.map +1 -1
- package/lib/node/types.d.ts +12 -6
- package/lib/node/types.d.ts.map +1 -1
- package/lib/node/types.js +11 -6
- package/lib/node/user.d.ts +3 -2
- package/lib/node/user.d.ts.map +1 -1
- package/lib/node/user.js +24 -8
- package/package.json +1 -1
- package/scripts/deposit-isolated-positions.ts +110 -0
- package/scripts/single-grpc-client-test.ts +71 -21
- package/scripts/withdraw-isolated-positions.ts +174 -0
- package/src/constants/perpMarkets.ts +11 -0
- package/src/constants/spotMarkets.ts +14 -0
- package/src/decode/user.ts +2 -3
- package/src/driftClient.ts +464 -41
- package/src/idl/drift.json +226 -22
- package/src/margin/README.md +143 -0
- package/src/math/margin.ts +3 -4
- package/src/math/position.ts +12 -2
- package/src/math/spotBalance.ts +0 -1
- package/src/types.ts +15 -7
- package/src/user.ts +49 -15
- package/tests/amm/test.ts +1 -1
- package/tests/dlob/helpers.ts +1 -1
- package/tests/user/test.ts +0 -7
|
@@ -652,6 +652,163 @@
|
|
|
652
652
|
}
|
|
653
653
|
]
|
|
654
654
|
},
|
|
655
|
+
{
|
|
656
|
+
"name": "depositIntoIsolatedPerpPosition",
|
|
657
|
+
"accounts": [
|
|
658
|
+
{
|
|
659
|
+
"name": "state",
|
|
660
|
+
"isMut": false,
|
|
661
|
+
"isSigner": false
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
"name": "user",
|
|
665
|
+
"isMut": true,
|
|
666
|
+
"isSigner": false
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
"name": "userStats",
|
|
670
|
+
"isMut": true,
|
|
671
|
+
"isSigner": false
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
"name": "authority",
|
|
675
|
+
"isMut": false,
|
|
676
|
+
"isSigner": true
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
"name": "spotMarketVault",
|
|
680
|
+
"isMut": true,
|
|
681
|
+
"isSigner": false
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
"name": "userTokenAccount",
|
|
685
|
+
"isMut": true,
|
|
686
|
+
"isSigner": false
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
"name": "tokenProgram",
|
|
690
|
+
"isMut": false,
|
|
691
|
+
"isSigner": false
|
|
692
|
+
}
|
|
693
|
+
],
|
|
694
|
+
"args": [
|
|
695
|
+
{
|
|
696
|
+
"name": "spotMarketIndex",
|
|
697
|
+
"type": "u16"
|
|
698
|
+
},
|
|
699
|
+
{
|
|
700
|
+
"name": "perpMarketIndex",
|
|
701
|
+
"type": "u16"
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
"name": "amount",
|
|
705
|
+
"type": "u64"
|
|
706
|
+
}
|
|
707
|
+
]
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
"name": "transferIsolatedPerpPositionDeposit",
|
|
711
|
+
"accounts": [
|
|
712
|
+
{
|
|
713
|
+
"name": "user",
|
|
714
|
+
"isMut": true,
|
|
715
|
+
"isSigner": false
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
"name": "userStats",
|
|
719
|
+
"isMut": true,
|
|
720
|
+
"isSigner": false
|
|
721
|
+
},
|
|
722
|
+
{
|
|
723
|
+
"name": "authority",
|
|
724
|
+
"isMut": false,
|
|
725
|
+
"isSigner": true
|
|
726
|
+
},
|
|
727
|
+
{
|
|
728
|
+
"name": "state",
|
|
729
|
+
"isMut": false,
|
|
730
|
+
"isSigner": false
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
"name": "spotMarketVault",
|
|
734
|
+
"isMut": false,
|
|
735
|
+
"isSigner": false
|
|
736
|
+
}
|
|
737
|
+
],
|
|
738
|
+
"args": [
|
|
739
|
+
{
|
|
740
|
+
"name": "spotMarketIndex",
|
|
741
|
+
"type": "u16"
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
"name": "perpMarketIndex",
|
|
745
|
+
"type": "u16"
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
"name": "amount",
|
|
749
|
+
"type": "i64"
|
|
750
|
+
}
|
|
751
|
+
]
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
"name": "withdrawFromIsolatedPerpPosition",
|
|
755
|
+
"accounts": [
|
|
756
|
+
{
|
|
757
|
+
"name": "state",
|
|
758
|
+
"isMut": false,
|
|
759
|
+
"isSigner": false
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
"name": "user",
|
|
763
|
+
"isMut": true,
|
|
764
|
+
"isSigner": false
|
|
765
|
+
},
|
|
766
|
+
{
|
|
767
|
+
"name": "userStats",
|
|
768
|
+
"isMut": true,
|
|
769
|
+
"isSigner": false
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
"name": "authority",
|
|
773
|
+
"isMut": false,
|
|
774
|
+
"isSigner": true
|
|
775
|
+
},
|
|
776
|
+
{
|
|
777
|
+
"name": "spotMarketVault",
|
|
778
|
+
"isMut": true,
|
|
779
|
+
"isSigner": false
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
"name": "driftSigner",
|
|
783
|
+
"isMut": false,
|
|
784
|
+
"isSigner": false
|
|
785
|
+
},
|
|
786
|
+
{
|
|
787
|
+
"name": "userTokenAccount",
|
|
788
|
+
"isMut": true,
|
|
789
|
+
"isSigner": false
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
"name": "tokenProgram",
|
|
793
|
+
"isMut": false,
|
|
794
|
+
"isSigner": false
|
|
795
|
+
}
|
|
796
|
+
],
|
|
797
|
+
"args": [
|
|
798
|
+
{
|
|
799
|
+
"name": "spotMarketIndex",
|
|
800
|
+
"type": "u16"
|
|
801
|
+
},
|
|
802
|
+
{
|
|
803
|
+
"name": "perpMarketIndex",
|
|
804
|
+
"type": "u16"
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
"name": "amount",
|
|
808
|
+
"type": "u64"
|
|
809
|
+
}
|
|
810
|
+
]
|
|
811
|
+
},
|
|
655
812
|
{
|
|
656
813
|
"name": "placePerpOrder",
|
|
657
814
|
"accounts": [
|
|
@@ -14412,13 +14569,13 @@
|
|
|
14412
14569
|
"type": "u64"
|
|
14413
14570
|
},
|
|
14414
14571
|
{
|
|
14415
|
-
"name": "
|
|
14572
|
+
"name": "isolatedPositionScaledBalance",
|
|
14416
14573
|
"docs": [
|
|
14417
14574
|
"The last base asset amount per lp the amm had",
|
|
14418
14575
|
"Used to settle the users lp position",
|
|
14419
|
-
"precision:
|
|
14576
|
+
"precision: SPOT_BALANCE_PRECISION"
|
|
14420
14577
|
],
|
|
14421
|
-
"type": "
|
|
14578
|
+
"type": "u64"
|
|
14422
14579
|
},
|
|
14423
14580
|
{
|
|
14424
14581
|
"name": "lastQuoteAssetAmountPerLp",
|
|
@@ -14457,8 +14614,8 @@
|
|
|
14457
14614
|
"type": "u8"
|
|
14458
14615
|
},
|
|
14459
14616
|
{
|
|
14460
|
-
"name": "
|
|
14461
|
-
"type": "
|
|
14617
|
+
"name": "positionFlag",
|
|
14618
|
+
"type": "u8"
|
|
14462
14619
|
}
|
|
14463
14620
|
]
|
|
14464
14621
|
}
|
|
@@ -15138,6 +15295,17 @@
|
|
|
15138
15295
|
]
|
|
15139
15296
|
}
|
|
15140
15297
|
},
|
|
15298
|
+
{
|
|
15299
|
+
"name": "LiquidationBitFlag",
|
|
15300
|
+
"type": {
|
|
15301
|
+
"kind": "enum",
|
|
15302
|
+
"variants": [
|
|
15303
|
+
{
|
|
15304
|
+
"name": "IsolatedPosition"
|
|
15305
|
+
}
|
|
15306
|
+
]
|
|
15307
|
+
}
|
|
15308
|
+
},
|
|
15141
15309
|
{
|
|
15142
15310
|
"name": "SettlePnlExplanation",
|
|
15143
15311
|
"type": {
|
|
@@ -15267,13 +15435,7 @@
|
|
|
15267
15435
|
"kind": "enum",
|
|
15268
15436
|
"variants": [
|
|
15269
15437
|
{
|
|
15270
|
-
"name": "Standard"
|
|
15271
|
-
"fields": [
|
|
15272
|
-
{
|
|
15273
|
-
"name": "trackOpenOrdersFraction",
|
|
15274
|
-
"type": "bool"
|
|
15275
|
-
}
|
|
15276
|
-
]
|
|
15438
|
+
"name": "Standard"
|
|
15277
15439
|
},
|
|
15278
15440
|
{
|
|
15279
15441
|
"name": "Liquidation",
|
|
@@ -15434,6 +15596,9 @@
|
|
|
15434
15596
|
},
|
|
15435
15597
|
{
|
|
15436
15598
|
"name": "AmmImmediateFill"
|
|
15599
|
+
},
|
|
15600
|
+
{
|
|
15601
|
+
"name": "SettleRevPool"
|
|
15437
15602
|
}
|
|
15438
15603
|
]
|
|
15439
15604
|
}
|
|
@@ -15912,6 +16077,23 @@
|
|
|
15912
16077
|
]
|
|
15913
16078
|
}
|
|
15914
16079
|
},
|
|
16080
|
+
{
|
|
16081
|
+
"name": "PositionFlag",
|
|
16082
|
+
"type": {
|
|
16083
|
+
"kind": "enum",
|
|
16084
|
+
"variants": [
|
|
16085
|
+
{
|
|
16086
|
+
"name": "IsolatedPosition"
|
|
16087
|
+
},
|
|
16088
|
+
{
|
|
16089
|
+
"name": "BeingLiquidated"
|
|
16090
|
+
},
|
|
16091
|
+
{
|
|
16092
|
+
"name": "Bankrupt"
|
|
16093
|
+
}
|
|
16094
|
+
]
|
|
16095
|
+
}
|
|
16096
|
+
},
|
|
15915
16097
|
{
|
|
15916
16098
|
"name": "ReferrerStatus",
|
|
15917
16099
|
"type": {
|
|
@@ -16131,6 +16313,18 @@
|
|
|
16131
16313
|
"option": "publicKey"
|
|
16132
16314
|
},
|
|
16133
16315
|
"index": false
|
|
16316
|
+
},
|
|
16317
|
+
{
|
|
16318
|
+
"name": "signer",
|
|
16319
|
+
"type": {
|
|
16320
|
+
"option": "publicKey"
|
|
16321
|
+
},
|
|
16322
|
+
"index": false
|
|
16323
|
+
},
|
|
16324
|
+
{
|
|
16325
|
+
"name": "userTokenAmountAfter",
|
|
16326
|
+
"type": "i128",
|
|
16327
|
+
"index": false
|
|
16134
16328
|
}
|
|
16135
16329
|
]
|
|
16136
16330
|
},
|
|
@@ -16876,6 +17070,11 @@
|
|
|
16876
17070
|
"defined": "SpotBankruptcyRecord"
|
|
16877
17071
|
},
|
|
16878
17072
|
"index": false
|
|
17073
|
+
},
|
|
17074
|
+
{
|
|
17075
|
+
"name": "bitFlags",
|
|
17076
|
+
"type": "u8",
|
|
17077
|
+
"index": false
|
|
16879
17078
|
}
|
|
16880
17079
|
]
|
|
16881
17080
|
},
|
|
@@ -18312,8 +18511,8 @@
|
|
|
18312
18511
|
},
|
|
18313
18512
|
{
|
|
18314
18513
|
"code": 6094,
|
|
18315
|
-
"name": "
|
|
18316
|
-
"msg": "
|
|
18514
|
+
"name": "CantUpdateSpotBalanceType",
|
|
18515
|
+
"msg": "CantUpdateSpotBalanceType"
|
|
18317
18516
|
},
|
|
18318
18517
|
{
|
|
18319
18518
|
"code": 6095,
|
|
@@ -19427,41 +19626,46 @@
|
|
|
19427
19626
|
},
|
|
19428
19627
|
{
|
|
19429
19628
|
"code": 6317,
|
|
19629
|
+
"name": "InvalidIsolatedPerpMarket",
|
|
19630
|
+
"msg": "Invalid Isolated Perp Market"
|
|
19631
|
+
},
|
|
19632
|
+
{
|
|
19633
|
+
"code": 6318,
|
|
19430
19634
|
"name": "InvalidRevenueShareResize",
|
|
19431
19635
|
"msg": "Invalid RevenueShare resize"
|
|
19432
19636
|
},
|
|
19433
19637
|
{
|
|
19434
|
-
"code":
|
|
19638
|
+
"code": 6319,
|
|
19435
19639
|
"name": "BuilderRevoked",
|
|
19436
19640
|
"msg": "Builder has been revoked"
|
|
19437
19641
|
},
|
|
19438
19642
|
{
|
|
19439
|
-
"code":
|
|
19643
|
+
"code": 6320,
|
|
19440
19644
|
"name": "InvalidBuilderFee",
|
|
19441
19645
|
"msg": "Builder fee is greater than max fee bps"
|
|
19442
19646
|
},
|
|
19443
19647
|
{
|
|
19444
|
-
"code":
|
|
19648
|
+
"code": 6321,
|
|
19445
19649
|
"name": "RevenueShareEscrowAuthorityMismatch",
|
|
19446
19650
|
"msg": "RevenueShareEscrow authority mismatch"
|
|
19447
19651
|
},
|
|
19448
19652
|
{
|
|
19449
|
-
"code":
|
|
19653
|
+
"code": 6322,
|
|
19450
19654
|
"name": "RevenueShareEscrowOrdersAccountFull",
|
|
19451
19655
|
"msg": "RevenueShareEscrow has too many active orders"
|
|
19452
19656
|
},
|
|
19453
19657
|
{
|
|
19454
|
-
"code":
|
|
19658
|
+
"code": 6323,
|
|
19455
19659
|
"name": "InvalidRevenueShareAccount",
|
|
19456
19660
|
"msg": "Invalid RevenueShareAccount"
|
|
19457
19661
|
},
|
|
19458
19662
|
{
|
|
19459
|
-
"code":
|
|
19663
|
+
"code": 6324,
|
|
19460
19664
|
"name": "CannotRevokeBuilderWithOpenOrders",
|
|
19461
19665
|
"msg": "Cannot revoke builder with open orders"
|
|
19462
19666
|
},
|
|
19463
19667
|
{
|
|
19464
|
-
"code":
|
|
19668
|
+
"code": 6325,
|
|
19465
19669
|
"name": "UnableToLoadRevenueShareAccount",
|
|
19466
19670
|
"msg": "Unable to load builder account"
|
|
19467
19671
|
},
|
|
@@ -91,10 +91,11 @@ function calculateWorstCaseBaseAssetAmount(perpPosition, perpMarket, oraclePrice
|
|
|
91
91
|
exports.calculateWorstCaseBaseAssetAmount = calculateWorstCaseBaseAssetAmount;
|
|
92
92
|
function calculateWorstCasePerpLiabilityValue(perpPosition, perpMarket, oraclePrice, includeOpenOrders = true) {
|
|
93
93
|
const isPredictionMarket = (0, types_1.isVariant)(perpMarket.contractType, 'prediction');
|
|
94
|
+
// return early if no open orders required
|
|
94
95
|
if (!includeOpenOrders) {
|
|
95
96
|
return {
|
|
96
97
|
worstCaseBaseAssetAmount: perpPosition.baseAssetAmount,
|
|
97
|
-
worstCaseLiabilityValue: calculatePerpLiabilityValue(perpPosition.baseAssetAmount, oraclePrice,
|
|
98
|
+
worstCaseLiabilityValue: calculatePerpLiabilityValue(perpPosition.baseAssetAmount, oraclePrice, (0, types_1.isVariant)(perpMarket.contractType, 'prediction')),
|
|
98
99
|
};
|
|
99
100
|
}
|
|
100
101
|
const allBids = perpPosition.baseAssetAmount.add(perpPosition.openBids);
|
|
@@ -46,6 +46,7 @@ export declare function calculateUnsettledFundingPnl(market: PerpMarketAccount,
|
|
|
46
46
|
*/
|
|
47
47
|
export declare function calculatePositionFundingPNL(market: PerpMarketAccount, perpPosition: PerpPosition): BN;
|
|
48
48
|
export declare function positionIsAvailable(position: PerpPosition): boolean;
|
|
49
|
+
export declare function positionIsBeingLiquidated(position: PerpPosition): boolean;
|
|
49
50
|
/**
|
|
50
51
|
*
|
|
51
52
|
* @param userPosition
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hasOpenOrders = exports.isEmptyPosition = exports.positionCurrentDirection = exports.findDirectionToClose = exports.calculateCostBasis = exports.calculateEntryPrice = exports.calculateBreakEvenPrice = exports.positionIsAvailable = exports.calculatePositionFundingPNL = exports.calculateUnsettledFundingPnl = exports.calculateFeesAndFundingPnl = exports.calculateClaimablePnl = exports.calculatePositionPNL = exports.calculateBaseAssetValue = void 0;
|
|
3
|
+
exports.hasOpenOrders = exports.isEmptyPosition = exports.positionCurrentDirection = exports.findDirectionToClose = exports.calculateCostBasis = exports.calculateEntryPrice = exports.calculateBreakEvenPrice = exports.positionIsBeingLiquidated = exports.positionIsAvailable = exports.calculatePositionFundingPNL = exports.calculateUnsettledFundingPnl = exports.calculateFeesAndFundingPnl = exports.calculateClaimablePnl = exports.calculatePositionPNL = exports.calculateBaseAssetValue = void 0;
|
|
4
4
|
const anchor_1 = require("@coral-xyz/anchor");
|
|
5
5
|
const numericConstants_1 = require("../constants/numericConstants");
|
|
6
6
|
const types_1 = require("../types");
|
|
@@ -149,9 +149,17 @@ function positionIsAvailable(position) {
|
|
|
149
149
|
return (position.baseAssetAmount.eq(numericConstants_1.ZERO) &&
|
|
150
150
|
position.openOrders === 0 &&
|
|
151
151
|
position.quoteAssetAmount.eq(numericConstants_1.ZERO) &&
|
|
152
|
-
position.lpShares.eq(numericConstants_1.ZERO)
|
|
152
|
+
position.lpShares.eq(numericConstants_1.ZERO) &&
|
|
153
|
+
position.isolatedPositionScaledBalance.eq(numericConstants_1.ZERO) &&
|
|
154
|
+
!positionIsBeingLiquidated(position));
|
|
153
155
|
}
|
|
154
156
|
exports.positionIsAvailable = positionIsAvailable;
|
|
157
|
+
function positionIsBeingLiquidated(position) {
|
|
158
|
+
return ((position.positionFlag &
|
|
159
|
+
(types_1.PositionFlag.BeingLiquidated | types_1.PositionFlag.Bankruptcy)) >
|
|
160
|
+
0);
|
|
161
|
+
}
|
|
162
|
+
exports.positionIsBeingLiquidated = positionIsBeingLiquidated;
|
|
155
163
|
/**
|
|
156
164
|
*
|
|
157
165
|
* @param userPosition
|
|
@@ -5,6 +5,7 @@ import { DriftClient } from '../driftClient';
|
|
|
5
5
|
import { BN } from '@coral-xyz/anchor';
|
|
6
6
|
import { User } from '../user';
|
|
7
7
|
import { DepositRecord } from '../types';
|
|
8
|
+
import fetch from 'node-fetch';
|
|
8
9
|
export type BSOL_STATS_API_RESPONSE = {
|
|
9
10
|
success: boolean;
|
|
10
11
|
stats?: {
|
|
@@ -27,8 +28,8 @@ export type BSOL_EMISSIONS_API_RESPONSE = {
|
|
|
27
28
|
lend: number;
|
|
28
29
|
};
|
|
29
30
|
};
|
|
30
|
-
export declare function fetchBSolMetrics(): Promise<
|
|
31
|
-
export declare function fetchBSolDriftEmissions(): Promise<
|
|
31
|
+
export declare function fetchBSolMetrics(): Promise<fetch.Response>;
|
|
32
|
+
export declare function fetchBSolDriftEmissions(): Promise<fetch.Response>;
|
|
32
33
|
export declare function findBestSuperStakeIxs({ marketIndex, amount, jupiterClient, driftClient, userAccountPublicKey, price, forceMarinade, onlyDirectRoutes, jupiterQuote, }: {
|
|
33
34
|
marketIndex: number;
|
|
34
35
|
amount: BN;
|
package/lib/browser/types.d.ts
CHANGED
|
@@ -697,6 +697,9 @@ export type SpotBankruptcyRecord = {
|
|
|
697
697
|
cumulativeDepositInterestDelta: BN;
|
|
698
698
|
ifPayment: BN;
|
|
699
699
|
};
|
|
700
|
+
export declare class LiquidationBitFlag {
|
|
701
|
+
static readonly IsolatedPosition = 1;
|
|
702
|
+
}
|
|
700
703
|
export type SettlePnlRecord = {
|
|
701
704
|
ts: BN;
|
|
702
705
|
user: PublicKey;
|
|
@@ -1192,14 +1195,9 @@ export type PerpPosition = {
|
|
|
1192
1195
|
lastBaseAssetAmountPerLp: BN;
|
|
1193
1196
|
lastQuoteAssetAmountPerLp: BN;
|
|
1194
1197
|
perLpBase: number;
|
|
1195
|
-
isolatedPositionScaledBalance: BN;
|
|
1196
1198
|
positionFlag: number;
|
|
1199
|
+
isolatedPositionScaledBalance: BN;
|
|
1197
1200
|
};
|
|
1198
|
-
export declare class PositionFlag {
|
|
1199
|
-
static readonly IsolatedPosition = 1;
|
|
1200
|
-
static readonly BeingLiquidated = 2;
|
|
1201
|
-
static readonly Bankruptcy = 4;
|
|
1202
|
-
}
|
|
1203
1201
|
export type UserStatsAccount = {
|
|
1204
1202
|
numberOfSubAccounts: number;
|
|
1205
1203
|
numberOfSubAccountsCreated: number;
|
|
@@ -1348,6 +1346,11 @@ export declare class OrderParamsBitFlag {
|
|
|
1348
1346
|
static readonly ImmediateOrCancel = 1;
|
|
1349
1347
|
static readonly UpdateHighLeverageMode = 2;
|
|
1350
1348
|
}
|
|
1349
|
+
export declare class PositionFlag {
|
|
1350
|
+
static readonly IsolatedPosition = 1;
|
|
1351
|
+
static readonly BeingLiquidated = 2;
|
|
1352
|
+
static readonly Bankruptcy = 4;
|
|
1353
|
+
}
|
|
1351
1354
|
export type NecessaryOrderParams = {
|
|
1352
1355
|
orderType: OrderType;
|
|
1353
1356
|
marketIndex: number;
|
|
@@ -1357,6 +1360,9 @@ export type NecessaryOrderParams = {
|
|
|
1357
1360
|
export type OptionalOrderParams = {
|
|
1358
1361
|
[Property in keyof OrderParams]?: OrderParams[Property];
|
|
1359
1362
|
} & NecessaryOrderParams;
|
|
1363
|
+
export type PerpOrderIsolatedExtras = {
|
|
1364
|
+
isolatedPositionDepositAmount?: BN;
|
|
1365
|
+
};
|
|
1360
1366
|
export type ModifyOrderParams = {
|
|
1361
1367
|
[Property in keyof OrderParams]?: OrderParams[Property] | null;
|
|
1362
1368
|
} & {
|
package/lib/browser/types.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ConstituentStatus = exports.OracleValidity = exports.SwapReduceOnly = exports.PlaceAndTakeOrderSuccessCondition = exports.FuelOverflowStatus = exports.ReferrerStatus = exports.DefaultOrderParams = exports.ModifyOrderPolicy = exports.PositionFlag = exports.OrderParamsBitFlag = exports.PostOnlyParams = exports.LiquidationBitFlag = exports.LiquidationType = exports.LPAction = exports.TradeSide = exports.getVariant = exports.isOneOfVariant = exports.isVariant = exports.SettlePnlMode = exports.StakeAction = exports.SpotFulfillmentConfigStatus = exports.SettlePnlExplanation = exports.DepositExplanation = exports.SpotFulfillmentStatus = exports.SpotFulfillmentType = exports.OrderTriggerCondition = exports.OrderActionExplanation = exports.OrderAction = exports.OrderBitFlag = exports.OrderStatus = exports.MarketType = exports.OrderType = exports.OracleSourceNum = exports.OracleSource = exports.DepositDirection = exports.PositionDirection = exports.SpotBalanceType = exports.SwapDirection = exports.TokenProgramFlag = exports.AssetTier = exports.ContractTier = exports.ContractType = exports.MarginMode = exports.UserStatus = exports.InsuranceFundOperation = exports.SpotOperation = exports.PerpOperation = exports.MarketStatus = exports.FeatureBitFlags = exports.ExchangeStatus = void 0;
|
|
4
|
+
exports.ConstituentLpOperation = void 0;
|
|
4
5
|
const numericConstants_1 = require("./constants/numericConstants");
|
|
5
6
|
// # Utility Types / Enums / Constants
|
|
6
7
|
var ExchangeStatus;
|
|
@@ -353,12 +354,10 @@ LiquidationType.SPOT_BANKRUPTCY = {
|
|
|
353
354
|
LiquidationType.LIQUIDATE_SPOT = {
|
|
354
355
|
liquidateSpot: {},
|
|
355
356
|
};
|
|
356
|
-
class
|
|
357
|
+
class LiquidationBitFlag {
|
|
357
358
|
}
|
|
358
|
-
exports.
|
|
359
|
-
|
|
360
|
-
PositionFlag.BeingLiquidated = 2;
|
|
361
|
-
PositionFlag.Bankruptcy = 4;
|
|
359
|
+
exports.LiquidationBitFlag = LiquidationBitFlag;
|
|
360
|
+
LiquidationBitFlag.IsolatedPosition = 1;
|
|
362
361
|
class PostOnlyParams {
|
|
363
362
|
}
|
|
364
363
|
exports.PostOnlyParams = PostOnlyParams;
|
|
@@ -371,6 +370,12 @@ class OrderParamsBitFlag {
|
|
|
371
370
|
exports.OrderParamsBitFlag = OrderParamsBitFlag;
|
|
372
371
|
OrderParamsBitFlag.ImmediateOrCancel = 1;
|
|
373
372
|
OrderParamsBitFlag.UpdateHighLeverageMode = 2;
|
|
373
|
+
class PositionFlag {
|
|
374
|
+
}
|
|
375
|
+
exports.PositionFlag = PositionFlag;
|
|
376
|
+
PositionFlag.IsolatedPosition = 1;
|
|
377
|
+
PositionFlag.BeingLiquidated = 2;
|
|
378
|
+
PositionFlag.Bankruptcy = 4;
|
|
374
379
|
var ModifyOrderPolicy;
|
|
375
380
|
(function (ModifyOrderPolicy) {
|
|
376
381
|
ModifyOrderPolicy[ModifyOrderPolicy["MustModify"] = 1] = "MustModify";
|
package/lib/browser/user.d.ts
CHANGED
|
@@ -62,6 +62,7 @@ export declare class User {
|
|
|
62
62
|
*/
|
|
63
63
|
getTokenAmount(marketIndex: number): BN;
|
|
64
64
|
getEmptyPosition(marketIndex: number): PerpPosition;
|
|
65
|
+
isPositionEmpty(position: PerpPosition): boolean;
|
|
65
66
|
getIsolatePerpPositionTokenAmount(perpMarketIndex: number): BN;
|
|
66
67
|
getClonedPosition(position: PerpPosition): PerpPosition;
|
|
67
68
|
getOrderForUserAccount(userAccount: UserAccount, orderId: number): Order | undefined;
|
|
@@ -93,7 +94,7 @@ export declare class User {
|
|
|
93
94
|
* calculates Buying Power = free collateral / initial margin ratio
|
|
94
95
|
* @returns : Precision QUOTE_PRECISION
|
|
95
96
|
*/
|
|
96
|
-
getPerpBuyingPower(marketIndex: number, collateralBuffer?: BN, enterHighLeverageMode?: any, maxMarginRatio?: any): BN;
|
|
97
|
+
getPerpBuyingPower(marketIndex: number, collateralBuffer?: BN, enterHighLeverageMode?: any, maxMarginRatio?: any, positionType?: 'isolated' | 'cross'): BN;
|
|
97
98
|
getPerpBuyingPowerFromFreeCollateralAndBaseAssetAmount(marketIndex: number, freeCollateral: BN, baseAssetAmount: BN, enterHighLeverageMode?: any, perpMarketMaxMarginRatio?: any): BN;
|
|
98
99
|
/**
|
|
99
100
|
* calculates Free Collateral = Total collateral - margin requirement
|
|
@@ -311,7 +312,7 @@ export declare class User {
|
|
|
311
312
|
* @param isLp
|
|
312
313
|
* @returns { tradeSize: BN, oppositeSideTradeSize: BN} : Precision QUOTE_PRECISION
|
|
313
314
|
*/
|
|
314
|
-
getMaxTradeSizeUSDCForPerp(targetMarketIndex: number, tradeSide: PositionDirection, isLp?: boolean, enterHighLeverageMode?: any, maxMarginRatio?: any): {
|
|
315
|
+
getMaxTradeSizeUSDCForPerp(targetMarketIndex: number, tradeSide: PositionDirection, isLp?: boolean, enterHighLeverageMode?: any, maxMarginRatio?: any, positionType?: 'isolated' | 'cross'): {
|
|
315
316
|
tradeSize: BN;
|
|
316
317
|
oppositeSideTradeSize: BN;
|
|
317
318
|
};
|
package/lib/browser/user.js
CHANGED
|
@@ -86,6 +86,7 @@ class User {
|
|
|
86
86
|
await this.accountSubscriber.fetch();
|
|
87
87
|
}
|
|
88
88
|
async unsubscribe() {
|
|
89
|
+
this.eventEmitter.removeAllListeners();
|
|
89
90
|
await this.accountSubscriber.unsubscribe();
|
|
90
91
|
this.isSubscribed = false;
|
|
91
92
|
}
|
|
@@ -191,6 +192,9 @@ class User {
|
|
|
191
192
|
positionFlag: 0,
|
|
192
193
|
};
|
|
193
194
|
}
|
|
195
|
+
isPositionEmpty(position) {
|
|
196
|
+
return position.baseAssetAmount.eq(numericConstants_1.ZERO) && position.openOrders === 0;
|
|
197
|
+
}
|
|
194
198
|
getIsolatePerpPositionTokenAmount(perpMarketIndex) {
|
|
195
199
|
var _a;
|
|
196
200
|
const perpPosition = this.getPerpPosition(perpMarketIndex);
|
|
@@ -283,14 +287,21 @@ class User {
|
|
|
283
287
|
* calculates Buying Power = free collateral / initial margin ratio
|
|
284
288
|
* @returns : Precision QUOTE_PRECISION
|
|
285
289
|
*/
|
|
286
|
-
getPerpBuyingPower(marketIndex, collateralBuffer = numericConstants_1.ZERO, enterHighLeverageMode = undefined, maxMarginRatio = undefined) {
|
|
290
|
+
getPerpBuyingPower(marketIndex, collateralBuffer = numericConstants_1.ZERO, enterHighLeverageMode = undefined, maxMarginRatio = undefined, positionType = 'cross') {
|
|
287
291
|
const perpPosition = this.getPerpPositionOrEmpty(marketIndex);
|
|
288
292
|
const perpMarket = this.driftClient.getPerpMarketAccount(marketIndex);
|
|
289
293
|
const oraclePriceData = this.getOracleDataForPerpMarket(marketIndex);
|
|
290
294
|
const worstCaseBaseAssetAmount = perpPosition
|
|
291
295
|
? (0, margin_2.calculateWorstCaseBaseAssetAmount)(perpPosition, perpMarket, oraclePriceData.price)
|
|
292
296
|
: numericConstants_1.ZERO;
|
|
293
|
-
|
|
297
|
+
let freeCollateral = numericConstants_1.ZERO;
|
|
298
|
+
// if position is isolated, we always add on available quote from the cross account
|
|
299
|
+
if (positionType === 'isolated') {
|
|
300
|
+
const { totalAssetValue: quoteSpotMarketAssetValue, totalLiabilityValue: quoteSpotMarketLiabilityValue, } = this.getSpotMarketAssetAndLiabilityValue(perpMarket.quoteSpotMarketIndex, 'Initial', undefined, undefined, true);
|
|
301
|
+
freeCollateral = quoteSpotMarketAssetValue.sub(quoteSpotMarketLiabilityValue);
|
|
302
|
+
}
|
|
303
|
+
// adding free collateral from the cross account or from within isolated margin calc for this marketIndex
|
|
304
|
+
freeCollateral = freeCollateral.add(this.getFreeCollateral('Initial', enterHighLeverageMode, positionType === 'isolated' ? marketIndex : undefined).sub(collateralBuffer));
|
|
294
305
|
return this.getPerpBuyingPowerFromFreeCollateralAndBaseAssetAmount(marketIndex, freeCollateral, worstCaseBaseAssetAmount, enterHighLeverageMode, maxMarginRatio || perpPosition.maxMarginRatio);
|
|
295
306
|
}
|
|
296
307
|
getPerpBuyingPowerFromFreeCollateralAndBaseAssetAmount(marketIndex, freeCollateral, baseAssetAmount, enterHighLeverageMode = undefined, perpMarketMaxMarginRatio = undefined) {
|
|
@@ -303,16 +314,21 @@ class User {
|
|
|
303
314
|
* @returns : Precision QUOTE_PRECISION
|
|
304
315
|
*/
|
|
305
316
|
getFreeCollateral(marginCategory = 'Initial', enterHighLeverageMode = false, perpMarketIndex) {
|
|
306
|
-
const
|
|
317
|
+
const calc = this.getMarginCalculation(marginCategory, {
|
|
307
318
|
enteringHighLeverage: enterHighLeverageMode,
|
|
308
319
|
strict: marginCategory === 'Initial',
|
|
309
320
|
});
|
|
310
321
|
if (perpMarketIndex !== undefined) {
|
|
311
|
-
|
|
322
|
+
// getIsolatedFreeCollateral will throw if no existing isolated position but we are fetching for potential new position, so we wrap in a try/catch
|
|
323
|
+
try {
|
|
324
|
+
return calc.getIsolatedFreeCollateral(perpMarketIndex);
|
|
325
|
+
}
|
|
326
|
+
catch (error) {
|
|
327
|
+
return numericConstants_1.ZERO;
|
|
328
|
+
}
|
|
312
329
|
}
|
|
313
330
|
else {
|
|
314
|
-
|
|
315
|
-
return freeCollateral.gte(numericConstants_1.ZERO) ? freeCollateral : numericConstants_1.ZERO;
|
|
331
|
+
return calc.getCrossFreeCollateral();
|
|
316
332
|
}
|
|
317
333
|
}
|
|
318
334
|
getMarginRequirement(marginCategory, liquidationBuffer, strict, includeOpenOrders, enteringHighLeverage, perpMarketIndex) {
|
|
@@ -1407,7 +1423,7 @@ class User {
|
|
|
1407
1423
|
* @param isLp
|
|
1408
1424
|
* @returns { tradeSize: BN, oppositeSideTradeSize: BN} : Precision QUOTE_PRECISION
|
|
1409
1425
|
*/
|
|
1410
|
-
getMaxTradeSizeUSDCForPerp(targetMarketIndex, tradeSide, isLp = false, enterHighLeverageMode = undefined, maxMarginRatio = undefined) {
|
|
1426
|
+
getMaxTradeSizeUSDCForPerp(targetMarketIndex, tradeSide, isLp = false, enterHighLeverageMode = undefined, maxMarginRatio = undefined, positionType = 'cross') {
|
|
1411
1427
|
let tradeSize = numericConstants_1.ZERO;
|
|
1412
1428
|
let oppositeSideTradeSize = numericConstants_1.ZERO;
|
|
1413
1429
|
const currentPosition = this.getPerpPositionOrEmpty(targetMarketIndex);
|
|
@@ -1429,7 +1445,7 @@ class User {
|
|
|
1429
1445
|
const oppositeSizeLiabilityValue = targetingSameSide
|
|
1430
1446
|
? numericConstants_1.ZERO
|
|
1431
1447
|
: (0, margin_1.calculatePerpLiabilityValue)(currentPosition.baseAssetAmount, oracleData.price, (0, types_1.isVariant)(marketAccount.contractType, 'prediction'));
|
|
1432
|
-
const maxPositionSize = this.getPerpBuyingPower(targetMarketIndex, lpBuffer, enterHighLeverageMode, maxMarginRatio);
|
|
1448
|
+
const maxPositionSize = this.getPerpBuyingPower(targetMarketIndex, lpBuffer, enterHighLeverageMode, maxMarginRatio, positionType);
|
|
1433
1449
|
if (maxPositionSize.gte(numericConstants_1.ZERO)) {
|
|
1434
1450
|
if (oppositeSizeLiabilityValue.eq(numericConstants_1.ZERO)) {
|
|
1435
1451
|
// case 1 : Regular trade where current total position less than max, and no opposite position to account for
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"perpMarkets.d.ts","sourceRoot":"","sources":["../../../src/constants/perpMarkets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,MAAM,MAAM,gBAAgB,GAAG;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,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= [
|
|
|
1327
1327
|
oracleSource: types_1.OracleSource.PYTH_LAZER,
|
|
1328
1328
|
pythLazerId: 2382,
|
|
1329
1329
|
},
|
|
1330
|
+
{
|
|
1331
|
+
fullName: 'Monad',
|
|
1332
|
+
category: ['L1'],
|
|
1333
|
+
symbol: '1KMON-PERP',
|
|
1334
|
+
baseAssetSymbol: '1KMON',
|
|
1335
|
+
marketIndex: 83,
|
|
1336
|
+
oracle: new web3_js_1.PublicKey('585jsthKg9BeTfnFGAxgfNie9krGGyPbd5feMpWneHf7'),
|
|
1337
|
+
launchTs: 1763996757000,
|
|
1338
|
+
oracleSource: types_1.OracleSource.PYTH_LAZER_1K,
|
|
1339
|
+
pythLazerId: 2396,
|
|
1340
|
+
},
|
|
1330
1341
|
];
|
|
1331
1342
|
exports.PerpMarkets = {
|
|
1332
1343
|
devnet: exports.DevnetPerpMarkets,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spotMarkets.d.ts","sourceRoot":"","sources":["../../../src/constants/spotMarkets.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAW5C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,MAAM,MAAM,gBAAgB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,SAAS,CAAC;IAClB,IAAI,EAAE,SAAS,CAAC;IAChB,YAAY,EAAE,YAAY,CAAC;IAC3B,SAAS,EAAE,EAAE,CAAC;IACd,YAAY,EAAE,EAAE,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,aAAa,CAA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