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
|
-
|
|
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
|
-
|
|
364
|
-
return 0;
|
|
365
|
+
return 1 - Math.min(ratioX, ratioY);
|
|
365
366
|
}
|
|
366
367
|
getMaxWithdrawable() {
|
|
367
368
|
const depositedX = this.getDepositedX();
|