impermax-sdk 2.1.158 → 2.1.159

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.
@@ -287,8 +287,12 @@ class UniswapV3Position {
287
287
  if (this.isLiquidatable())
288
288
  return currentLeverage;
289
289
  const highLeverage = 100; // we assume the position is liquidatable with this leverage
290
- const realX = this.getRealX();
291
- const realY = this.getRealY();
290
+ let realX = this.getRealX();
291
+ let realY = this.getRealY();
292
+ if (realX === 0 && realY === 0) {
293
+ realX = this.getRealXGivenLiquidity(1);
294
+ realY = this.getRealYGivenLiquidity(1);
295
+ }
292
296
  const projectedRealX = realX * highLeverage / currentLeverage;
293
297
  const projectedRealY = realY * highLeverage / currentLeverage;
294
298
  const projectedDebtX = this.debtX + projectedRealX - realX;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impermax-sdk",
3
- "version": "2.1.158",
3
+ "version": "2.1.159",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",