@merkl/api 0.13.12 → 0.13.14

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.
@@ -13,7 +13,35 @@ export class VicunaProcessor extends GenericProcessor {
13
13
  const vicunaTVL = (await axios("https://vicuna.orthae.xyz/tvl")).data;
14
14
  const parsedName = typeInfo.name.toLowerCase().split(" ");
15
15
  parsedName.shift();
16
- const parsedNameForAPI = parsedName.join("-");
16
+ let parsedNameForAPI = parsedName.join("-");
17
+ const mapping = {
18
+ "swapx-os-ws": "swapx-ichi-ws-os-ws",
19
+ "swapx-scusd-usdc": "swapx-ichi-usdc-scusd-usdc",
20
+ "swapx-sts-ws": "swapx-ichi-ws-sts-ws",
21
+ "swapx-sacra-ws": "swapx-ichi-ws-sacra-sacra",
22
+ "solidly-swapx-ws-eco": "swapx-ws-eco",
23
+ "solidly-swapx-ws-goglz": "swapx-ws-goglz",
24
+ "solidly-swapx-ws-hedgy": "swapx-ws-hedgy",
25
+ "solidly-swapx-ws-tysg": "swapx-ws-tysg",
26
+ "solidly-swapx-ws-sdog": "swapx-ws-sdog",
27
+ "solidly-swapx-ws-shiba": "swapx-ws-shiba",
28
+ "balancer-ws-sts": "beets-ws-sts",
29
+ "balancer-scusd-sts": "beets-usdc-scusd",
30
+ "swapx-ws-swpx": "swapx-ichi-ws-swapx-ws",
31
+ "swapx-ws-usdc": "swapx-ichi-ws-usdc-ws",
32
+ "swapx-ws-sceth": "swapx-ichi-ws-sceth-ws",
33
+ "swapx-ws-sts": "swapx-ichi-ws-sts-sts",
34
+ "swapx-ws-weth": "swapx-ichi-ws-weth-ws",
35
+ "swapx-ws-os": "swapx-ichi-ws-os-os",
36
+ "swapx-usdc-swpx": "swapx-ichi-usdc-swapx-usdc",
37
+ "swapx-usdc-weth": "swapx-ichi-usdc-weth-weth",
38
+ "swapx-usdc-scusd": "swapx-ichi-usdc-scusd-usdc",
39
+ "swapx-usdc-sts": "swapx-ichi-usdc-sts-usdc",
40
+ "swapx-weth-usdc": "swapx-ichi-usdc-weth-usdc",
41
+ };
42
+ if (!!mapping[parsedNameForAPI]) {
43
+ parsedNameForAPI = mapping[parsedNameForAPI];
44
+ }
17
45
  const tvl = vicunaTVL[campaign.computeChainId][parsedNameForAPI];
18
46
  const priceTargetToken = tvl / totalSupply;
19
47
  return {
@@ -19,7 +19,9 @@ function satisfiesNameConditions(name, type) {
19
19
  case tokenType.poolside:
20
20
  return lowerCaseName.includes("poolside");
21
21
  case tokenType.balancerGauge:
22
- return lowerCaseName.includes("balancer") && !lowerCaseName.includes("aura deposit vault");
22
+ return (lowerCaseName.includes("balancer") &&
23
+ !lowerCaseName.includes("aura deposit vault") &&
24
+ !lowerCaseName.startsWith("vifi"));
23
25
  case tokenType.gearbox:
24
26
  return lowerCaseName.includes("farming of") || lowerCaseName.startsWith("trade");
25
27
  case tokenType.euler_borrow:
@@ -51,7 +51,7 @@ export class AccountingService {
51
51
  const breakdown = {};
52
52
  let consolidatedAmount = 0;
53
53
  for (const chainId of Object.values(ChainId).filter(id => typeof id === "number")) {
54
- const monthlyData = await AccountingRepository.getForMultisigBetweenDates(startDate, endDate);
54
+ const monthlyData = await AccountingRepository.getForMultisigByChainBetweenDates(chainId, startDate, endDate);
55
55
  let totalAmount = 0;
56
56
  for (const tx of monthlyData) {
57
57
  totalAmount += Number(tx.amountIn);
@@ -6,7 +6,6 @@ import { OpportunityService } from "../opportunity";
6
6
  import { InvalidParameter } from "../../../utils/error";
7
7
  import { executeSimple } from "../../../utils/execute";
8
8
  import { log } from "../../../utils/logger";
9
- import { apiDbClient } from "../../../utils/prisma";
10
9
  import { NETWORK_LABELS, } from "@sdk";
11
10
  import { utils } from "ethers";
12
11
  import moment from "moment";
@@ -152,22 +151,11 @@ export class CampaignService {
152
151
  return await CampaignRepository.findUniqueOrThrow(id);
153
152
  }
154
153
  static async findCampaignsToProcess(distributionChainId) {
155
- await apiDbClient.campaignStatus.updateMany({
156
- data: {
157
- status: "SUCCESS",
158
- },
159
- where: {
160
- Campaign: {
161
- distributionChainId: 1,
162
- },
163
- status: "PROCESSING",
164
- },
165
- });
166
154
  return (await CampaignRepository.findCampaignsToProcess(distributionChainId)).filter(campaign => campaign.endTimestamp > campaign?.CampaignStatus?.[0]?.computedUntil);
167
155
  }
168
156
  static async findNextCampaignToProcess(chainId) {
169
157
  const campaigns = await CampaignService.findCampaignsToProcess(chainId);
170
- return { campaignId: campaigns[0].campaignId };
158
+ return { campaignId: campaigns?.[0]?.campaignId };
171
159
  }
172
160
  static async pickCampaignToProcess(chainId) {
173
161
  const campaigns = await CampaignService.findCampaignsToProcess(chainId);