@drift-labs/sdk 2.38.1-beta.10 → 2.38.1-beta.11
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/lib/user.js +1 -1
- package/package.json +1 -1
- package/src/math/spotBalance.ts +1 -1
- package/src/user.ts +1 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.38.1-beta.
|
|
1
|
+
2.38.1-beta.11
|
package/lib/math/spotBalance.js
CHANGED
|
@@ -167,7 +167,7 @@ function calculateLiabilityWeight(size, spotMarket, marginCategory) {
|
|
|
167
167
|
liabilityWeight = (0, margin_1.calculateSizePremiumLiabilityWeight)(sizeInAmmReservePrecision, new anchor_1.BN(spotMarket.imfFactor), new anchor_1.BN(spotMarket.maintenanceLiabilityWeight), numericConstants_1.SPOT_MARKET_WEIGHT_PRECISION);
|
|
168
168
|
break;
|
|
169
169
|
default:
|
|
170
|
-
liabilityWeight = spotMarket.initialLiabilityWeight;
|
|
170
|
+
liabilityWeight = new anchor_1.BN(spotMarket.initialLiabilityWeight);
|
|
171
171
|
break;
|
|
172
172
|
}
|
|
173
173
|
return liabilityWeight;
|
package/lib/user.js
CHANGED
|
@@ -577,7 +577,7 @@ class User {
|
|
|
577
577
|
continue;
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
|
-
const { tokenAmount: worstCaseTokenAmount, ordersValue: worstCaseQuoteTokenAmount, } = (0, spotPosition_1.getWorstCaseTokenAmounts)(spotPosition, spotMarketAccount, strictOraclePrice, marginCategory);
|
|
580
|
+
const { tokenAmount: worstCaseTokenAmount, ordersValue: worstCaseQuoteTokenAmount, } = (0, spotPosition_1.getWorstCaseTokenAmounts)(spotPosition, spotMarketAccount, strictOraclePrice, marginCategory !== null && marginCategory !== void 0 ? marginCategory : 'Initial');
|
|
581
581
|
if (worstCaseTokenAmount.gt(numericConstants_1.ZERO) && countForBase) {
|
|
582
582
|
const baseAssetValue = this.getSpotAssetValue(worstCaseTokenAmount, strictOraclePrice, spotMarketAccount, marginCategory);
|
|
583
583
|
totalAssetValue = totalAssetValue.add(baseAssetValue);
|
package/package.json
CHANGED
package/src/math/spotBalance.ts
CHANGED