@drift-labs/sdk 2.33.1-beta.7 → 2.33.1-beta.9

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.33.1-beta.7
1
+ 2.33.1-beta.9
@@ -6823,12 +6823,20 @@
6823
6823
  ],
6824
6824
  "type": "i32"
6825
6825
  },
6826
+ {
6827
+ "name": "padding1",
6828
+ "type": "u32"
6829
+ },
6830
+ {
6831
+ "name": "totalFeeEarnedPerLp",
6832
+ "type": "u64"
6833
+ },
6826
6834
  {
6827
6835
  "name": "padding",
6828
6836
  "type": {
6829
6837
  "array": [
6830
6838
  "u8",
6831
- 44
6839
+ 32
6832
6840
  ]
6833
6841
  }
6834
6842
  }
@@ -286,7 +286,7 @@ function calculateTokenUtilizationLimits(depositTokenAmount, borrowTokenAmount,
286
286
  // First, it determines a maximum withdrawal utilization from the market's target and historic utilization.
287
287
  // Then, it deduces corresponding deposit/borrow amounts.
288
288
  // Note: For deposit sizes below the guard threshold, withdrawals aren't blocked.
289
- const maxWithdrawUtilization = anchor_1.BN.max(spotMarket.optimalUtilization, spotMarket.utilizationTwap.add(numericConstants_1.SPOT_MARKET_UTILIZATION_PRECISION.sub(spotMarket.utilizationTwap).div(new anchor_1.BN(2))));
289
+ const maxWithdrawUtilization = anchor_1.BN.max(new anchor_1.BN(spotMarket.optimalUtilization), spotMarket.utilizationTwap.add(numericConstants_1.SPOT_MARKET_UTILIZATION_PRECISION.sub(spotMarket.utilizationTwap).div(new anchor_1.BN(2))));
290
290
  let minDepositTokensForUtilization = borrowTokenAmount
291
291
  .mul(numericConstants_1.SPOT_MARKET_UTILIZATION_PRECISION)
292
292
  .div(maxWithdrawUtilization);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.33.1-beta.7",
3
+ "version": "2.33.1-beta.9",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "author": "crispheaney",
@@ -6823,12 +6823,20 @@
6823
6823
  ],
6824
6824
  "type": "i32"
6825
6825
  },
6826
+ {
6827
+ "name": "padding1",
6828
+ "type": "u32"
6829
+ },
6830
+ {
6831
+ "name": "totalFeeEarnedPerLp",
6832
+ "type": "u64"
6833
+ },
6826
6834
  {
6827
6835
  "name": "padding",
6828
6836
  "type": {
6829
6837
  "array": [
6830
6838
  "u8",
6831
- 44
6839
+ 32
6832
6840
  ]
6833
6841
  }
6834
6842
  }
@@ -430,7 +430,7 @@ export function calculateTokenUtilizationLimits(
430
430
  // Note: For deposit sizes below the guard threshold, withdrawals aren't blocked.
431
431
 
432
432
  const maxWithdrawUtilization = BN.max(
433
- spotMarket.optimalUtilization,
433
+ new BN(spotMarket.optimalUtilization),
434
434
  spotMarket.utilizationTwap.add(
435
435
  SPOT_MARKET_UTILIZATION_PRECISION.sub(spotMarket.utilizationTwap).div(
436
436
  new BN(2)