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
|
-
|
|
291
|
-
|
|
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;
|