@drift-labs/sdk 2.74.0-beta.8 → 2.75.0-beta.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.
@@ -1673,7 +1673,9 @@ class DriftClient {
1673
1673
  const ix = await this.program.instruction.settleExpiredMarketPoolsToRevenuePool({
1674
1674
  accounts: {
1675
1675
  state: await this.getStatePublicKey(),
1676
- admin: this.wallet.publicKey,
1676
+ admin: this.isSubscribed
1677
+ ? this.getStateAccount().admin
1678
+ : this.wallet.publicKey,
1677
1679
  spotMarket: spotMarketPublicKey,
1678
1680
  perpMarket: perpMarketPublicKey,
1679
1681
  },
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.73.0",
2
+ "version": "2.74.0",
3
3
  "name": "drift",
4
4
  "instructions": [
5
5
  {
@@ -2651,10 +2651,40 @@
2651
2651
  "name": "liquidatorFee",
2652
2652
  "type": "u32"
2653
2653
  },
2654
+ {
2655
+ "name": "ifLiquidationFee",
2656
+ "type": "u32"
2657
+ },
2654
2658
  {
2655
2659
  "name": "activeStatus",
2656
2660
  "type": "bool"
2657
2661
  },
2662
+ {
2663
+ "name": "assetTier",
2664
+ "type": {
2665
+ "defined": "AssetTier"
2666
+ }
2667
+ },
2668
+ {
2669
+ "name": "scaleInitialAssetWeightStart",
2670
+ "type": "u64"
2671
+ },
2672
+ {
2673
+ "name": "withdrawGuardThreshold",
2674
+ "type": "u64"
2675
+ },
2676
+ {
2677
+ "name": "orderTickSize",
2678
+ "type": "u64"
2679
+ },
2680
+ {
2681
+ "name": "orderStepSize",
2682
+ "type": "u64"
2683
+ },
2684
+ {
2685
+ "name": "ifTotalFactor",
2686
+ "type": "u32"
2687
+ },
2658
2688
  {
2659
2689
  "name": "name",
2660
2690
  "type": {
@@ -2931,6 +2961,12 @@
2931
2961
  "defined": "OracleSource"
2932
2962
  }
2933
2963
  },
2964
+ {
2965
+ "name": "contractTier",
2966
+ "type": {
2967
+ "defined": "ContractTier"
2968
+ }
2969
+ },
2934
2970
  {
2935
2971
  "name": "marginRatioInitial",
2936
2972
  "type": "u32"
@@ -2943,10 +2979,62 @@
2943
2979
  "name": "liquidatorFee",
2944
2980
  "type": "u32"
2945
2981
  },
2982
+ {
2983
+ "name": "ifLiquidationFee",
2984
+ "type": "u32"
2985
+ },
2986
+ {
2987
+ "name": "imfFactor",
2988
+ "type": "u32"
2989
+ },
2946
2990
  {
2947
2991
  "name": "activeStatus",
2948
2992
  "type": "bool"
2949
2993
  },
2994
+ {
2995
+ "name": "baseSpread",
2996
+ "type": "u32"
2997
+ },
2998
+ {
2999
+ "name": "maxSpread",
3000
+ "type": "u32"
3001
+ },
3002
+ {
3003
+ "name": "maxOpenInterest",
3004
+ "type": "u128"
3005
+ },
3006
+ {
3007
+ "name": "maxRevenueWithdrawPerPeriod",
3008
+ "type": "u64"
3009
+ },
3010
+ {
3011
+ "name": "quoteMaxInsurance",
3012
+ "type": "u64"
3013
+ },
3014
+ {
3015
+ "name": "orderStepSize",
3016
+ "type": "u64"
3017
+ },
3018
+ {
3019
+ "name": "orderTickSize",
3020
+ "type": "u64"
3021
+ },
3022
+ {
3023
+ "name": "minOrderSize",
3024
+ "type": "u64"
3025
+ },
3026
+ {
3027
+ "name": "concentrationCoefScale",
3028
+ "type": "u128"
3029
+ },
3030
+ {
3031
+ "name": "curveUpdateIntensity",
3032
+ "type": "u8"
3033
+ },
3034
+ {
3035
+ "name": "ammJitIntensity",
3036
+ "type": "u8"
3037
+ },
2950
3038
  {
2951
3039
  "name": "name",
2952
3040
  "type": {
@@ -9119,6 +9207,9 @@
9119
9207
  {
9120
9208
  "name": "Speculative"
9121
9209
  },
9210
+ {
9211
+ "name": "HighlySpeculative"
9212
+ },
9122
9213
  {
9123
9214
  "name": "Isolated"
9124
9215
  }
@@ -148,12 +148,6 @@ function getMaxPriceDivergenceForFundingRate(market, oracleTwap) {
148
148
  else if ((0, types_1.isVariant)(market.contractTier, 'c')) {
149
149
  return oracleTwap.divn(20);
150
150
  }
151
- else if ((0, types_1.isVariant)(market.contractTier, 'speculative')) {
152
- return oracleTwap.divn(10);
153
- }
154
- else if ((0, types_1.isVariant)(market.contractTier, 'isolated')) {
155
- return oracleTwap.divn(10);
156
- }
157
151
  else {
158
152
  return oracleTwap.divn(10);
159
153
  }
@@ -28,7 +28,7 @@ function getMaxConfidenceIntervalMultiplier(market) {
28
28
  else if ((0, types_1.isVariant)(market.contractTier, 'speculative')) {
29
29
  maxConfidenceIntervalMultiplier = new index_1.BN(10);
30
30
  }
31
- else if ((0, types_1.isVariant)(market.contractTier, 'isolated')) {
31
+ else {
32
32
  maxConfidenceIntervalMultiplier = new index_1.BN(50);
33
33
  }
34
34
  return maxConfidenceIntervalMultiplier;
package/lib/math/tiers.js CHANGED
@@ -15,7 +15,7 @@ function getPerpMarketTierNumber(perpMarket) {
15
15
  else if ((0, types_1.isVariant)(perpMarket.contractTier, 'speculative')) {
16
16
  return 3;
17
17
  }
18
- else if ((0, types_1.isVariant)(perpMarket.contractTier, 'isolated')) {
18
+ else if ((0, types_1.isVariant)(perpMarket.contractTier, 'highlySpeculative')) {
19
19
  return 4;
20
20
  }
21
21
  else {
@@ -17,6 +17,7 @@ class PrelaunchOracleClient {
17
17
  slot: prelaunchOracle.ammLastUpdateSlot,
18
18
  confidence: prelaunchOracle.confidence,
19
19
  hasSufficientNumberOfDataPoints: true,
20
+ maxPrice: prelaunchOracle.maxPrice,
20
21
  };
21
22
  }
22
23
  }
@@ -10,6 +10,7 @@ export type OraclePriceData = {
10
10
  hasSufficientNumberOfDataPoints: boolean;
11
11
  twap?: BN;
12
12
  twapConfidence?: BN;
13
+ maxPrice?: BN;
13
14
  };
14
15
  export type OracleInfo = {
15
16
  publicKey: PublicKey;
package/lib/types.d.ts CHANGED
@@ -80,6 +80,9 @@ export declare class ContractTier {
80
80
  static readonly SPECULATIVE: {
81
81
  speculative: {};
82
82
  };
83
+ static readonly HIGHLY_SPECULATIVE: {
84
+ highlySpeculative: {};
85
+ };
83
86
  static readonly ISOLATED: {
84
87
  isolated: {};
85
88
  };
package/lib/types.js CHANGED
@@ -60,6 +60,7 @@ ContractTier.A = { a: {} };
60
60
  ContractTier.B = { b: {} };
61
61
  ContractTier.C = { c: {} };
62
62
  ContractTier.SPECULATIVE = { speculative: {} };
63
+ ContractTier.HIGHLY_SPECULATIVE = { highlySpeculative: {} };
63
64
  ContractTier.ISOLATED = { isolated: {} };
64
65
  class AssetTier {
65
66
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.74.0-beta.8",
3
+ "version": "2.75.0-beta.0",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "author": "crispheaney",