@drift-labs/sdk 2.110.0-beta.1 → 2.110.0-beta.11
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/VERSION +1 -1
- package/lib/browser/addresses/pda.d.ts +0 -1
- package/lib/browser/addresses/pda.js +1 -8
- package/lib/browser/config.d.ts +2 -0
- package/lib/browser/config.js +7 -0
- package/lib/browser/constants/perpMarkets.js +34 -34
- package/lib/browser/constants/spotMarkets.js +10 -10
- package/lib/browser/dlob/DLOBNode.js +2 -2
- package/lib/browser/driftClient.d.ts +12 -7
- package/lib/browser/driftClient.js +38 -101
- package/lib/browser/driftClientConfig.d.ts +2 -0
- package/lib/browser/idl/drift.json +15 -0
- package/lib/browser/index.d.ts +1 -0
- package/lib/browser/index.js +1 -0
- package/lib/browser/math/market.js +2 -2
- package/lib/browser/swift/swiftOrderSubscriber.js +2 -0
- package/lib/browser/tx/txHandler.d.ts +1 -1
- package/lib/browser/tx/txHandler.js +4 -4
- package/lib/browser/types.d.ts +0 -20
- package/lib/node/addresses/pda.d.ts +0 -1
- package/lib/node/addresses/pda.js +1 -8
- package/lib/node/config.d.ts +2 -0
- package/lib/node/config.js +7 -0
- package/lib/node/constants/perpMarkets.js +34 -34
- package/lib/node/constants/spotMarkets.js +10 -10
- package/lib/node/dlob/DLOBNode.js +2 -2
- package/lib/node/driftClient.d.ts +12 -7
- package/lib/node/driftClient.js +38 -101
- package/lib/node/driftClientConfig.d.ts +2 -0
- package/lib/node/idl/drift.json +15 -0
- package/lib/node/index.d.ts +1 -0
- package/lib/node/index.js +1 -0
- package/lib/node/math/market.js +2 -2
- package/lib/node/swift/swiftOrderSubscriber.js +2 -0
- package/lib/node/tx/txHandler.d.ts +1 -1
- package/lib/node/tx/txHandler.js +4 -4
- package/lib/node/types.d.ts +0 -20
- package/package.json +1 -1
- package/src/addresses/pda.ts +0 -13
- package/src/config.ts +9 -0
- package/src/constants/perpMarkets.ts +36 -36
- package/src/constants/spotMarkets.ts +10 -10
- package/src/dlob/DLOBNode.ts +2 -2
- package/src/driftClient.ts +84 -169
- package/src/driftClientConfig.ts +2 -0
- package/src/idl/drift.json +15 -0
- package/src/index.ts +1 -0
- package/src/math/market.ts +2 -2
- package/src/swift/swiftOrderSubscriber.ts +4 -0
- package/src/tx/txHandler.ts +5 -5
- package/src/types.ts +0 -23
- package/tests/ci/verifyConstants.ts +3 -3
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.110.0-beta.
|
|
1
|
+
2.110.0-beta.11
|
|
@@ -9,7 +9,6 @@ export declare function getUserAccountPublicKey(programId: PublicKey, authority:
|
|
|
9
9
|
export declare function getUserAccountPublicKeySync(programId: PublicKey, authority: PublicKey, subAccountId?: number): PublicKey;
|
|
10
10
|
export declare function getUserStatsAccountPublicKey(programId: PublicKey, authority: PublicKey): PublicKey;
|
|
11
11
|
export declare function getFuelOverflowAccountPublicKey(programId: PublicKey, authority: PublicKey): PublicKey;
|
|
12
|
-
export declare function getRFQUserAccountPublicKey(programId: PublicKey, userAccountPublicKey: PublicKey): PublicKey;
|
|
13
12
|
export declare function getSwiftUserAccountPublicKey(programId: PublicKey, authority: PublicKey): PublicKey;
|
|
14
13
|
export declare function getPerpMarketPublicKey(programId: PublicKey, marketIndex: number): Promise<PublicKey>;
|
|
15
14
|
export declare function getPerpMarketPublicKeySync(programId: PublicKey, marketIndex: number): PublicKey;
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.getProtectedMakerModeConfigPublicKey = exports.getHighLeverageModeConfigPublicKey = exports.getTokenProgramForSpotMarket = exports.getPythLazerOraclePublicKey = exports.getPythPullOraclePublicKey = exports.getPrelaunchOraclePublicKey = exports.getProtocolIfSharesTransferConfigPublicKey = exports.getReferrerNamePublicKeySync = exports.getOpenbookV2FulfillmentConfigPublicKey = exports.getPhoenixFulfillmentConfigPublicKey = exports.getSerumFulfillmentConfigPublicKey = exports.getSerumSignerPublicKey = exports.getSerumOpenOrdersPublicKey = exports.getDriftSignerPublicKey = exports.getInsuranceFundStakeAccountPublicKey = exports.getInsuranceFundVaultPublicKey = exports.getSpotMarketVaultPublicKey = exports.getSpotMarketPublicKeySync = exports.getSpotMarketPublicKey = exports.getPerpMarketPublicKeySync = exports.getPerpMarketPublicKey = exports.getSwiftUserAccountPublicKey = exports.
|
|
26
|
+
exports.getProtectedMakerModeConfigPublicKey = exports.getHighLeverageModeConfigPublicKey = exports.getTokenProgramForSpotMarket = exports.getPythLazerOraclePublicKey = exports.getPythPullOraclePublicKey = exports.getPrelaunchOraclePublicKey = exports.getProtocolIfSharesTransferConfigPublicKey = exports.getReferrerNamePublicKeySync = exports.getOpenbookV2FulfillmentConfigPublicKey = exports.getPhoenixFulfillmentConfigPublicKey = exports.getSerumFulfillmentConfigPublicKey = exports.getSerumSignerPublicKey = exports.getSerumOpenOrdersPublicKey = exports.getDriftSignerPublicKey = exports.getInsuranceFundStakeAccountPublicKey = exports.getInsuranceFundVaultPublicKey = exports.getSpotMarketVaultPublicKey = exports.getSpotMarketPublicKeySync = exports.getSpotMarketPublicKey = exports.getPerpMarketPublicKeySync = exports.getPerpMarketPublicKey = exports.getSwiftUserAccountPublicKey = exports.getFuelOverflowAccountPublicKey = exports.getUserStatsAccountPublicKey = exports.getUserAccountPublicKeySync = exports.getUserAccountPublicKey = exports.getUserAccountPublicKeyAndNonce = exports.getDriftStateAccountPublicKey = exports.getDriftStateAccountPublicKeyAndNonce = void 0;
|
|
27
27
|
const web3_js_1 = require("@solana/web3.js");
|
|
28
28
|
const anchor = __importStar(require("@coral-xyz/anchor"));
|
|
29
29
|
const spl_token_1 = require("@solana/spl-token");
|
|
@@ -69,13 +69,6 @@ function getFuelOverflowAccountPublicKey(programId, authority) {
|
|
|
69
69
|
], programId)[0];
|
|
70
70
|
}
|
|
71
71
|
exports.getFuelOverflowAccountPublicKey = getFuelOverflowAccountPublicKey;
|
|
72
|
-
function getRFQUserAccountPublicKey(programId, userAccountPublicKey) {
|
|
73
|
-
return web3_js_1.PublicKey.findProgramAddressSync([
|
|
74
|
-
Buffer.from(anchor.utils.bytes.utf8.encode('RFQ')),
|
|
75
|
-
userAccountPublicKey.toBuffer(),
|
|
76
|
-
], programId)[0];
|
|
77
|
-
}
|
|
78
|
-
exports.getRFQUserAccountPublicKey = getRFQUserAccountPublicKey;
|
|
79
72
|
function getSwiftUserAccountPublicKey(programId, authority) {
|
|
80
73
|
return web3_js_1.PublicKey.findProgramAddressSync([
|
|
81
74
|
Buffer.from(anchor.utils.bytes.utf8.encode('SWIFT')),
|
package/lib/browser/config.d.ts
CHANGED
|
@@ -17,7 +17,9 @@ type DriftConfig = {
|
|
|
17
17
|
V2_ALPHA_TICKET_MINT_ADDRESS: string;
|
|
18
18
|
PERP_MARKETS: PerpMarketConfig[];
|
|
19
19
|
SPOT_MARKETS: SpotMarketConfig[];
|
|
20
|
+
/** @deprecated use MARKET_LOOKUP_TABLES */
|
|
20
21
|
MARKET_LOOKUP_TABLE: string;
|
|
22
|
+
MARKET_LOOKUP_TABLES: string[];
|
|
21
23
|
SERUM_LOOKUP_TABLE?: string;
|
|
22
24
|
PYTH_PULL_ORACLE_LOOKUP_TABLE?: string;
|
|
23
25
|
SB_ON_DEMAND_PID: PublicKey;
|
package/lib/browser/config.js
CHANGED
|
@@ -27,7 +27,9 @@ exports.configs = {
|
|
|
27
27
|
V2_ALPHA_TICKET_MINT_ADDRESS: 'DeEiGWfCMP9psnLGkxGrBBMEAW5Jv8bBGMN8DCtFRCyB',
|
|
28
28
|
PERP_MARKETS: perpMarkets_1.DevnetPerpMarkets,
|
|
29
29
|
SPOT_MARKETS: spotMarkets_1.DevnetSpotMarkets,
|
|
30
|
+
/** @deprecated use MARKET_LOOKUP_TABLES */
|
|
30
31
|
MARKET_LOOKUP_TABLE: 'FaMS3U4uBojvGn5FSDEPimddcXsCfwkKsFgMVVnDdxGb',
|
|
32
|
+
MARKET_LOOKUP_TABLES: ['FaMS3U4uBojvGn5FSDEPimddcXsCfwkKsFgMVVnDdxGb'],
|
|
31
33
|
DRIFT_ORACLE_RECEIVER_ID: exports.DRIFT_ORACLE_RECEIVER_ID,
|
|
32
34
|
SB_ON_DEMAND_PID: on_demand_1.ON_DEMAND_DEVNET_PID,
|
|
33
35
|
},
|
|
@@ -43,7 +45,12 @@ exports.configs = {
|
|
|
43
45
|
V2_ALPHA_TICKET_MINT_ADDRESS: 'Cmvhycb6LQvvzaShGw4iDHRLzeSSryioAsU98DSSkMNa',
|
|
44
46
|
PERP_MARKETS: perpMarkets_1.MainnetPerpMarkets,
|
|
45
47
|
SPOT_MARKETS: spotMarkets_1.MainnetSpotMarkets,
|
|
48
|
+
/** @deprecated use MARKET_LOOKUP_TABLES */
|
|
46
49
|
MARKET_LOOKUP_TABLE: 'Fpys8GRa5RBWfyeN7AaDUwFGD1zkDCA4z3t4CJLV8dfL',
|
|
50
|
+
MARKET_LOOKUP_TABLES: [
|
|
51
|
+
'Fpys8GRa5RBWfyeN7AaDUwFGD1zkDCA4z3t4CJLV8dfL',
|
|
52
|
+
'EiWSskK5HXnBTptiS5DH6gpAJRVNQ3cAhTKBGaiaysAb',
|
|
53
|
+
],
|
|
47
54
|
SERUM_LOOKUP_TABLE: 'GPZkp76cJtNL2mphCvT6FXkJCVPpouidnacckR6rzKDN',
|
|
48
55
|
DRIFT_ORACLE_RECEIVER_ID: exports.DRIFT_ORACLE_RECEIVER_ID,
|
|
49
56
|
SB_ON_DEMAND_PID: on_demand_1.ON_DEMAND_MAINNET_PID,
|
|
@@ -386,9 +386,9 @@ exports.MainnetPerpMarkets = [
|
|
|
386
386
|
symbol: 'APT-PERP',
|
|
387
387
|
baseAssetSymbol: 'APT',
|
|
388
388
|
marketIndex: 3,
|
|
389
|
-
oracle: new web3_js_1.PublicKey('
|
|
389
|
+
oracle: new web3_js_1.PublicKey('CXZhzKePYajrZgZyrzgvHYFKK3c5tNgDrRobAgySo8Nb'),
|
|
390
390
|
launchTs: 1675802661000,
|
|
391
|
-
oracleSource: __1.OracleSource.
|
|
391
|
+
oracleSource: __1.OracleSource.PYTH_LAZER,
|
|
392
392
|
pythFeedId: '0x03ae4db29ed4ae33d323568895aa00337e658e348b37509f5372ae51f0af00d5',
|
|
393
393
|
pythLazerId: 28,
|
|
394
394
|
},
|
|
@@ -410,9 +410,9 @@ exports.MainnetPerpMarkets = [
|
|
|
410
410
|
symbol: 'POL-PERP',
|
|
411
411
|
baseAssetSymbol: 'POL',
|
|
412
412
|
marketIndex: 5,
|
|
413
|
-
oracle: new web3_js_1.PublicKey('
|
|
413
|
+
oracle: new web3_js_1.PublicKey('HDveCibToLf157NtUqShCEWX3GcF4Aq8Ngt2bst1s1cc'),
|
|
414
414
|
launchTs: 1677690149000,
|
|
415
|
-
oracleSource: __1.OracleSource.
|
|
415
|
+
oracleSource: __1.OracleSource.PYTH_LAZER,
|
|
416
416
|
pythFeedId: '0xffd11c5a1cfd42f80afb2df4d9f264c15f956d68153335374ec10722edd70472',
|
|
417
417
|
pythLazerId: 32,
|
|
418
418
|
},
|
|
@@ -422,9 +422,9 @@ exports.MainnetPerpMarkets = [
|
|
|
422
422
|
symbol: 'ARB-PERP',
|
|
423
423
|
baseAssetSymbol: 'ARB',
|
|
424
424
|
marketIndex: 6,
|
|
425
|
-
oracle: new web3_js_1.PublicKey('
|
|
425
|
+
oracle: new web3_js_1.PublicKey('5DYEjGpr28q3EsLKAnLXiDq6UeaFgDFZ5Gdwgp5RmPAp'),
|
|
426
426
|
launchTs: 1679501812000,
|
|
427
|
-
oracleSource: __1.OracleSource.
|
|
427
|
+
oracleSource: __1.OracleSource.PYTH_LAZER,
|
|
428
428
|
pythFeedId: '0x3fa4252848f9f0a1480be62745a4629d9eb1322aebab8a791e344b3b9c1adcf5',
|
|
429
429
|
pythLazerId: 37,
|
|
430
430
|
},
|
|
@@ -446,9 +446,9 @@ exports.MainnetPerpMarkets = [
|
|
|
446
446
|
symbol: 'BNB-PERP',
|
|
447
447
|
baseAssetSymbol: 'BNB',
|
|
448
448
|
marketIndex: 8,
|
|
449
|
-
oracle: new web3_js_1.PublicKey('
|
|
449
|
+
oracle: new web3_js_1.PublicKey('A9J2j1pRB2aPqAbjUTtKy94niSCTuPUrpimfzvpZHKG1'),
|
|
450
450
|
launchTs: 1680808053000,
|
|
451
|
-
oracleSource: __1.OracleSource.
|
|
451
|
+
oracleSource: __1.OracleSource.PYTH_LAZER,
|
|
452
452
|
pythFeedId: '0x2f95862b045670cd22bee3114c39763a4a08beeb663b145d283c31d7d1101c4f',
|
|
453
453
|
pythLazerId: 15,
|
|
454
454
|
},
|
|
@@ -482,9 +482,9 @@ exports.MainnetPerpMarkets = [
|
|
|
482
482
|
symbol: 'OP-PERP',
|
|
483
483
|
baseAssetSymbol: 'OP',
|
|
484
484
|
marketIndex: 11,
|
|
485
|
-
oracle: new web3_js_1.PublicKey('
|
|
485
|
+
oracle: new web3_js_1.PublicKey('7GPbmQee2T4jMsJg99GuzWyMuzr8c2Uk7rAR9qvvQkzf'),
|
|
486
486
|
launchTs: 1686091480000,
|
|
487
|
-
oracleSource: __1.OracleSource.
|
|
487
|
+
oracleSource: __1.OracleSource.PYTH_LAZER,
|
|
488
488
|
pythFeedId: '0x385f64d993f7b77d8182ed5003d97c60aa3361f3cecfe711544d2d59165e9bdf',
|
|
489
489
|
pythLazerId: 41,
|
|
490
490
|
},
|
|
@@ -494,9 +494,9 @@ exports.MainnetPerpMarkets = [
|
|
|
494
494
|
symbol: 'RENDER-PERP',
|
|
495
495
|
baseAssetSymbol: 'RENDER',
|
|
496
496
|
marketIndex: 12,
|
|
497
|
-
oracle: new web3_js_1.PublicKey('
|
|
497
|
+
oracle: new web3_js_1.PublicKey('97EqsAGbTnShB7oYWAFFCVVAx8PWXgDYDhcpm99izNQ4'),
|
|
498
498
|
launchTs: 1687201081000,
|
|
499
|
-
oracleSource: __1.OracleSource.
|
|
499
|
+
oracleSource: __1.OracleSource.PYTH_LAZER,
|
|
500
500
|
pythFeedId: '0x3d4a2bd9535be6ce8059d75eadeba507b043257321aa544717c56fa19b49e35d',
|
|
501
501
|
pythLazerId: 34,
|
|
502
502
|
},
|
|
@@ -529,9 +529,9 @@ exports.MainnetPerpMarkets = [
|
|
|
529
529
|
symbol: 'INJ-PERP',
|
|
530
530
|
baseAssetSymbol: 'INJ',
|
|
531
531
|
marketIndex: 15,
|
|
532
|
-
oracle: new web3_js_1.PublicKey('
|
|
532
|
+
oracle: new web3_js_1.PublicKey('Ac442xcU276nb6gJFUCsNYAwAo6KWuw4xocxmG3nvDym'),
|
|
533
533
|
launchTs: 1698074659000,
|
|
534
|
-
oracleSource: __1.OracleSource.
|
|
534
|
+
oracleSource: __1.OracleSource.PYTH_LAZER,
|
|
535
535
|
pythFeedId: '0x7a5bc1d2b56ad029048cd63964b3ad2776eadf812edc1a43a31406cb54bff592',
|
|
536
536
|
pythLazerId: 46,
|
|
537
537
|
},
|
|
@@ -541,9 +541,9 @@ exports.MainnetPerpMarkets = [
|
|
|
541
541
|
symbol: 'LINK-PERP',
|
|
542
542
|
baseAssetSymbol: 'LINK',
|
|
543
543
|
marketIndex: 16,
|
|
544
|
-
oracle: new web3_js_1.PublicKey('
|
|
544
|
+
oracle: new web3_js_1.PublicKey('rwyPmfH5xsHdjPf6XsVxvyQEZogX2k4pmhaKEVvgseW'),
|
|
545
545
|
launchTs: 1698074659000,
|
|
546
|
-
oracleSource: __1.OracleSource.
|
|
546
|
+
oracleSource: __1.OracleSource.PYTH_LAZER,
|
|
547
547
|
pythFeedId: '0x8ac0c70fff57e9aefdf5edf44b51d62c2d433653cbb2cf5cc06bb115af04d221',
|
|
548
548
|
pythLazerId: 19,
|
|
549
549
|
},
|
|
@@ -564,9 +564,9 @@ exports.MainnetPerpMarkets = [
|
|
|
564
564
|
symbol: 'PYTH-PERP',
|
|
565
565
|
baseAssetSymbol: 'PYTH',
|
|
566
566
|
marketIndex: 18,
|
|
567
|
-
oracle: new web3_js_1.PublicKey('
|
|
567
|
+
oracle: new web3_js_1.PublicKey('6Sfx8ZAt6xaEgMXTahR6GrT7oYB6nFBMoVyCmMyHmeJV'),
|
|
568
568
|
launchTs: 1700542800000,
|
|
569
|
-
oracleSource: __1.OracleSource.
|
|
569
|
+
oracleSource: __1.OracleSource.PYTH_LAZER,
|
|
570
570
|
pythFeedId: '0x0bbf28e9a841a1cc788f6a361b17ca072d0ea3098a1e5df1c3922d06719579ff',
|
|
571
571
|
pythLazerId: 3,
|
|
572
572
|
},
|
|
@@ -600,9 +600,9 @@ exports.MainnetPerpMarkets = [
|
|
|
600
600
|
symbol: 'SEI-PERP',
|
|
601
601
|
baseAssetSymbol: 'SEI',
|
|
602
602
|
marketIndex: 21,
|
|
603
|
-
oracle: new web3_js_1.PublicKey('
|
|
603
|
+
oracle: new web3_js_1.PublicKey('Edk1TWipQtsaD8nnBXYQV1CEAiQb1GFtEAKeFZCi2A4C'),
|
|
604
604
|
launchTs: 1703173331000,
|
|
605
|
-
oracleSource: __1.OracleSource.
|
|
605
|
+
oracleSource: __1.OracleSource.PYTH_LAZER,
|
|
606
606
|
pythFeedId: '0x53614f1cb0c031d4af66c04cb9c756234adad0e1cee85303795091499a4084eb',
|
|
607
607
|
pythLazerId: 51,
|
|
608
608
|
},
|
|
@@ -612,9 +612,9 @@ exports.MainnetPerpMarkets = [
|
|
|
612
612
|
symbol: 'AVAX-PERP',
|
|
613
613
|
baseAssetSymbol: 'AVAX',
|
|
614
614
|
marketIndex: 22,
|
|
615
|
-
oracle: new web3_js_1.PublicKey('
|
|
615
|
+
oracle: new web3_js_1.PublicKey('5ASZLwk3GFCwZiDQ3XpmduRqNPEUGHXjELMX85u8McK3'),
|
|
616
616
|
launchTs: 1704209558000,
|
|
617
|
-
oracleSource: __1.OracleSource.
|
|
617
|
+
oracleSource: __1.OracleSource.PYTH_LAZER,
|
|
618
618
|
pythFeedId: '0x93da3352f9f1d105fdfe4971cfa80e9dd777bfc5d0f683ebb6e1294b92137bb7',
|
|
619
619
|
pythLazerId: 18,
|
|
620
620
|
},
|
|
@@ -648,9 +648,9 @@ exports.MainnetPerpMarkets = [
|
|
|
648
648
|
symbol: 'DYM-PERP',
|
|
649
649
|
baseAssetSymbol: 'DYM',
|
|
650
650
|
marketIndex: 25,
|
|
651
|
-
oracle: new web3_js_1.PublicKey('
|
|
651
|
+
oracle: new web3_js_1.PublicKey('HWDqaKbbNrEsgWPLMeKG39AguefMbHsWcvNSthToXG2t'),
|
|
652
652
|
launchTs: 1708448765000,
|
|
653
|
-
oracleSource: __1.OracleSource.
|
|
653
|
+
oracleSource: __1.OracleSource.PYTH_LAZER,
|
|
654
654
|
pythFeedId: '0xa9f3b2a89c6f85a6c20a9518abde39b944e839ca49a0c92307c65974d3f14a57',
|
|
655
655
|
pythLazerId: 83,
|
|
656
656
|
},
|
|
@@ -660,9 +660,9 @@ exports.MainnetPerpMarkets = [
|
|
|
660
660
|
symbol: 'TAO-PERP',
|
|
661
661
|
baseAssetSymbol: 'TAO',
|
|
662
662
|
marketIndex: 26,
|
|
663
|
-
oracle: new web3_js_1.PublicKey('
|
|
663
|
+
oracle: new web3_js_1.PublicKey('44fqbLqAkKK5kEj1FFvuEPYq56XoQQL3ABzCPrqsW3Cv'),
|
|
664
664
|
launchTs: 1709136669000,
|
|
665
|
-
oracleSource: __1.OracleSource.
|
|
665
|
+
oracleSource: __1.OracleSource.PYTH_LAZER,
|
|
666
666
|
pythFeedId: '0x410f41de235f2db824e562ea7ab2d3d3d4ff048316c61d629c0b93f58584e1af',
|
|
667
667
|
pythLazerId: 36,
|
|
668
668
|
},
|
|
@@ -672,9 +672,9 @@ exports.MainnetPerpMarkets = [
|
|
|
672
672
|
symbol: 'W-PERP',
|
|
673
673
|
baseAssetSymbol: 'W',
|
|
674
674
|
marketIndex: 27,
|
|
675
|
-
oracle: new web3_js_1.PublicKey('
|
|
675
|
+
oracle: new web3_js_1.PublicKey('CsFUXiA5dM4eCKjVBBy8tXhXzDkDRNoYjU5rjpHyfNEZ'),
|
|
676
676
|
launchTs: 1710418343000,
|
|
677
|
-
oracleSource: __1.OracleSource.
|
|
677
|
+
oracleSource: __1.OracleSource.PYTH_LAZER,
|
|
678
678
|
pythFeedId: '0xeff7446475e218517566ea99e72a4abec2e1bd8498b43b7d8331e29dcb059389',
|
|
679
679
|
pythLazerId: 102,
|
|
680
680
|
},
|
|
@@ -833,9 +833,9 @@ exports.MainnetPerpMarkets = [
|
|
|
833
833
|
symbol: 'TON-PERP',
|
|
834
834
|
baseAssetSymbol: 'TON',
|
|
835
835
|
marketIndex: 42,
|
|
836
|
-
oracle: new web3_js_1.PublicKey('
|
|
836
|
+
oracle: new web3_js_1.PublicKey('Cbhiaky9kxDsviokcQaS9qc4HmpAzLaGjfmdSah1qakL'),
|
|
837
837
|
launchTs: 1725551484000,
|
|
838
|
-
oracleSource: __1.OracleSource.
|
|
838
|
+
oracleSource: __1.OracleSource.PYTH_LAZER,
|
|
839
839
|
pythFeedId: '0x8963217838ab4cf5cadc172203c1f0b763fbaa45f346d8ee50ba994bbcac3026',
|
|
840
840
|
pythLazerId: 12,
|
|
841
841
|
},
|
|
@@ -1038,9 +1038,9 @@ exports.MainnetPerpMarkets = [
|
|
|
1038
1038
|
symbol: 'ME-PERP',
|
|
1039
1039
|
baseAssetSymbol: 'ME',
|
|
1040
1040
|
marketIndex: 61,
|
|
1041
|
-
oracle: new web3_js_1.PublicKey('
|
|
1041
|
+
oracle: new web3_js_1.PublicKey('BboTg1yT114FQkqT6MM3P3G3CcCktuM2RePgU8Gr3K4A'),
|
|
1042
1042
|
launchTs: 1733839936000,
|
|
1043
|
-
oracleSource: __1.OracleSource.
|
|
1043
|
+
oracleSource: __1.OracleSource.PYTH_LAZER,
|
|
1044
1044
|
pythFeedId: '0x91519e3e48571e1232a85a938e714da19fe5ce05107f3eebb8a870b2e8020169',
|
|
1045
1045
|
pythLazerId: 93,
|
|
1046
1046
|
},
|
|
@@ -1050,9 +1050,9 @@ exports.MainnetPerpMarkets = [
|
|
|
1050
1050
|
symbol: 'PENGU-PERP',
|
|
1051
1051
|
baseAssetSymbol: 'PENGU',
|
|
1052
1052
|
marketIndex: 62,
|
|
1053
|
-
oracle: new web3_js_1.PublicKey('
|
|
1053
|
+
oracle: new web3_js_1.PublicKey('4A3KroGPjZxPAeBNF287V3NyRwV2q8iBi1vX7kHxTCh7'),
|
|
1054
1054
|
launchTs: 1734444000000,
|
|
1055
|
-
oracleSource: __1.OracleSource.
|
|
1055
|
+
oracleSource: __1.OracleSource.PYTH_LAZER,
|
|
1056
1056
|
pythFeedId: '0xbed3097008b9b5e3c93bec20be79cb43986b85a996475589351a21e67bae9b61',
|
|
1057
1057
|
pythLazerId: 97,
|
|
1058
1058
|
},
|
|
@@ -189,8 +189,8 @@ exports.MainnetSpotMarkets = [
|
|
|
189
189
|
symbol: 'PYTH',
|
|
190
190
|
marketIndex: 7,
|
|
191
191
|
poolId: 0,
|
|
192
|
-
oracle: new web3_js_1.PublicKey('
|
|
193
|
-
oracleSource: __1.OracleSource.
|
|
192
|
+
oracle: new web3_js_1.PublicKey('6Sfx8ZAt6xaEgMXTahR6GrT7oYB6nFBMoVyCmMyHmeJV'),
|
|
193
|
+
oracleSource: __1.OracleSource.PYTH_LAZER,
|
|
194
194
|
mint: new web3_js_1.PublicKey('HZ1JovNiVvGrGNiiYvEozEVgZ58xaU3RKwX8eACQBCt3'),
|
|
195
195
|
precision: new __1.BN(10).pow(numericConstants_1.SIX),
|
|
196
196
|
precisionExp: numericConstants_1.SIX,
|
|
@@ -258,8 +258,8 @@ exports.MainnetSpotMarkets = [
|
|
|
258
258
|
symbol: 'RENDER',
|
|
259
259
|
marketIndex: 12,
|
|
260
260
|
poolId: 0,
|
|
261
|
-
oracle: new web3_js_1.PublicKey('
|
|
262
|
-
oracleSource: __1.OracleSource.
|
|
261
|
+
oracle: new web3_js_1.PublicKey('97EqsAGbTnShB7oYWAFFCVVAx8PWXgDYDhcpm99izNQ4'),
|
|
262
|
+
oracleSource: __1.OracleSource.PYTH_LAZER,
|
|
263
263
|
mint: new web3_js_1.PublicKey('rndrizKT3MK1iimdxRdWabcF7Zg7AR5T4nud4EkHBof'),
|
|
264
264
|
precision: new __1.BN(10).pow(numericConstants_1.EIGHT),
|
|
265
265
|
precisionExp: numericConstants_1.EIGHT,
|
|
@@ -272,8 +272,8 @@ exports.MainnetSpotMarkets = [
|
|
|
272
272
|
symbol: 'W',
|
|
273
273
|
marketIndex: 13,
|
|
274
274
|
poolId: 0,
|
|
275
|
-
oracle: new web3_js_1.PublicKey('
|
|
276
|
-
oracleSource: __1.OracleSource.
|
|
275
|
+
oracle: new web3_js_1.PublicKey('CsFUXiA5dM4eCKjVBBy8tXhXzDkDRNoYjU5rjpHyfNEZ'),
|
|
276
|
+
oracleSource: __1.OracleSource.PYTH_LAZER,
|
|
277
277
|
mint: new web3_js_1.PublicKey('85VBFQZC9TZkfaptBWjvUw7YbZjy52A6mjtPGjstQAmQ'),
|
|
278
278
|
precision: new __1.BN(10).pow(numericConstants_1.SIX),
|
|
279
279
|
precisionExp: numericConstants_1.SIX,
|
|
@@ -473,8 +473,8 @@ exports.MainnetSpotMarkets = [
|
|
|
473
473
|
symbol: 'ME',
|
|
474
474
|
marketIndex: 30,
|
|
475
475
|
poolId: 0,
|
|
476
|
-
oracle: new web3_js_1.PublicKey('
|
|
477
|
-
oracleSource: __1.OracleSource.
|
|
476
|
+
oracle: new web3_js_1.PublicKey('BboTg1yT114FQkqT6MM3P3G3CcCktuM2RePgU8Gr3K4A'),
|
|
477
|
+
oracleSource: __1.OracleSource.PYTH_LAZER,
|
|
478
478
|
mint: new web3_js_1.PublicKey('MEFNBXixkEbait3xn9bkm8WsJzXtVsaJEn4c8Sam21u'),
|
|
479
479
|
precision: new __1.BN(10).pow(numericConstants_1.SIX),
|
|
480
480
|
precisionExp: numericConstants_1.SIX,
|
|
@@ -485,8 +485,8 @@ exports.MainnetSpotMarkets = [
|
|
|
485
485
|
symbol: 'PENGU',
|
|
486
486
|
marketIndex: 31,
|
|
487
487
|
poolId: 0,
|
|
488
|
-
oracle: new web3_js_1.PublicKey('
|
|
489
|
-
oracleSource: __1.OracleSource.
|
|
488
|
+
oracle: new web3_js_1.PublicKey('4A3KroGPjZxPAeBNF287V3NyRwV2q8iBi1vX7kHxTCh7'),
|
|
489
|
+
oracleSource: __1.OracleSource.PYTH_LAZER,
|
|
490
490
|
mint: new web3_js_1.PublicKey('2zMMhcVQEXDtdE6vsFS7S7D5oUodfJHE8vd1gnBouauv'),
|
|
491
491
|
precision: new __1.BN(10).pow(numericConstants_1.SIX),
|
|
492
492
|
precisionExp: numericConstants_1.SIX,
|
|
@@ -30,7 +30,7 @@ class OrderNode {
|
|
|
30
30
|
return msg;
|
|
31
31
|
}
|
|
32
32
|
getPrice(oraclePriceData, slot) {
|
|
33
|
-
return (0, __1.getLimitPrice)(this.order, oraclePriceData, slot, undefined, this.applyProtectedMakerOffset);
|
|
33
|
+
return (0, __1.getLimitPrice)(this.order, oraclePriceData, slot, undefined, this.applyProtectedMakerOffset && this.isProtectedMaker);
|
|
34
34
|
}
|
|
35
35
|
isBaseFilled() {
|
|
36
36
|
return this.order.baseAssetAmountFilled.eq(this.order.baseAssetAmount);
|
|
@@ -49,7 +49,7 @@ exports.TakingLimitOrderNode = TakingLimitOrderNode;
|
|
|
49
49
|
class RestingLimitOrderNode extends OrderNode {
|
|
50
50
|
getSortValue(order) {
|
|
51
51
|
let sortValue = order.price;
|
|
52
|
-
if (this.applyProtectedMakerOffset) {
|
|
52
|
+
if (this.applyProtectedMakerOffset && this.isProtectedMaker) {
|
|
53
53
|
const offset = sortValue.divn(1000);
|
|
54
54
|
if ((0, __1.isVariant)(order.direction, 'long')) {
|
|
55
55
|
sortValue = sortValue.sub(offset);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as anchor from '@coral-xyz/anchor';
|
|
6
6
|
import { AnchorProvider, BN, Program, ProgramAccount } from '@coral-xyz/anchor';
|
|
7
7
|
import { Idl as Idl30, Program as Program30 } from '@coral-xyz/anchor-30';
|
|
8
|
-
import { DriftClientMetricsEvents, HighLeverageModeConfig, IWallet, MakerInfo, MappedRecord, MarketType, ModifyOrderPolicy, OpenbookV2FulfillmentConfigAccount, OptionalOrderParams, OracleSource, Order, OrderParams, OrderTriggerCondition, PerpMarketAccount, PerpMarketExtendedInfo, PhoenixV1FulfillmentConfigAccount, PlaceAndTakeOrderSuccessCondition, PositionDirection, ReferrerInfo, ReferrerNameAccount,
|
|
8
|
+
import { DriftClientMetricsEvents, HighLeverageModeConfig, IWallet, MakerInfo, MappedRecord, MarketType, ModifyOrderPolicy, OpenbookV2FulfillmentConfigAccount, OptionalOrderParams, OracleSource, Order, OrderParams, OrderTriggerCondition, PerpMarketAccount, PerpMarketExtendedInfo, PhoenixV1FulfillmentConfigAccount, PlaceAndTakeOrderSuccessCondition, PositionDirection, ReferrerInfo, ReferrerNameAccount, SerumV3FulfillmentConfigAccount, SettlePnlMode, SignedTxData, SpotMarketAccount, SpotPosition, StateAccount, SwapReduceOnly, SwiftOrderParamsMessage, TakerInfo, TxParams, UserAccount, UserStatsAccount } from './types';
|
|
9
9
|
import { AccountMeta, AddressLookupTableAccount, BlockhashWithExpiryBlockHeight, ConfirmOptions, Connection, Keypair, PublicKey, Signer, Transaction, TransactionInstruction, TransactionSignature, TransactionVersion, VersionedTransaction } from '@solana/web3.js';
|
|
10
10
|
import { TokenFaucet } from './tokenFaucet';
|
|
11
11
|
import { EventEmitter } from 'events';
|
|
@@ -60,8 +60,12 @@ export declare class DriftClient {
|
|
|
60
60
|
mustIncludePerpMarketIndexes: Set<number>;
|
|
61
61
|
mustIncludeSpotMarketIndexes: Set<number>;
|
|
62
62
|
authority: PublicKey;
|
|
63
|
+
/** @deprecated use marketLookupTables */
|
|
63
64
|
marketLookupTable: PublicKey;
|
|
65
|
+
/** @deprecated use lookupTableAccounts */
|
|
64
66
|
lookupTableAccount: AddressLookupTableAccount;
|
|
67
|
+
marketLookupTables: PublicKey[];
|
|
68
|
+
lookupTableAccounts: AddressLookupTableAccount[];
|
|
65
69
|
includeDelegates?: boolean;
|
|
66
70
|
authoritySubAccountMap?: Map<string, number[]>;
|
|
67
71
|
skipLoadUsers?: boolean;
|
|
@@ -118,7 +122,9 @@ export declare class DriftClient {
|
|
|
118
122
|
getPhoenixV1FulfillmentConfigs(): Promise<PhoenixV1FulfillmentConfigAccount[]>;
|
|
119
123
|
getOpenbookV2FulfillmentConfig(openbookMarket: PublicKey): Promise<OpenbookV2FulfillmentConfigAccount>;
|
|
120
124
|
getOpenbookV2FulfillmentConfigs(): Promise<OpenbookV2FulfillmentConfigAccount[]>;
|
|
125
|
+
/** @deprecated use fetchAllLookupTableAccounts() */
|
|
121
126
|
fetchMarketLookupTableAccount(): Promise<AddressLookupTableAccount>;
|
|
127
|
+
fetchAllLookupTableAccounts(): Promise<AddressLookupTableAccount[]>;
|
|
122
128
|
/**
|
|
123
129
|
* Update the wallet to use for drift transactions and linked user account
|
|
124
130
|
* @param newWallet
|
|
@@ -142,8 +148,6 @@ export declare class DriftClient {
|
|
|
142
148
|
addAndSubscribeToUsers(authority?: PublicKey): Promise<boolean>;
|
|
143
149
|
initializeUserAccount(subAccountId?: number, name?: string, referrerInfo?: ReferrerInfo, txParams?: TxParams): Promise<[TransactionSignature, PublicKey]>;
|
|
144
150
|
getInitializeUserStatsIx(): Promise<TransactionInstruction>;
|
|
145
|
-
initializeRFQUser(userAccountPublicKey: PublicKey, txParams?: TxParams): Promise<[TransactionSignature, PublicKey]>;
|
|
146
|
-
getInitializeRFQUserInstruction(userAccountPublicKey: PublicKey): Promise<[PublicKey, TransactionInstruction]>;
|
|
147
151
|
initializeSwiftUserOrders(authority: PublicKey, numOrders: number, txParams?: TxParams): Promise<[TransactionSignature, PublicKey]>;
|
|
148
152
|
getInitializeSwiftUserOrdersAccountIx(authority: PublicKey, numOrders: number): Promise<[PublicKey, TransactionInstruction]>;
|
|
149
153
|
resizeSwiftUserOrders(authority: PublicKey, numOrders: number, txParams?: TxParams): Promise<TransactionSignature>;
|
|
@@ -554,25 +558,26 @@ export declare class DriftClient {
|
|
|
554
558
|
taker: PublicKey;
|
|
555
559
|
takerStats: PublicKey;
|
|
556
560
|
takerUserAccount: UserAccount;
|
|
561
|
+
signingAuthority: PublicKey;
|
|
557
562
|
}, precedingIxs?: TransactionInstruction[], overrideIxCount?: number, txParams?: TxParams): Promise<TransactionSignature>;
|
|
558
563
|
getPlaceSwiftTakerPerpOrderIxs(signedSwiftOrderParams: SignedSwiftOrderParams, marketIndex: number, takerInfo: {
|
|
559
564
|
taker: PublicKey;
|
|
560
565
|
takerStats: PublicKey;
|
|
561
566
|
takerUserAccount: UserAccount;
|
|
562
|
-
|
|
567
|
+
signingAuthority: PublicKey;
|
|
568
|
+
}, precedingIxs?: TransactionInstruction[], overrideIxCount?: number): Promise<TransactionInstruction[]>;
|
|
563
569
|
placeAndMakeSwiftPerpOrder(signedSwiftOrderParams: SignedSwiftOrderParams, swiftOrderUuid: Uint8Array, takerInfo: {
|
|
564
570
|
taker: PublicKey;
|
|
565
571
|
takerStats: PublicKey;
|
|
566
572
|
takerUserAccount: UserAccount;
|
|
573
|
+
signingAuthority: PublicKey;
|
|
567
574
|
}, orderParams: OptionalOrderParams, referrerInfo?: ReferrerInfo, txParams?: TxParams, subAccountId?: number, precedingIxs?: TransactionInstruction[], overrideIxCount?: number): Promise<TransactionSignature>;
|
|
568
575
|
getPlaceAndMakeSwiftPerpOrderIxs(signedSwiftOrderParams: SignedSwiftOrderParams, swiftOrderUuid: Uint8Array, takerInfo: {
|
|
569
576
|
taker: PublicKey;
|
|
570
577
|
takerStats: PublicKey;
|
|
571
578
|
takerUserAccount: UserAccount;
|
|
579
|
+
signingAuthority: PublicKey;
|
|
572
580
|
}, orderParams: OptionalOrderParams, referrerInfo?: ReferrerInfo, subAccountId?: number, precedingIxs?: TransactionInstruction[], overrideIxCount?: number): Promise<TransactionInstruction[]>;
|
|
573
|
-
encodeRFQMakerOrderParams(message: RFQMakerOrderParams): Buffer;
|
|
574
|
-
placeAndMatchRFQOrders(rfqMatches: RFQMatch[], txParams?: TxParams): Promise<TransactionSignature>;
|
|
575
|
-
getPlaceAndMatchRFQOrdersIxs(rfqMatches: RFQMatch[]): Promise<TransactionInstruction[]>;
|
|
576
581
|
preparePlaceAndTakeSpotOrder(orderParams: OptionalOrderParams, fulfillmentConfig?: SerumV3FulfillmentConfigAccount, makerInfo?: MakerInfo, referrerInfo?: ReferrerInfo, txParams?: TxParams, subAccountId?: number): Promise<{
|
|
577
582
|
placeAndTakeSpotOrderTx: anchor.web3.Transaction | anchor.web3.VersionedTransaction;
|
|
578
583
|
}>;
|