@drift-labs/sdk 2.42.0-beta.14 → 2.42.0-beta.15
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/user.js +2 -2
- package/package.json +1 -1
- package/src/user.ts +2 -2
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.42.0-beta.
|
|
1
|
+
2.42.0-beta.15
|
package/lib/user.js
CHANGED
|
@@ -1335,7 +1335,7 @@ class User {
|
|
|
1335
1335
|
const outContributionInitial = this.calculateSpotPositionFreeCollateralContribution(outSpotPosition, outStrictOraclePrice);
|
|
1336
1336
|
const { totalAssetValue: outTotalAssetValueInitial, totalLiabilityValue: outTotalLiabilityValueInitial, } = this.calculateSpotPositionLeverageContribution(outSpotPosition, outStrictOraclePrice);
|
|
1337
1337
|
const initialContribution = inContributionInitial.add(outContributionInitial);
|
|
1338
|
-
const { perpLiabilityValue, perpPnl, spotAssetValue, spotLiabilityValue } = this.getLeverageComponents(
|
|
1338
|
+
const { perpLiabilityValue, perpPnl, spotAssetValue, spotLiabilityValue } = this.getLeverageComponents();
|
|
1339
1339
|
if (!calculateSwap) {
|
|
1340
1340
|
calculateSwap = (inSwap) => {
|
|
1341
1341
|
return inSwap
|
|
@@ -1490,7 +1490,7 @@ class User {
|
|
|
1490
1490
|
this.getEmptySpotPosition(outMarketIndex);
|
|
1491
1491
|
const { totalAssetValue: inTotalAssetValueInitial, totalLiabilityValue: inTotalLiabilityValueInitial, } = this.calculateSpotPositionLeverageContribution(inSpotPosition, inStrictOraclePrice);
|
|
1492
1492
|
const { totalAssetValue: outTotalAssetValueInitial, totalLiabilityValue: outTotalLiabilityValueInitial, } = this.calculateSpotPositionLeverageContribution(outSpotPosition, outStrictOraclePrice);
|
|
1493
|
-
const { perpLiabilityValue, perpPnl, spotAssetValue, spotLiabilityValue } = this.getLeverageComponents(
|
|
1493
|
+
const { perpLiabilityValue, perpPnl, spotAssetValue, spotLiabilityValue } = this.getLeverageComponents();
|
|
1494
1494
|
const inPositionAfter = this.cloneAndUpdateSpotPosition(inSpotPosition, inAmount.abs().neg(), inMarket);
|
|
1495
1495
|
const outPositionAfter = this.cloneAndUpdateSpotPosition(outSpotPosition, outAmount.abs(), outMarket);
|
|
1496
1496
|
const { totalAssetValue: inTotalAssetValueAfter, totalLiabilityValue: inTotalLiabilityValueAfter, } = this.calculateSpotPositionLeverageContribution(inPositionAfter, inStrictOraclePrice);
|
package/package.json
CHANGED
package/src/user.ts
CHANGED
|
@@ -2412,7 +2412,7 @@ export class User {
|
|
|
2412
2412
|
);
|
|
2413
2413
|
|
|
2414
2414
|
const { perpLiabilityValue, perpPnl, spotAssetValue, spotLiabilityValue } =
|
|
2415
|
-
this.getLeverageComponents(
|
|
2415
|
+
this.getLeverageComponents();
|
|
2416
2416
|
|
|
2417
2417
|
if (!calculateSwap) {
|
|
2418
2418
|
calculateSwap = (inSwap: BN) => {
|
|
@@ -2708,7 +2708,7 @@ export class User {
|
|
|
2708
2708
|
);
|
|
2709
2709
|
|
|
2710
2710
|
const { perpLiabilityValue, perpPnl, spotAssetValue, spotLiabilityValue } =
|
|
2711
|
-
this.getLeverageComponents(
|
|
2711
|
+
this.getLeverageComponents();
|
|
2712
2712
|
|
|
2713
2713
|
const inPositionAfter = this.cloneAndUpdateSpotPosition(
|
|
2714
2714
|
inSpotPosition,
|