@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 +1 -1
- package/lib/math/spotBalance.js +1 -1
- package/package.json +1 -1
- package/src/math/spotBalance.ts +1 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.33.1-beta.
|
|
1
|
+
2.33.1-beta.8
|
package/lib/math/spotBalance.js
CHANGED
|
@@ -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
package/src/math/spotBalance.ts
CHANGED
|
@@ -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)
|