impermax-sdk 2.1.154 → 2.1.155

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.
@@ -237,12 +237,13 @@ class UniswapV3Position {
237
237
  const priceA = this.getLiquidationPriceInRange(LOWEST_PRICE, this.marketPrice, lowIsLiquidatable, isLiquidatable);
238
238
  const priceB = this.getLiquidationPriceInRange(this.marketPrice, HIGHEST_PRICE, isLiquidatable, highIsLiquidatable);
239
239
  return {
240
- priceA: priceA ? priceA : 0,
241
- priceB: priceB ? priceB : Infinity,
240
+ priceA: priceA && priceA > LOWEST_PRICE ? priceA : 0,
241
+ priceB: priceB && priceB < HIGHEST_PRICE ? priceB : Infinity,
242
242
  };
243
243
  }
244
244
  getLeverage() {
245
- return this.getCollateralValue() / this.getEquityValue();
245
+ const leverage = this.getCollateralValue() / this.getEquityValue();
246
+ return leverage ?? 1;
246
247
  }
247
248
  // amountX and amountY are expected to have the same sign
248
249
  getOptimalLiquidity(amountX, amountY) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impermax-sdk",
3
- "version": "2.1.154",
3
+ "version": "2.1.155",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",