@merkl/api 0.14.10 → 0.14.12

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.
@@ -47,6 +47,9 @@ export class UniswapProcessor extends GenericProcessor {
47
47
  if (priceToken0 !== 0 && priceToken1 !== 0) {
48
48
  tvl = priceToken0 * balanceToken0 + priceToken1 * balanceToken1;
49
49
  }
50
+ else if (campaign.campaignParameters.symbolRewardToken.toLowerCase().startsWith("if-")) {
51
+ tvl = (2 * balanceToken0 * balanceToken1) / (balanceToken0 + balanceToken1);
52
+ }
50
53
  const priceTargetToken = tvl / totalSupply;
51
54
  return {
52
55
  ...typeInfo,
@@ -1,5 +1,6 @@
1
1
  import { tokenType } from "../helpers/tokenType";
2
2
  import { AaveProcessor } from "./AaveProcessor";
3
+ import { AnglesLiquidProcessor } from "./AnglesLiquid";
3
4
  import { AssetProcessor } from "./AssetProcessor";
4
5
  import { AuraProcessor } from "./AuraProcessor";
5
6
  import { BalancerGaugeProcessor } from "./BalancerGaugeProcessor";
@@ -34,7 +35,6 @@ import { UniswapProcessor } from "./UniswapProcessor";
34
35
  import { VicunaProcessor } from "./VicunaProcessor";
35
36
  import { WoofiProcessor } from "./WoofiProcessor";
36
37
  import { ZkSwapThreePoolProcessor } from "./ZkSwapThreePoolProcessor";
37
- import { AnglesLiquidProcessor } from "./anglesLiquid";
38
38
  import { CurveNPoolProcessor } from "./curveNPoolProcessor";
39
39
  import { CurveProcessor } from "./curveProcessor";
40
40
  import { StakedCurveProcessor } from "./stakedCurveProcessor";
@@ -28,13 +28,21 @@ export class Pricer {
28
28
  this.extraPricesData = extraPricesData;
29
29
  }
30
30
  static async load() {
31
- const { prices, extraPricesData } = await Redis.get("Prices");
32
- const pricer = new Pricer(prices ?? {}, extraPricesData ?? []);
33
- if (!prices) {
34
- log.error("Pricer", "prices not found in cache when instanciating class");
31
+ try {
32
+ const { prices, extraPricesData } = await Redis.get("Prices");
33
+ const pricer = new Pricer(prices ?? {}, extraPricesData ?? []);
34
+ if (!prices) {
35
+ log.error("Pricer", "prices not found in cache when instanciating class");
36
+ await pricer.update();
37
+ }
38
+ return pricer;
39
+ }
40
+ catch (e) {
41
+ log.error("Pricer", "Failed to load prices from cache");
42
+ const pricer = new Pricer({}, []);
35
43
  await pricer.update();
44
+ return pricer;
36
45
  }
37
- return pricer;
38
46
  }
39
47
  getArray() {
40
48
  return Object.keys(this.prices)