impermax-sdk 2.1.83 → 2.1.85

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.
@@ -72,7 +72,8 @@ class OnchainAccountNftlpUniswapV3 extends onchainAccountNftlp_1.default {
72
72
  }
73
73
  createNewPositionObject(fee, priceA, priceB, lockStateChange = false) {
74
74
  return __awaiter(this, void 0, void 0, function* () {
75
- return new uniswapV3Position_1.default(0, 0, 0, yield this.getNftlp().getMarketPrice(), yield this.getNftlp().getOraclePrice(), priceA, priceB, yield this.getLendingPool().getSafetyMargin(), yield this.getLendingPool().getLiquidationPenalty(), lockStateChange);
75
+ return new uniswapV3Position_1.default(1, // fake liquidity for math
76
+ 0, 0, yield this.getNftlp().getMarketPrice(), yield this.getNftlp().getOraclePrice(), priceA, priceB, yield this.getLendingPool().getSafetyMargin(), yield this.getLendingPool().getLiquidationPenalty(), lockStateChange);
76
77
  });
77
78
  }
78
79
  getPositionObject(tokenId) {
@@ -10,6 +10,7 @@ class UniswapV3Position {
10
10
  this.oraclePrice = _oraclePrice;
11
11
  this.priceA = _priceA;
12
12
  this.priceB = _priceB;
13
+ console.log("PRICES", _marketPrice, _oraclePrice, _priceA, _priceB);
13
14
  this.safetyMargin = _safetyMargin;
14
15
  this.liquidationPenalty = _liquidationPenalty;
15
16
  this.lockStateChange = _lockStateChange;
@@ -74,8 +75,8 @@ class UniswapV3Position {
74
75
  amountY = amountX / sampleX * sampleY;
75
76
  }
76
77
  }
77
- console.log("final", amountX, amountY);
78
78
  liquidity = this.getLiquidity(this.marketPrice, amountX, amountY);
79
+ console.log("final", amountX, amountY, liquidity);
79
80
  return { liquidity, amountX, amountY };
80
81
  }
81
82
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impermax-sdk",
3
- "version": "2.1.83",
3
+ "version": "2.1.85",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",