@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 CHANGED
@@ -1 +1 @@
1
- 2.100.0-beta.15
1
+ 2.100.0-beta.16
@@ -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.ONE)) {
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.ONE)) {
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.100.0-beta.15",
3
+ "version": "2.100.0-beta.16",
4
4
  "main": "lib/node/index.js",
5
5
  "types": "lib/node/index.d.ts",
6
6
  "browser": "./lib/browser/index.js",
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(ONE)) {
2961
+ if (freeCollateral.lt(PRICE_PRECISION.divn(100))) {
2962
2962
  if (outSaferThanIn && inTokenAmount.gt(ZERO)) {
2963
2963
  inSwap = inTokenAmount;
2964
2964
  outSwap = calculateSwap(inSwap);