@drift-labs/sdk 2.146.0-beta.13 → 2.146.0-beta.15

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 CHANGED
@@ -1 +1 @@
1
- 2.146.0-beta.13
1
+ 2.146.0-beta.15
@@ -22,11 +22,11 @@ export declare class AdminClient extends DriftClient {
22
22
  initializeOpenbookV2FulfillmentConfig(marketIndex: number, openbookMarket: PublicKey): Promise<TransactionSignature>;
23
23
  getInitializeOpenbookV2FulfillmentConfigIx(marketIndex: number, openbookMarket: PublicKey): Promise<TransactionInstruction>;
24
24
  initializePerpMarket(marketIndex: number, priceOracle: PublicKey, baseAssetReserve: BN, quoteAssetReserve: BN, periodicity: BN, pegMultiplier?: BN, oracleSource?: OracleSource, contractTier?: ContractTier, marginRatioInitial?: number, marginRatioMaintenance?: number, liquidatorFee?: number, ifLiquidatorFee?: number, imfFactor?: number, activeStatus?: boolean, baseSpread?: number, maxSpread?: number, maxOpenInterest?: BN, maxRevenueWithdrawPerPeriod?: BN, quoteMaxInsurance?: BN, orderStepSize?: BN, orderTickSize?: BN, minOrderSize?: BN, concentrationCoefScale?: BN, curveUpdateIntensity?: number, ammJitIntensity?: number, name?: string, lpPoolId?: number): Promise<TransactionSignature>;
25
- getInitializePerpMarketIx(marketIndex: number, priceOracle: PublicKey, baseAssetReserve: BN, quoteAssetReserve: BN, periodicity: BN, pegMultiplier?: BN, oracleSource?: OracleSource, contractTier?: ContractTier, marginRatioInitial?: number, marginRatioMaintenance?: number, liquidatorFee?: number, ifLiquidatorFee?: number, imfFactor?: number, activeStatus?: boolean, baseSpread?: number, maxSpread?: number, maxOpenInterest?: BN, maxRevenueWithdrawPerPeriod?: BN, quoteMaxInsurance?: BN, orderStepSize?: BN, orderTickSize?: BN, minOrderSize?: BN, concentrationCoefScale?: BN, curveUpdateIntensity?: number, ammJitIntensity?: number, name?: string, lpPoolId?: number, includeInitAmmCacheIx?: boolean): Promise<TransactionInstruction[]>;
25
+ getInitializePerpMarketIx(marketIndex: number, priceOracle: PublicKey, baseAssetReserve: BN, quoteAssetReserve: BN, periodicity: BN, pegMultiplier?: BN, oracleSource?: OracleSource, contractTier?: ContractTier, marginRatioInitial?: number, marginRatioMaintenance?: number, liquidatorFee?: number, ifLiquidatorFee?: number, imfFactor?: number, activeStatus?: boolean, baseSpread?: number, maxSpread?: number, maxOpenInterest?: BN, maxRevenueWithdrawPerPeriod?: BN, quoteMaxInsurance?: BN, orderStepSize?: BN, orderTickSize?: BN, minOrderSize?: BN, concentrationCoefScale?: BN, curveUpdateIntensity?: number, ammJitIntensity?: number, name?: string, lpPoolId?: number): Promise<TransactionInstruction[]>;
26
26
  initializeAmmCache(txParams?: TxParams): Promise<TransactionSignature>;
27
27
  getInitializeAmmCacheIx(): Promise<TransactionInstruction>;
28
- resizeAmmCache(txParams?: TxParams): Promise<TransactionSignature>;
29
- getResizeAmmCacheIx(): Promise<TransactionInstruction>;
28
+ addMarketToAmmCache(perpMarketIndex: number, txParams?: TxParams): Promise<TransactionSignature>;
29
+ getAddMarketToAmmCacheIx(perpMarketIndex: number): Promise<TransactionInstruction>;
30
30
  deleteAmmCache(txParams?: TxParams): Promise<TransactionSignature>;
31
31
  getDeleteAmmCacheIx(): Promise<TransactionInstruction>;
32
32
  updateInitialAmmCacheInfo(perpMarketIndexes: number[], txParams?: TxParams): Promise<TransactionSignature>;
@@ -207,10 +207,7 @@ class AdminClient extends driftClient_1.DriftClient {
207
207
  }
208
208
  async initializePerpMarket(marketIndex, priceOracle, baseAssetReserve, quoteAssetReserve, periodicity, pegMultiplier = numericConstants_1.PEG_PRECISION, oracleSource = types_1.OracleSource.PYTH, contractTier = types_1.ContractTier.SPECULATIVE, marginRatioInitial = 2000, marginRatioMaintenance = 500, liquidatorFee = 0, ifLiquidatorFee = 10000, imfFactor = 0, activeStatus = true, baseSpread = 0, maxSpread = 142500, maxOpenInterest = numericConstants_1.ZERO, maxRevenueWithdrawPerPeriod = numericConstants_1.ZERO, quoteMaxInsurance = numericConstants_1.ZERO, orderStepSize = numericConstants_1.BASE_PRECISION.divn(10000), orderTickSize = numericConstants_1.PRICE_PRECISION.divn(100000), minOrderSize = numericConstants_1.BASE_PRECISION.divn(10000), concentrationCoefScale = numericConstants_1.ONE, curveUpdateIntensity = 0, ammJitIntensity = 0, name = userName_1.DEFAULT_MARKET_NAME, lpPoolId = 0) {
209
209
  const currentPerpMarketIndex = this.getStateAccount().numberOfMarkets;
210
- const ammCachePublicKey = (0, pda_1.getAmmCachePublicKey)(this.program.programId);
211
- const ammCacheAccount = await this.connection.getAccountInfo(ammCachePublicKey);
212
- const mustInitializeAmmCache = (ammCacheAccount === null || ammCacheAccount === void 0 ? void 0 : ammCacheAccount.data) == null;
213
- const initializeMarketIxs = await this.getInitializePerpMarketIx(marketIndex, priceOracle, baseAssetReserve, quoteAssetReserve, periodicity, pegMultiplier, oracleSource, contractTier, marginRatioInitial, marginRatioMaintenance, liquidatorFee, ifLiquidatorFee, imfFactor, activeStatus, baseSpread, maxSpread, maxOpenInterest, maxRevenueWithdrawPerPeriod, quoteMaxInsurance, orderStepSize, orderTickSize, minOrderSize, concentrationCoefScale, curveUpdateIntensity, ammJitIntensity, name, lpPoolId, mustInitializeAmmCache);
210
+ const initializeMarketIxs = await this.getInitializePerpMarketIx(marketIndex, priceOracle, baseAssetReserve, quoteAssetReserve, periodicity, pegMultiplier, oracleSource, contractTier, marginRatioInitial, marginRatioMaintenance, liquidatorFee, ifLiquidatorFee, imfFactor, activeStatus, baseSpread, maxSpread, maxOpenInterest, maxRevenueWithdrawPerPeriod, quoteMaxInsurance, orderStepSize, orderTickSize, minOrderSize, concentrationCoefScale, curveUpdateIntensity, ammJitIntensity, name, lpPoolId);
214
211
  const tx = await this.buildTransaction(initializeMarketIxs);
215
212
  const { txSig } = await this.sendTransaction(tx, [], this.opts);
216
213
  while (this.getStateAccount().numberOfMarkets <= currentPerpMarketIndex) {
@@ -224,12 +221,9 @@ class AdminClient extends driftClient_1.DriftClient {
224
221
  await this.accountSubscriber.setPerpOracleMap();
225
222
  return txSig;
226
223
  }
227
- async getInitializePerpMarketIx(marketIndex, priceOracle, baseAssetReserve, quoteAssetReserve, periodicity, pegMultiplier = numericConstants_1.PEG_PRECISION, oracleSource = types_1.OracleSource.PYTH, contractTier = types_1.ContractTier.SPECULATIVE, marginRatioInitial = 2000, marginRatioMaintenance = 500, liquidatorFee = 0, ifLiquidatorFee = 10000, imfFactor = 0, activeStatus = true, baseSpread = 0, maxSpread = 142500, maxOpenInterest = numericConstants_1.ZERO, maxRevenueWithdrawPerPeriod = numericConstants_1.ZERO, quoteMaxInsurance = numericConstants_1.ZERO, orderStepSize = numericConstants_1.BASE_PRECISION.divn(10000), orderTickSize = numericConstants_1.PRICE_PRECISION.divn(100000), minOrderSize = numericConstants_1.BASE_PRECISION.divn(10000), concentrationCoefScale = numericConstants_1.ONE, curveUpdateIntensity = 0, ammJitIntensity = 0, name = userName_1.DEFAULT_MARKET_NAME, lpPoolId = 0, includeInitAmmCacheIx = false) {
224
+ async getInitializePerpMarketIx(marketIndex, priceOracle, baseAssetReserve, quoteAssetReserve, periodicity, pegMultiplier = numericConstants_1.PEG_PRECISION, oracleSource = types_1.OracleSource.PYTH, contractTier = types_1.ContractTier.SPECULATIVE, marginRatioInitial = 2000, marginRatioMaintenance = 500, liquidatorFee = 0, ifLiquidatorFee = 10000, imfFactor = 0, activeStatus = true, baseSpread = 0, maxSpread = 142500, maxOpenInterest = numericConstants_1.ZERO, maxRevenueWithdrawPerPeriod = numericConstants_1.ZERO, quoteMaxInsurance = numericConstants_1.ZERO, orderStepSize = numericConstants_1.BASE_PRECISION.divn(10000), orderTickSize = numericConstants_1.PRICE_PRECISION.divn(100000), minOrderSize = numericConstants_1.BASE_PRECISION.divn(10000), concentrationCoefScale = numericConstants_1.ONE, curveUpdateIntensity = 0, ammJitIntensity = 0, name = userName_1.DEFAULT_MARKET_NAME, lpPoolId = 0) {
228
225
  const perpMarketPublicKey = await (0, pda_1.getPerpMarketPublicKey)(this.program.programId, marketIndex);
229
226
  const ixs = [];
230
- if (includeInitAmmCacheIx) {
231
- ixs.push(await this.getInitializeAmmCacheIx());
232
- }
233
227
  const nameBuffer = (0, userName_1.encodeName)(name);
234
228
  const initPerpIx = await this.program.instruction.initializePerpMarket(marketIndex, baseAssetReserve, quoteAssetReserve, periodicity, pegMultiplier, oracleSource, contractTier, marginRatioInitial, marginRatioMaintenance, liquidatorFee, ifLiquidatorFee, imfFactor, activeStatus, baseSpread, maxSpread, maxOpenInterest, maxRevenueWithdrawPerPeriod, quoteMaxInsurance, orderStepSize, orderTickSize, minOrderSize, concentrationCoefScale, curveUpdateIntensity, ammJitIntensity, nameBuffer, lpPoolId, {
235
229
  accounts: {
@@ -239,7 +233,6 @@ class AdminClient extends driftClient_1.DriftClient {
239
233
  : this.wallet.publicKey,
240
234
  oracle: priceOracle,
241
235
  perpMarket: perpMarketPublicKey,
242
- ammCache: (0, pda_1.getAmmCachePublicKey)(this.program.programId),
243
236
  rent: web3_js_1.SYSVAR_RENT_PUBKEY,
244
237
  systemProgram: anchor.web3.SystemProgram.programId,
245
238
  },
@@ -260,25 +253,26 @@ class AdminClient extends driftClient_1.DriftClient {
260
253
  admin: this.useHotWalletAdmin
261
254
  ? this.wallet.publicKey
262
255
  : this.getStateAccount().admin,
263
- ammCache: (0, pda_1.getAmmCachePublicKey)(this.program.programId),
264
256
  rent: web3_js_1.SYSVAR_RENT_PUBKEY,
257
+ ammCache: (0, pda_1.getAmmCachePublicKey)(this.program.programId),
265
258
  systemProgram: anchor.web3.SystemProgram.programId,
266
259
  },
267
260
  });
268
261
  }
269
- async resizeAmmCache(txParams) {
270
- const initializeAmmCacheIx = await this.getResizeAmmCacheIx();
262
+ async addMarketToAmmCache(perpMarketIndex, txParams) {
263
+ const initializeAmmCacheIx = await this.getAddMarketToAmmCacheIx(perpMarketIndex);
271
264
  const tx = await this.buildTransaction(initializeAmmCacheIx, txParams);
272
265
  const { txSig } = await this.sendTransaction(tx, [], this.opts);
273
266
  return txSig;
274
267
  }
275
- async getResizeAmmCacheIx() {
276
- return await this.program.instruction.resizeAmmCache({
268
+ async getAddMarketToAmmCacheIx(perpMarketIndex) {
269
+ return await this.program.instruction.addMarketToAmmCache({
277
270
  accounts: {
278
271
  state: await this.getStatePublicKey(),
279
272
  admin: this.useHotWalletAdmin
280
273
  ? this.wallet.publicKey
281
274
  : this.getStateAccount().admin,
275
+ perpMarket: this.getPerpMarketAccount(perpMarketIndex).pubkey,
282
276
  ammCache: (0, pda_1.getAmmCachePublicKey)(this.program.programId),
283
277
  rent: web3_js_1.SYSVAR_RENT_PUBKEY,
284
278
  systemProgram: anchor.web3.SystemProgram.programId,
@@ -1,5 +1,5 @@
1
1
  import { PublicKey } from '@solana/web3.js';
2
- import { OracleSource } from '../types';
2
+ import { MarketStatus, OracleSource } from '../types';
3
3
  import { DriftEnv } from '../config';
4
4
  export type PerpMarketConfig = {
5
5
  fullName?: string;
@@ -12,6 +12,7 @@ export type PerpMarketConfig = {
12
12
  oracleSource: OracleSource;
13
13
  pythFeedId?: string;
14
14
  pythLazerId?: number;
15
+ marketStatus?: MarketStatus;
15
16
  };
16
17
  export declare const DevnetPerpMarkets: PerpMarketConfig[];
17
18
  export declare const MainnetPerpMarkets: PerpMarketConfig[];
@@ -558,6 +558,7 @@ exports.MainnetPerpMarkets = [
558
558
  launchTs: 1699265968000,
559
559
  oracleSource: types_1.OracleSource.PYTH_PULL,
560
560
  pythFeedId: '0x2f2d17abbc1e781bd87b4a5d52c8b2856886f5c482fa3593cebf6795040ab0b6',
561
+ marketStatus: types_1.MarketStatus.DELISTED,
561
562
  },
562
563
  {
563
564
  fullName: 'Pyth',
@@ -654,6 +655,7 @@ exports.MainnetPerpMarkets = [
654
655
  oracleSource: types_1.OracleSource.PYTH_LAZER,
655
656
  pythFeedId: '0xa9f3b2a89c6f85a6c20a9518abde39b944e839ca49a0c92307c65974d3f14a57',
656
657
  pythLazerId: 83,
658
+ marketStatus: types_1.MarketStatus.DELISTED,
657
659
  },
658
660
  {
659
661
  fullName: 'BITTENSOR',
@@ -738,6 +740,7 @@ exports.MainnetPerpMarkets = [
738
740
  oracleSource: types_1.OracleSource.PYTH_LAZER,
739
741
  pythFeedId: '0x82595d1509b770fa52681e260af4dda9752b87316d7c048535d8ead3fa856eb1',
740
742
  pythLazerId: 90,
743
+ marketStatus: types_1.MarketStatus.DELISTED,
741
744
  },
742
745
  {
743
746
  fullName: 'ZEX',
@@ -749,6 +752,7 @@ exports.MainnetPerpMarkets = [
749
752
  launchTs: 1719415157000,
750
753
  oracleSource: types_1.OracleSource.PYTH_PULL,
751
754
  pythFeedId: '0x3d63be09d1b88f6dffe6585d0170670592124fd9fa4e0fe8a09ff18464f05e3a',
755
+ marketStatus: types_1.MarketStatus.DELISTED,
752
756
  },
753
757
  {
754
758
  fullName: 'POPCAT',
@@ -772,6 +776,7 @@ exports.MainnetPerpMarkets = [
772
776
  launchTs: 1720633344000,
773
777
  oracleSource: types_1.OracleSource.PYTH_1K_PULL,
774
778
  pythFeedId: '0x5169491cd7e2a44c98353b779d5eb612e4ac32e073f5cc534303d86307c2f1bc',
779
+ marketStatus: types_1.MarketStatus.DELISTED,
775
780
  },
776
781
  {
777
782
  fullName: 'TRUMP-WIN-2024-BET',
@@ -782,6 +787,7 @@ exports.MainnetPerpMarkets = [
782
787
  oracle: new web3_js_1.PublicKey('7YrQUxmxGdbk8pvns9KcL5ojbZSL2eHj62hxRqggtEUR'),
783
788
  launchTs: 1723996800000,
784
789
  oracleSource: types_1.OracleSource.Prelaunch,
790
+ marketStatus: types_1.MarketStatus.DELISTED,
785
791
  },
786
792
  {
787
793
  fullName: 'KAMALA-POPULAR-VOTE-2024-BET',
@@ -792,6 +798,7 @@ exports.MainnetPerpMarkets = [
792
798
  oracle: new web3_js_1.PublicKey('AowFw1dCVjS8kngvTCoT3oshiUyL69k7P1uxqXwteWH4'),
793
799
  launchTs: 1723996800000,
794
800
  oracleSource: types_1.OracleSource.Prelaunch,
801
+ marketStatus: types_1.MarketStatus.DELISTED,
795
802
  },
796
803
  {
797
804
  fullName: 'FED-CUT-50-SEPT-2024-BET',
@@ -802,6 +809,7 @@ exports.MainnetPerpMarkets = [
802
809
  oracle: new web3_js_1.PublicKey('5QzgqAbEhJ1cPnLX4tSZEXezmW7sz7PPVVg2VanGi8QQ'),
803
810
  launchTs: 1724250126000,
804
811
  oracleSource: types_1.OracleSource.Prelaunch,
812
+ marketStatus: types_1.MarketStatus.DELISTED,
805
813
  },
806
814
  {
807
815
  fullName: 'REPUBLICAN-POPULAR-AND-WIN-BET',
@@ -812,6 +820,7 @@ exports.MainnetPerpMarkets = [
812
820
  oracle: new web3_js_1.PublicKey('BtUUSUc9rZSzBmmKhQq4no65zHQTzMFeVYss7xcMRD53'),
813
821
  launchTs: 1724250126000,
814
822
  oracleSource: types_1.OracleSource.Prelaunch,
823
+ marketStatus: types_1.MarketStatus.DELISTED,
815
824
  },
816
825
  {
817
826
  fullName: 'BREAKPOINT-IGGYERIC-BET',
@@ -822,6 +831,7 @@ exports.MainnetPerpMarkets = [
822
831
  oracle: new web3_js_1.PublicKey('2ftYxoSupperd4ULxy9xyS2Az38wfAe7Lm8FCAPwjjVV'),
823
832
  launchTs: 1724250126000,
824
833
  oracleSource: types_1.OracleSource.Prelaunch,
834
+ marketStatus: types_1.MarketStatus.DELISTED,
825
835
  },
826
836
  {
827
837
  fullName: 'DEMOCRATS-WIN-MICHIGAN-BET',
@@ -832,6 +842,7 @@ exports.MainnetPerpMarkets = [
832
842
  oracle: new web3_js_1.PublicKey('8HTDLjhb2esGU5mu11v3pq3eWeFqmvKPkQNCnTTwKAyB'),
833
843
  launchTs: 1725551484000,
834
844
  oracleSource: types_1.OracleSource.Prelaunch,
845
+ marketStatus: types_1.MarketStatus.DELISTED,
835
846
  },
836
847
  {
837
848
  fullName: 'TON',
@@ -854,6 +865,7 @@ exports.MainnetPerpMarkets = [
854
865
  oracle: new web3_js_1.PublicKey('DpJz7rjTJLxxnuqrqZTUjMWtnaMFAEfZUv5ATdb9HTh1'),
855
866
  launchTs: 1726646453000,
856
867
  oracleSource: types_1.OracleSource.Prelaunch,
868
+ marketStatus: types_1.MarketStatus.DELISTED,
857
869
  },
858
870
  {
859
871
  fullName: 'MOTHER',
@@ -866,6 +878,7 @@ exports.MainnetPerpMarkets = [
866
878
  oracleSource: types_1.OracleSource.PYTH_LAZER,
867
879
  pythFeedId: '0x62742a997d01f7524f791fdb2dd43aaf0e567d765ebf8fd0406a994239e874d4',
868
880
  pythLazerId: 501,
881
+ marketStatus: types_1.MarketStatus.DELISTED,
869
882
  },
870
883
  {
871
884
  fullName: 'MOODENG',
@@ -878,6 +891,7 @@ exports.MainnetPerpMarkets = [
878
891
  oracleSource: types_1.OracleSource.PYTH_LAZER,
879
892
  pythFeedId: '0xffff73128917a90950cd0473fd2551d7cd274fd5a6cc45641881bbcc6ee73417',
880
893
  pythLazerId: 500,
894
+ marketStatus: types_1.MarketStatus.DELISTED,
881
895
  },
882
896
  {
883
897
  fullName: 'WARWICK-FIGHT-WIN-BET',
@@ -888,6 +902,7 @@ exports.MainnetPerpMarkets = [
888
902
  oracle: new web3_js_1.PublicKey('Dz5Nvxo1hv7Zfyu11hy8e97twLMRKk6heTWCDGXytj7N'),
889
903
  launchTs: 1727965864000,
890
904
  oracleSource: types_1.OracleSource.Prelaunch,
905
+ marketStatus: types_1.MarketStatus.DELISTED,
891
906
  },
892
907
  {
893
908
  fullName: 'DeBridge',
@@ -899,6 +914,7 @@ exports.MainnetPerpMarkets = [
899
914
  launchTs: 1728574493000,
900
915
  oracleSource: types_1.OracleSource.PYTH_PULL,
901
916
  pythFeedId: '0xf788488fe2df341b10a498e0a789f03209c0938d9ed04bc521f8224748d6d236',
917
+ marketStatus: types_1.MarketStatus.DELISTED,
902
918
  },
903
919
  {
904
920
  fullName: 'WLF-5B-1W',
@@ -909,6 +925,7 @@ exports.MainnetPerpMarkets = [
909
925
  oracle: new web3_js_1.PublicKey('7LpRfPaWR7cQqN7CMkCmZjEQpWyqso5LGuKCvDXH5ZAr'),
910
926
  launchTs: 1728574493000,
911
927
  oracleSource: types_1.OracleSource.Prelaunch,
928
+ marketStatus: types_1.MarketStatus.DELISTED,
912
929
  },
913
930
  {
914
931
  fullName: 'VRSTPN-WIN-F1-24-DRVRS-CHMP',
@@ -919,6 +936,7 @@ exports.MainnetPerpMarkets = [
919
936
  oracle: new web3_js_1.PublicKey('E36rvXEwysWeiToXCpWfHVADd8bzzyR4w83ZSSwxAxqG'),
920
937
  launchTs: 1729209600000,
921
938
  oracleSource: types_1.OracleSource.Prelaunch,
939
+ marketStatus: types_1.MarketStatus.DELISTED,
922
940
  },
923
941
  {
924
942
  fullName: 'LNDO-WIN-F1-24-US-GP',
@@ -929,6 +947,7 @@ exports.MainnetPerpMarkets = [
929
947
  oracle: new web3_js_1.PublicKey('6AVy1y9SnJECnosQaiK2uY1kcT4ZEBf1F4DMvhxgvhUo'),
930
948
  launchTs: 1729209600000,
931
949
  oracleSource: types_1.OracleSource.Prelaunch,
950
+ marketStatus: types_1.MarketStatus.DELISTED,
932
951
  },
933
952
  {
934
953
  fullName: '1KMEW',
@@ -941,6 +960,7 @@ exports.MainnetPerpMarkets = [
941
960
  oracleSource: types_1.OracleSource.PYTH_LAZER_1K,
942
961
  pythFeedId: '0x514aed52ca5294177f20187ae883cec4a018619772ddce41efcc36a6448f5d5d',
943
962
  pythLazerId: 137,
963
+ marketStatus: types_1.MarketStatus.DELISTED,
944
964
  },
945
965
  {
946
966
  fullName: 'MICHI',
@@ -952,6 +972,7 @@ exports.MainnetPerpMarkets = [
952
972
  launchTs: 1730402722000,
953
973
  oracleSource: types_1.OracleSource.PYTH_PULL,
954
974
  pythFeedId: '0x63a45218d6b13ffd28ca04748615511bf70eff80a3411c97d96b8ed74a6decab',
975
+ marketStatus: types_1.MarketStatus.DELISTED,
955
976
  },
956
977
  {
957
978
  fullName: 'GOAT',
@@ -964,6 +985,7 @@ exports.MainnetPerpMarkets = [
964
985
  oracleSource: types_1.OracleSource.PYTH_LAZER,
965
986
  pythFeedId: '0xf7731dc812590214d3eb4343bfb13d1b4cfa9b1d4e020644b5d5d8e07d60c66c',
966
987
  pythLazerId: 437,
988
+ marketStatus: types_1.MarketStatus.DELISTED,
967
989
  },
968
990
  {
969
991
  fullName: 'FWOG',
@@ -975,6 +997,7 @@ exports.MainnetPerpMarkets = [
975
997
  launchTs: 1731443152000,
976
998
  oracleSource: types_1.OracleSource.PYTH_PULL,
977
999
  pythFeedId: '0x656cc2a39dd795bdecb59de810d4f4d1e74c25fe4c42d0bf1c65a38d74df48e9',
1000
+ marketStatus: types_1.MarketStatus.DELISTED,
978
1001
  },
979
1002
  {
980
1003
  fullName: 'PNUT',
@@ -987,6 +1010,7 @@ exports.MainnetPerpMarkets = [
987
1010
  oracleSource: types_1.OracleSource.PYTH_LAZER,
988
1011
  pythFeedId: '0x116da895807f81f6b5c5f01b109376e7f6834dc8b51365ab7cdfa66634340e54',
989
1012
  pythLazerId: 77,
1013
+ marketStatus: types_1.MarketStatus.DELISTED,
990
1014
  },
991
1015
  {
992
1016
  fullName: 'RAY',
@@ -1009,6 +1033,7 @@ exports.MainnetPerpMarkets = [
1009
1033
  oracle: new web3_js_1.PublicKey('GfTeKKnBxeLSB1Hm24ArjduQM4yqaAgoGgiC99gq5E2P'),
1010
1034
  launchTs: 1732721897000,
1011
1035
  oracleSource: types_1.OracleSource.Prelaunch,
1036
+ marketStatus: types_1.MarketStatus.DELISTED,
1012
1037
  },
1013
1038
  {
1014
1039
  fullName: 'SUPERBOWL-LIX-CHIEFS',
@@ -1019,6 +1044,7 @@ exports.MainnetPerpMarkets = [
1019
1044
  oracle: new web3_js_1.PublicKey('EdB17Nyu4bnEBiSEfFrwvp4VCUvtq9eDJHc6Ujys3Jwd'),
1020
1045
  launchTs: 1732721897000,
1021
1046
  oracleSource: types_1.OracleSource.Prelaunch,
1047
+ marketStatus: types_1.MarketStatus.DELISTED,
1022
1048
  },
1023
1049
  {
1024
1050
  fullName: 'Hyperliquid',
@@ -1079,6 +1105,7 @@ exports.MainnetPerpMarkets = [
1079
1105
  oracleSource: types_1.OracleSource.PYTH_LAZER,
1080
1106
  pythFeedId: '0x2551eca7784671173def2c41e6f3e51e11cd87494863f1d208fdd8c64a1f85ae',
1081
1107
  pythLazerId: 171,
1108
+ marketStatus: types_1.MarketStatus.DELISTED,
1082
1109
  },
1083
1110
  {
1084
1111
  fullName: 'TRUMP',
@@ -1103,6 +1130,7 @@ exports.MainnetPerpMarkets = [
1103
1130
  oracleSource: types_1.OracleSource.PYTH_LAZER,
1104
1131
  pythFeedId: '0x8fef7d52c7f4e3a6258d663f9d27e64a1b6fd95ab5f7d545dbf9a515353d0064',
1105
1132
  pythLazerId: 145,
1133
+ marketStatus: types_1.MarketStatus.DELISTED,
1106
1134
  },
1107
1135
  {
1108
1136
  fullName: 'BERA',
@@ -1125,6 +1153,7 @@ exports.MainnetPerpMarkets = [
1125
1153
  oracle: new web3_js_1.PublicKey('HieNNSAy9tjtU2mLEcGtgCMViCeZ1881fX7tfezL7wdV'),
1126
1154
  launchTs: 1739463226000,
1127
1155
  oracleSource: types_1.OracleSource.Prelaunch,
1156
+ marketStatus: types_1.MarketStatus.DELISTED,
1128
1157
  },
1129
1158
  {
1130
1159
  fullName: 'NBAFINALS25-BOS',
@@ -1135,6 +1164,7 @@ exports.MainnetPerpMarkets = [
1135
1164
  oracle: new web3_js_1.PublicKey('HorrnsG8RBMv7dhzbgPX4wqcWbUTV5NwV8r59UwTu4CJ'),
1136
1165
  launchTs: 1739463226000,
1137
1166
  oracleSource: types_1.OracleSource.Prelaunch,
1167
+ marketStatus: types_1.MarketStatus.DELISTED,
1138
1168
  },
1139
1169
  {
1140
1170
  fullName: 'KAITO',
@@ -1202,6 +1232,7 @@ exports.MainnetPerpMarkets = [
1202
1232
  oracle: new web3_js_1.PublicKey('GAzR3C5cn7gGVvuqJB57wSYTPWP3n2Lw4mRJRxvTvqYy'),
1203
1233
  launchTs: 1747318237000,
1204
1234
  oracleSource: types_1.OracleSource.PYTH_LAZER,
1235
+ marketStatus: types_1.MarketStatus.DELISTED,
1205
1236
  },
1206
1237
  {
1207
1238
  fullName: 'PUMP',
@@ -3,6 +3,7 @@ import { PublicKey } from '@solana/web3.js';
3
3
  import { OracleSource } from '../types';
4
4
  import { BN } from '@coral-xyz/anchor';
5
5
  import { DriftEnv } from '../config';
6
+ import { MarketStatus } from '@ellipsis-labs/phoenix-sdk';
6
7
  export type SpotMarketConfig = {
7
8
  symbol: string;
8
9
  marketIndex: number;
@@ -18,6 +19,7 @@ export type SpotMarketConfig = {
18
19
  launchTs?: number;
19
20
  pythFeedId?: string;
20
21
  pythLazerId?: number;
22
+ marketStatus?: MarketStatus;
21
23
  };
22
24
  export declare const WRAPPED_SOL_MINT: PublicKey;
23
25
  export declare const DevnetSpotMarkets: SpotMarketConfig[];
@@ -4285,11 +4285,6 @@
4285
4285
  "isMut": true,
4286
4286
  "isSigner": false
4287
4287
  },
4288
- {
4289
- "name": "ammCache",
4290
- "isMut": true,
4291
- "isSigner": false
4292
- },
4293
4288
  {
4294
4289
  "name": "oracle",
4295
4290
  "isMut": false,
@@ -4454,7 +4449,7 @@
4454
4449
  "args": []
4455
4450
  },
4456
4451
  {
4457
- "name": "resizeAmmCache",
4452
+ "name": "addMarketToAmmCache",
4458
4453
  "accounts": [
4459
4454
  {
4460
4455
  "name": "admin",
@@ -4471,6 +4466,11 @@
4471
4466
  "isMut": true,
4472
4467
  "isSigner": false
4473
4468
  },
4469
+ {
4470
+ "name": "perpMarket",
4471
+ "isMut": false,
4472
+ "isSigner": false
4473
+ },
4474
4474
  {
4475
4475
  "name": "rent",
4476
4476
  "isMut": false,
@@ -4484,6 +4484,27 @@
4484
4484
  ],
4485
4485
  "args": []
4486
4486
  },
4487
+ {
4488
+ "name": "deleteAmmCache",
4489
+ "accounts": [
4490
+ {
4491
+ "name": "admin",
4492
+ "isMut": true,
4493
+ "isSigner": true
4494
+ },
4495
+ {
4496
+ "name": "state",
4497
+ "isMut": false,
4498
+ "isSigner": false
4499
+ },
4500
+ {
4501
+ "name": "ammCache",
4502
+ "isMut": true,
4503
+ "isSigner": false
4504
+ }
4505
+ ],
4506
+ "args": []
4507
+ },
4487
4508
  {
4488
4509
  "name": "updateInitialAmmCacheInfo",
4489
4510
  "accounts": [
@@ -8478,32 +8499,6 @@
8478
8499
  }
8479
8500
  ]
8480
8501
  },
8481
- {
8482
- "name": "resetAmmCache",
8483
- "accounts": [
8484
- {
8485
- "name": "admin",
8486
- "isMut": true,
8487
- "isSigner": true
8488
- },
8489
- {
8490
- "name": "state",
8491
- "isMut": false,
8492
- "isSigner": false
8493
- },
8494
- {
8495
- "name": "ammCache",
8496
- "isMut": true,
8497
- "isSigner": false
8498
- },
8499
- {
8500
- "name": "systemProgram",
8501
- "isMut": false,
8502
- "isSigner": false
8503
- }
8504
- ],
8505
- "args": []
8506
- },
8507
8502
  {
8508
8503
  "name": "lpPoolSwap",
8509
8504
  "accounts": [
@@ -12267,6 +12262,10 @@
12267
12262
  "name": "oracleSlot",
12268
12263
  "type": "u64"
12269
12264
  },
12265
+ {
12266
+ "name": "marketIndex",
12267
+ "type": "u16"
12268
+ },
12270
12269
  {
12271
12270
  "name": "oracleSource",
12272
12271
  "type": "u8"
@@ -12288,7 +12287,7 @@
12288
12287
  "type": {
12289
12288
  "array": [
12290
12289
  "u8",
12291
- 36
12290
+ 34
12292
12291
  ]
12293
12292
  }
12294
12293
  }
@@ -19777,6 +19776,11 @@
19777
19776
  "code": 6343,
19778
19777
  "name": "InvalidLpPoolId",
19779
19778
  "msg": "Invalid Lp Pool Id for Operation"
19779
+ },
19780
+ {
19781
+ "code": 6344,
19782
+ "name": "MarketIndexNotFoundAmmCache",
19783
+ "msg": "MarketIndexNotFoundAmmCache"
19780
19784
  }
19781
19785
  ]
19782
19786
  }
@@ -1854,6 +1854,7 @@ export type CacheInfo = {
1854
1854
  oracleValidity: number;
1855
1855
  lpStatusForPerpMarket: number;
1856
1856
  ammPositionScalar: number;
1857
+ marketIndex: number;
1857
1858
  };
1858
1859
  export type AmmCache = {
1859
1860
  cache: CacheInfo[];
@@ -22,11 +22,11 @@ export declare class AdminClient extends DriftClient {
22
22
  initializeOpenbookV2FulfillmentConfig(marketIndex: number, openbookMarket: PublicKey): Promise<TransactionSignature>;
23
23
  getInitializeOpenbookV2FulfillmentConfigIx(marketIndex: number, openbookMarket: PublicKey): Promise<TransactionInstruction>;
24
24
  initializePerpMarket(marketIndex: number, priceOracle: PublicKey, baseAssetReserve: BN, quoteAssetReserve: BN, periodicity: BN, pegMultiplier?: BN, oracleSource?: OracleSource, contractTier?: ContractTier, marginRatioInitial?: number, marginRatioMaintenance?: number, liquidatorFee?: number, ifLiquidatorFee?: number, imfFactor?: number, activeStatus?: boolean, baseSpread?: number, maxSpread?: number, maxOpenInterest?: BN, maxRevenueWithdrawPerPeriod?: BN, quoteMaxInsurance?: BN, orderStepSize?: BN, orderTickSize?: BN, minOrderSize?: BN, concentrationCoefScale?: BN, curveUpdateIntensity?: number, ammJitIntensity?: number, name?: string, lpPoolId?: number): Promise<TransactionSignature>;
25
- getInitializePerpMarketIx(marketIndex: number, priceOracle: PublicKey, baseAssetReserve: BN, quoteAssetReserve: BN, periodicity: BN, pegMultiplier?: BN, oracleSource?: OracleSource, contractTier?: ContractTier, marginRatioInitial?: number, marginRatioMaintenance?: number, liquidatorFee?: number, ifLiquidatorFee?: number, imfFactor?: number, activeStatus?: boolean, baseSpread?: number, maxSpread?: number, maxOpenInterest?: BN, maxRevenueWithdrawPerPeriod?: BN, quoteMaxInsurance?: BN, orderStepSize?: BN, orderTickSize?: BN, minOrderSize?: BN, concentrationCoefScale?: BN, curveUpdateIntensity?: number, ammJitIntensity?: number, name?: string, lpPoolId?: number, includeInitAmmCacheIx?: boolean): Promise<TransactionInstruction[]>;
25
+ getInitializePerpMarketIx(marketIndex: number, priceOracle: PublicKey, baseAssetReserve: BN, quoteAssetReserve: BN, periodicity: BN, pegMultiplier?: BN, oracleSource?: OracleSource, contractTier?: ContractTier, marginRatioInitial?: number, marginRatioMaintenance?: number, liquidatorFee?: number, ifLiquidatorFee?: number, imfFactor?: number, activeStatus?: boolean, baseSpread?: number, maxSpread?: number, maxOpenInterest?: BN, maxRevenueWithdrawPerPeriod?: BN, quoteMaxInsurance?: BN, orderStepSize?: BN, orderTickSize?: BN, minOrderSize?: BN, concentrationCoefScale?: BN, curveUpdateIntensity?: number, ammJitIntensity?: number, name?: string, lpPoolId?: number): Promise<TransactionInstruction[]>;
26
26
  initializeAmmCache(txParams?: TxParams): Promise<TransactionSignature>;
27
27
  getInitializeAmmCacheIx(): Promise<TransactionInstruction>;
28
- resizeAmmCache(txParams?: TxParams): Promise<TransactionSignature>;
29
- getResizeAmmCacheIx(): Promise<TransactionInstruction>;
28
+ addMarketToAmmCache(perpMarketIndex: number, txParams?: TxParams): Promise<TransactionSignature>;
29
+ getAddMarketToAmmCacheIx(perpMarketIndex: number): Promise<TransactionInstruction>;
30
30
  deleteAmmCache(txParams?: TxParams): Promise<TransactionSignature>;
31
31
  getDeleteAmmCacheIx(): Promise<TransactionInstruction>;
32
32
  updateInitialAmmCacheInfo(perpMarketIndexes: number[], txParams?: TxParams): Promise<TransactionSignature>;