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

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.8
@@ -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.8",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "author": "crispheaney",
@@ -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)