@drift-labs/sdk 2.100.0-beta.15 → 2.100.0-beta.16
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/browser/user.js +1 -1
- package/lib/node/user.js +1 -1
- package/package.json +1 -1
- package/src/user.ts +1 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.100.0-beta.
|
|
1
|
+
2.100.0-beta.16
|
package/lib/browser/user.js
CHANGED
|
@@ -1563,7 +1563,7 @@ class User {
|
|
|
1563
1563
|
(inTokenAmount.gt(numericConstants_1.ZERO) && outTokenAmount.lt(numericConstants_1.ZERO)) ||
|
|
1564
1564
|
// buying asset with higher initial asset weight
|
|
1565
1565
|
inMarket.initialAssetWeight < outMarket.initialAssetWeight;
|
|
1566
|
-
if (freeCollateral.lt(numericConstants_1.
|
|
1566
|
+
if (freeCollateral.lt(numericConstants_1.PRICE_PRECISION.divn(100))) {
|
|
1567
1567
|
if (outSaferThanIn && inTokenAmount.gt(numericConstants_1.ZERO)) {
|
|
1568
1568
|
inSwap = inTokenAmount;
|
|
1569
1569
|
outSwap = calculateSwap(inSwap);
|
package/lib/node/user.js
CHANGED
|
@@ -1563,7 +1563,7 @@ class User {
|
|
|
1563
1563
|
(inTokenAmount.gt(numericConstants_1.ZERO) && outTokenAmount.lt(numericConstants_1.ZERO)) ||
|
|
1564
1564
|
// buying asset with higher initial asset weight
|
|
1565
1565
|
inMarket.initialAssetWeight < outMarket.initialAssetWeight;
|
|
1566
|
-
if (freeCollateral.lt(numericConstants_1.
|
|
1566
|
+
if (freeCollateral.lt(numericConstants_1.PRICE_PRECISION.divn(100))) {
|
|
1567
1567
|
if (outSaferThanIn && inTokenAmount.gt(numericConstants_1.ZERO)) {
|
|
1568
1568
|
inSwap = inTokenAmount;
|
|
1569
1569
|
outSwap = calculateSwap(inSwap);
|
package/package.json
CHANGED
package/src/user.ts
CHANGED
|
@@ -2958,7 +2958,7 @@ export class User {
|
|
|
2958
2958
|
// buying asset with higher initial asset weight
|
|
2959
2959
|
inMarket.initialAssetWeight < outMarket.initialAssetWeight;
|
|
2960
2960
|
|
|
2961
|
-
if (freeCollateral.lt(
|
|
2961
|
+
if (freeCollateral.lt(PRICE_PRECISION.divn(100))) {
|
|
2962
2962
|
if (outSaferThanIn && inTokenAmount.gt(ZERO)) {
|
|
2963
2963
|
inSwap = inTokenAmount;
|
|
2964
2964
|
outSwap = calculateSwap(inSwap);
|