impermax-sdk 2.1.263 → 2.1.264

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.
@@ -23,7 +23,6 @@ export declare class UniswapV3Position extends GenericPosition {
23
23
  priceA: number;
24
24
  priceB: number;
25
25
  constructor(params: UniswapV3PositionParams);
26
- protected checkLock(): void;
27
26
  /**
28
27
  * protected SETTERS
29
28
  */
@@ -16,12 +16,6 @@ class UniswapV3Position extends genericPosition_1.default {
16
16
  this.priceA = params.priceA;
17
17
  this.priceB = params.priceB;
18
18
  }
19
- checkLock() {
20
- if (this.lockStateChange)
21
- throw Error("Can't change state of original position object");
22
- else
23
- this.state++;
24
- }
25
19
  /**
26
20
  * protected SETTERS
27
21
  */
@@ -43,13 +37,13 @@ class UniswapV3Position extends genericPosition_1.default {
43
37
  return liquidity * Math.sqrt(price);
44
38
  }
45
39
  getRealXGivenLiquidityAndPrice(liquidity, price) {
46
- const surplusX = this.getVirtualX(liquidity, this.priceA);
47
- const virtualX = this.getVirtualX(liquidity, Math.max(price, this.priceB));
40
+ const surplusX = this.getVirtualX(liquidity, this.priceB);
41
+ const virtualX = this.getVirtualX(liquidity, Math.max(price, this.priceA));
48
42
  return Math.max(virtualX - surplusX, 0);
49
43
  }
50
44
  getRealYGivenLiquidityAndPrice(liquidity, price) {
51
45
  const surplusY = this.getVirtualY(liquidity, this.priceA);
52
- const virtualY = this.getVirtualY(liquidity, Math.min(price, this.priceA));
46
+ const virtualY = this.getVirtualY(liquidity, Math.min(price, this.priceB));
53
47
  return Math.max(virtualY - surplusY, 0);
54
48
  }
55
49
  getInitialCollateralValue() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impermax-sdk",
3
- "version": "2.1.263",
3
+ "version": "2.1.264",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",