impermax-sdk 2.1.499 → 2.1.501

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.
@@ -156,12 +156,12 @@ exports.WHITELISTED_PAIRS = {
156
156
  "0x68ef893edccbb6b700bcc391c219ab90efb55477",
157
157
  "0x059c888d457a10de6921a0853e1a62ec58b447ad",
158
158
  "0x49B3f8b07e645D7c31F41DE3296E9905aA93BE6C",
159
- "0xA6D43A98D14A9C69E493c8D063e55D10c0cEFc7A", // cbBTC/USDC aerov3
160
- //"0x3aA4ee02bf3A5110f3A743051cFfDDa643eb44cb", // cbBTC/LBTC aerov3
161
- //"0xF8a8abd26662E8dd51780fCA6579Fc721B612bC8", // ETH/cbETH aerov3
162
- //"0xf106Da7C51D6C099375fCA190c15e583bFDf1f34", // tBTC/cbBTC aerov3
163
- //"0x02f59114f9Fb1eA5Ebd6356db449b78cF4e5bb8e", // WETH/AAVE aerov3
164
- //"0xF1E72aAB3Fa3A5C166825cCAfbf814D43d7b91b2", // EURC/USDC aerov3
159
+ "0xA6D43A98D14A9C69E493c8D063e55D10c0cEFc7A",
160
+ "0x3aA4ee02bf3A5110f3A743051cFfDDa643eb44cb",
161
+ "0xF8a8abd26662E8dd51780fCA6579Fc721B612bC8",
162
+ "0xf106Da7C51D6C099375fCA190c15e583bFDf1f34",
163
+ "0x02f59114f9Fb1eA5Ebd6356db449b78cF4e5bb8e",
164
+ "0xF1E72aAB3Fa3A5C166825cCAfbf814D43d7b91b2", // EURC/USDC aerov3
165
165
  //"0x96190B4E62D28486B998c77550dd0cf3A60fdEF5", // USDC/AERO aerov3
166
166
  //"0x0bA15e5fC7e73Be48cB0fb110eC5E8215150085c", // WETH/AERO aerov3
167
167
  ],
@@ -50,7 +50,9 @@ class OffchainAccountNftlpAeroCL extends offchainAccountNftlpGenericCL_1.default
50
50
  }
51
51
  async getTotalRewardEarned(tokenId) {
52
52
  const storedTotalRewardEarned = await this.getStoredTotalRewardEarned(tokenId);
53
- const newlyEarnedReward = await this.getNewlyEarnedReward(tokenId);
53
+ // NOTE: Temporary fix
54
+ //const newlyEarnedReward = await this.getNewlyEarnedReward(tokenId);
55
+ const newlyEarnedReward = await this.getUnclaimedReward(tokenId);
54
56
  return storedTotalRewardEarned + newlyEarnedReward;
55
57
  }
56
58
  }
@@ -53,7 +53,9 @@ class OffchainAccountNftlpUniswapV3 extends offchainAccountNftlpGenericCL_1.defa
53
53
  }
54
54
  async getTotalFeesEarned(tokenId) {
55
55
  const storedTotalFeesEarned = await this.getStoredTotalFeesEarned(tokenId);
56
- const newlyEarnedFees = await this.getNewlyEarnedFees(tokenId);
56
+ // NOTE: Temporary fix
57
+ //const newlyEarnedFees = await this.getNewlyEarnedFees(tokenId);
58
+ const newlyEarnedFees = await this.getUnclaimedFees(tokenId);
57
59
  return {
58
60
  amountX: storedTotalFeesEarned.amountX + newlyEarnedFees.amountX,
59
61
  amountY: storedTotalFeesEarned.amountY + newlyEarnedFees.amountY,
@@ -174,7 +174,10 @@ class OffchainLendingPool {
174
174
  ]);
175
175
  const symbol0 = this.normalizeTokenSymbol(token0);
176
176
  const symbol1 = this.normalizeTokenSymbol(token1);
177
- return stables.includes(symbol0) && stables.includes(symbol1);
177
+ // WARN: Quick temporary fix for LSTS, Check if both are stablecoins OR if last 3 characters match
178
+ // Better way is to hardcode pairs or something but this should be good for now
179
+ return (stables.includes(symbol0) && stables.includes(symbol1)) ||
180
+ (symbol0.slice(-3) === symbol1.slice(-3));
178
181
  }
179
182
  // Versions Specfics
180
183
  getLendingPoolVersion() {
@@ -25,6 +25,7 @@ export default class OffchainAPRHelper {
25
25
  private totalSuppliedInitialized;
26
26
  private stablecoins;
27
27
  private stablecoinsInitialized;
28
+ private readonly blacklistedStables;
28
29
  private etherexAllPools;
29
30
  private etherexInitialized;
30
31
  private readonly blacklistedProjects;
@@ -59,6 +60,7 @@ export default class OffchainAPRHelper {
59
60
  totalCollateralUSD: number;
60
61
  }>;
61
62
  getImpermaxTvlChart(network?: Networks): Promise<LlamaTvlChart>;
63
+ private isStableBlacklisted;
62
64
  private initializeStablecoins;
63
65
  getAllStablecoins(): Promise<string[]>;
64
66
  }
@@ -47,6 +47,10 @@ class OffchainAPRHelper {
47
47
  // Misc.
48
48
  this.stablecoins = [];
49
49
  this.stablecoinsInitialized = null;
50
+ // Use the geckoId as its unique
51
+ this.blacklistedStables = new Set([
52
+ "algostable"
53
+ ]);
50
54
  this.etherexAllPools = {};
51
55
  this.etherexInitialized = null;
52
56
  this.blacklistedProjects = new Set([
@@ -319,10 +323,15 @@ class OffchainAPRHelper {
319
323
  /*--------------------------------------------------------*
320
324
  * Misc.
321
325
  *--------------------------------------------------------*/
326
+ // Blacklist certain tokens from defillama's endpoint,
327
+ // for example STBL live on Algorand, messing wtih STBL on Sonic
328
+ isStableBlacklisted(geckoId) {
329
+ return this.blacklistedStables.has(geckoId);
330
+ }
322
331
  async initializeStablecoins() {
323
332
  try {
324
333
  const response = await fetch("https://stablecoins.llama.fi/stablecoins").then((i) => i.json());
325
- this.stablecoins = response.peggedAssets.map((i) => i.symbol);
334
+ this.stablecoins = response.peggedAssets.filter((i) => !this.isStableBlacklisted(i.gecko_id)).map((i) => i.symbol);
326
335
  }
327
336
  catch (err) {
328
337
  console.log("Error getting stablecoins data: ", err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impermax-sdk",
3
- "version": "2.1.499",
3
+ "version": "2.1.501",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",