impermax-sdk 2.1.207 → 2.1.208

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.
@@ -358,10 +358,11 @@ class UniswapV3Position {
358
358
  getMinLeverage() {
359
359
  const depositedX = this.getDepositedX();
360
360
  const depositedY = this.getDepositedY();
361
- if (depositedX >= this.debtX && depositedY >= this.debtY)
361
+ const ratioX = this.debtX === 0 ? Infinity : depositedX / this.debtX;
362
+ const ratioY = this.debtY === 0 ? Infinity : depositedY / this.debtY;
363
+ if (ratioX >= 1 && ratioY >= 1)
362
364
  return 0;
363
- // TODO binary search
364
- return 0;
365
+ return 1 - Math.min(ratioX, ratioY);
365
366
  }
366
367
  getMaxWithdrawable() {
367
368
  const depositedX = this.getDepositedX();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impermax-sdk",
3
- "version": "2.1.207",
3
+ "version": "2.1.208",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",