impermax-sdk 2.1.295 → 2.1.297

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.
@@ -40,7 +40,9 @@ exports.IMPERMAX_VAULT_API = {
40
40
  [types_1.Networks.Polygon]: {
41
41
  [types_1.VaultType.LENDING]: "https://polygon-lendingvaults-production.up.railway.app/"
42
42
  },
43
- [types_1.Networks.Arbitrum]: {},
43
+ [types_1.Networks.Arbitrum]: {
44
+ [types_1.VaultType.LENDING]: "https://arbitrum-lendingvaults-production.up.railway.app/"
45
+ },
44
46
  [types_1.Networks.Avalanche]: {},
45
47
  [types_1.Networks.Moonriver]: {},
46
48
  [types_1.Networks.Aurora]: {},
@@ -165,6 +165,7 @@ exports.VAULT_SUBGRAPH_URL = {
165
165
  [types_1.Networks.Arbitrum]: {
166
166
  [types_1.VaultType.LENDING]: [
167
167
  "https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/BhmcL1CZmw9hftXPviiTeMY7kghbbkpHZtpiHXWVhNNN",
168
+ "https://arbitrum-lendingvaults-production.up.railway.app/"
168
169
  ],
169
170
  [types_1.VaultType.HEDGED]: [],
170
171
  [types_1.VaultType.LEVERAGED]: [],
@@ -54,12 +54,14 @@ class OnchainAccountNftlpUniswapV3 extends onchainAccountNftlp_1.default {
54
54
  nftlp.methods.reinvest(tokenId, REINVESTOR),
55
55
  nftlp.methods.positions(tokenId)
56
56
  ]);
57
+ console.log("getCurrentFeeGrowthInsideX128", position);
57
58
  return {
58
59
  currentFeeGrowthInside0X128: parseInt(position[4]),
59
60
  currentFeeGrowthInside1X128: parseInt(position[5]),
60
61
  };
61
62
  }
62
63
  catch (e) {
64
+ console.warn("getCurrentFeeGrowthInsideX128", e);
63
65
  // nothing to reinvest
64
66
  const positionData = await this.getPositionData(tokenId);
65
67
  return {
@@ -73,6 +75,13 @@ class OnchainAccountNftlpUniswapV3 extends onchainAccountNftlp_1.default {
73
75
  const positionData = await this.getPositionData(tokenId);
74
76
  const delta0 = currentFeeGrowthInside0X128 - parseInt(positionData.feeGrowthInside0LastX128);
75
77
  const delta1 = currentFeeGrowthInside1X128 - parseInt(positionData.feeGrowthInside1LastX128);
78
+ console.log("positionData", positionData);
79
+ console.log("currentFeeGrowthInside0X128", currentFeeGrowthInside0X128);
80
+ console.log("currentFeeGrowthInside1X128", currentFeeGrowthInside1X128);
81
+ console.log("delta0", delta0);
82
+ console.log("delta1", delta1);
83
+ console.log("unclaimedFees0", parseInt(positionData.unclaimedFees0) + delta0 * parseInt(positionData.liquidity) / Q128, parseInt(positionData.unclaimedFees0), delta0 * parseInt(positionData.liquidity) / Q128);
84
+ console.log("unclaimedFees1", parseInt(positionData.unclaimedFees1) + delta1 * parseInt(positionData.liquidity) / Q128, parseInt(positionData.unclaimedFees1), delta1 * parseInt(positionData.liquidity) / Q128);
76
85
  return {
77
86
  unclaimedFees0: parseInt(positionData.unclaimedFees0) + delta0 * parseInt(positionData.liquidity) / Q128,
78
87
  unclaimedFees1: parseInt(positionData.unclaimedFees1) + delta1 * parseInt(positionData.liquidity) / Q128,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impermax-sdk",
3
- "version": "2.1.295",
3
+ "version": "2.1.297",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",