impermax-sdk 2.1.283 → 2.1.287

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.
@@ -14,7 +14,6 @@ export default abstract class OffchainNftlp {
14
14
  getLendingPool: () => import("../offchainLendingPoolV3").default;
15
15
  getNftlpAddress: () => string;
16
16
  protected abstract initializeMarketPrice(): Promise<number>;
17
- protected abstract initializeOraclePrice(): Promise<number>;
18
17
  abstract getTotalAPR(): Promise<number>;
19
18
  getNftlp(): void;
20
19
  getMarketPrice(): Promise<number>;
@@ -16,9 +16,9 @@ class OffchainNftlp {
16
16
  return this.cache.marketPrice;
17
17
  }
18
18
  async getOraclePrice() {
19
- if (!this.cache.oraclePrice)
20
- this.cache.oraclePrice = this.initializeOraclePrice();
21
- return this.cache.oraclePrice;
19
+ return this.getMarketPrice();
20
+ //if (!this.cache.oraclePrice) this.cache.oraclePrice = this.initializeOraclePrice();
21
+ //return this.cache.oraclePrice;
22
22
  }
23
23
  cleanCache() {
24
24
  this.cache = {};
@@ -18,7 +18,6 @@ export default class OffchainNftlpUniswapV3 extends OffchainNftlp {
18
18
  private priceAdjustment;
19
19
  tickToPrice(tick: number): Promise<number>;
20
20
  protected initializeMarketPrice(): Promise<number>;
21
- protected initializeOraclePrice(): Promise<number>;
22
21
  protected initializeUniswapV3Pool(fee: number): Promise<{
23
22
  address?: Address;
24
23
  liquidity: number;
@@ -37,11 +37,13 @@ class OffchainNftlpUniswapV3 extends offchainNftlp_1.default {
37
37
  ]);
38
38
  return priceA / priceB;
39
39
  }
40
- async initializeOraclePrice() {
41
- const lendingPoolData = await this.getLendingPool().getLendingPoolData();
42
- const priceAdjustment = await this.priceAdjustment();
43
- return (0, uniswapV3General_1.formatPriceSqrtX96)(lendingPoolData.nftlp.oraclePriceSqrtX96, priceAdjustment);
40
+ /*
41
+ protected async initializeOraclePrice(): Promise<number> {
42
+ const lendingPoolData = await this.getLendingPool().getLendingPoolData() as any;
43
+ const priceAdjustment = await this.priceAdjustment();
44
+ return formatPriceSqrtX96(lendingPoolData.nftlp.oraclePriceSqrtX96, priceAdjustment);
44
45
  }
46
+ */
45
47
  // get basic UniswapV3Pool info given a fee
46
48
  // used for calculating the apr
47
49
  async initializeUniswapV3Pool(fee) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impermax-sdk",
3
- "version": "2.1.283",
3
+ "version": "2.1.287",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",