@merkl/api 0.20.16 → 0.20.17

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.
@@ -39,8 +39,9 @@ async function computeEventBasedPoolTVLFromMostRecentStateSave(chainId, campaign
39
39
  // Bucket service
40
40
  let tvl = 0;
41
41
  try {
42
- console.log("BUCKET NAME:", bucketName);
43
- const bucket = new BucketService(bucketName, "merkl-production");
42
+ if (bucketName === undefined)
43
+ console.log("EVENT_BASED:", states);
44
+ const bucket = new BucketService("merkl-production-states", "merkl-production");
44
45
  const storedStates = JSON.parse(await bucket.pull(fileName));
45
46
  for (const [_, { value, params: _params }] of Object.entries(storedStates)) {
46
47
  tvl += BN2Number(value.allTimeValue, 18 - decimalsCurrency);
@@ -43,8 +43,9 @@ async function computeUniV4PoolTVLFromMostRecentStateSave(chainId, poolID, price
43
43
  let amount0 = 0;
44
44
  let amount1 = 0;
45
45
  try {
46
- console.log("BUCKET NAME:", bucketName);
47
- const bucket = new BucketService(bucketName, "merkl-production");
46
+ if (bucketName === undefined)
47
+ console.log("UNIV4", states);
48
+ const bucket = new BucketService("merkl-production-states", "merkl-production");
48
49
  const storedStates = JSON.parse(await bucket.pull(fileName));
49
50
  for (const [_, { value, params: _params }] of Object.entries(storedStates)) {
50
51
  amount0 += BN2Number(value.amount0, decimalsCurrency0);
@@ -33,7 +33,8 @@ export class MorphoMetadata {
33
33
  }
34
34
  case MorphoSubCampaignType.BORROWING_BLUE:
35
35
  case MorphoSubCampaignType.COLLATERAL_BLUE: {
36
- return `https://www.compound.blue/borrow/${params.targetToken.toLowerCase()}`;
36
+ const typedParams = params;
37
+ return `https://www.compound.blue/borrow/${typedParams.marketId.toLowerCase()}`;
37
38
  }
38
39
  }
39
40
  }