@merkl/api 0.10.327 → 0.10.329

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.
@@ -63,7 +63,8 @@ export declare enum tokenType {
63
63
  cpmmGamma = "cpmmGamma",
64
64
  crosscurve = "crosscurve",
65
65
  venus = "venus",
66
- reactor_fusion = "reactor_fusion"
66
+ reactor_fusion = "reactor_fusion",
67
+ vicuna = "vicuna"
67
68
  }
68
69
  export declare const tokenTypeToProtocol: {
69
70
  [key in tokenType]: {
@@ -65,6 +65,7 @@ export var tokenType;
65
65
  tokenType["crosscurve"] = "crosscurve";
66
66
  tokenType["venus"] = "venus";
67
67
  tokenType["reactor_fusion"] = "reactor_fusion";
68
+ tokenType["vicuna"] = "vicuna";
68
69
  })(tokenType || (tokenType = {}));
69
70
  export const tokenTypeToProtocol = {
70
71
  [tokenType.aave_borrowing]: { protocol: "Aave" },
@@ -159,4 +160,5 @@ export const tokenTypeToProtocol = {
159
160
  [tokenType.crosscurve]: {
160
161
  protocol: "CrossCurve",
161
162
  },
163
+ [tokenType.vicuna]: { protocol: "Vicuna" },
162
164
  };
@@ -0,0 +1,28 @@
1
+ import type { Pricer } from "../../../../../utils/pricer";
2
+ import type { Campaign, CampaignParameters } from "@sdk";
3
+ import type { tokenType } from "../helpers/tokenType";
4
+ import { GenericProcessor, type dataType, type mandatoryCallKeys } from "./GenericProcessor";
5
+ type callType = {
6
+ key: keyof dataRawVicuna;
7
+ call: string;
8
+ target: keyof callKeysVicuna;
9
+ metaData?: any;
10
+ };
11
+ type callKeysVicuna = mandatoryCallKeys & {
12
+ tokenPrice: string;
13
+ name: string;
14
+ };
15
+ type dataRawVicuna = callKeysVicuna & {};
16
+ type dataTypeVicuna = dataType & {
17
+ tokenPrice: string;
18
+ };
19
+ export declare class VicunaProcessor extends GenericProcessor<callKeysVicuna, dataRawVicuna, dataTypeVicuna> {
20
+ rounds: {
21
+ round1: callType[];
22
+ round2: callType[];
23
+ round3: callType[];
24
+ round4: callType[];
25
+ };
26
+ processingRound5(_index: number, type: tokenType, typeInfo: dataRawVicuna, _calls: string[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.EULER>, _pricer: Pricer): Promise<dataTypeVicuna>;
27
+ }
28
+ export {};
@@ -0,0 +1,29 @@
1
+ import { generateCardName } from "../../../../../utils/generateCardName";
2
+ import axios from "axios";
3
+ import { GenericProcessor } from "./GenericProcessor";
4
+ export class VicunaProcessor extends GenericProcessor {
5
+ rounds = {
6
+ round1: [],
7
+ round2: [],
8
+ round3: [],
9
+ round4: [{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" }],
10
+ };
11
+ async processingRound5(_index, type, typeInfo, _calls, campaign, _pricer) {
12
+ const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
13
+ const vicunaTVL = (await axios("https://vicuna.orthae.xyz/tvl")).data;
14
+ const parsedName = typeInfo.name.toLowerCase().split(" ");
15
+ parsedName.shift();
16
+ const parsedNameForAPI = parsedName.join("-");
17
+ const tvl = vicunaTVL[campaign.computeChainId][parsedNameForAPI];
18
+ const priceTargetToken = tvl / totalSupply;
19
+ return {
20
+ ...typeInfo,
21
+ totalSupply,
22
+ tvl,
23
+ whitelistedSupplyTargetToken,
24
+ blacklistedSupply,
25
+ priceTargetToken,
26
+ cardName: generateCardName(type, typeInfo, campaign),
27
+ };
28
+ }
29
+ }
@@ -28,6 +28,7 @@ import { SturdySiloProcessor } from "./SturdySiloProcessor";
28
28
  import { TempestVaultProcessor } from "./TempestVaultProcessor";
29
29
  import { TorosProcessor } from "./TorosProcessor";
30
30
  import { UniswapProcessor } from "./UniswapProcessor";
31
+ import { VicunaProcessor } from "./VicunaProcessor";
31
32
  import { WoofiProcessor } from "./WoofiProcessor";
32
33
  import { ZkSwapThreePoolProcessor } from "./ZkSwapThreePoolProcessor";
33
34
  import { CurveNPoolProcessor } from "./curveNPoolProcessor";
@@ -98,4 +99,5 @@ export const processorMapping = {
98
99
  [tokenType.cpmmGamma]: GammaProcessor,
99
100
  [tokenType.venus]: AssetProcessor,
100
101
  [tokenType.reactor_fusion]: AssetProcessor,
102
+ [tokenType.vicuna]: VicunaProcessor,
101
103
  };
@@ -106,6 +106,8 @@ function satisfiesNameConditions(name, type) {
106
106
  return lowerCaseName.startsWith("hs");
107
107
  case tokenType.noLinkVault:
108
108
  return lowerCaseName.startsWith("unifi eth");
109
+ case tokenType.vicuna:
110
+ return lowerCaseName.startsWith("vifi");
109
111
  default:
110
112
  return false;
111
113
  }
@@ -191,7 +191,12 @@ export class RewardService {
191
191
  .filter(({ status }) => status === "fulfilled")
192
192
  .map(x => x.value);
193
193
  /** Load rewards from api DB */
194
- const rewards = (await RewardService.getByRecipient(user, merkleRoots.map(({ live }) => live), withToken, withTestTokens)).filter(reward => chainIds.includes(reward.RewardToken.chainId));
194
+ const rewards = (await RewardService.getByRecipient(user, merkleRoots
195
+ .map(({ live }) => live)
196
+ .map(r => r === "0x93579f92b68c727baf68b5235f229f6394c379f2aa257acde0b80e94fe366119"
197
+ ? "0xf5305c53253da61cb22765f53a046de82e3ba5de3956cdd021c90cd54acc9c08"
198
+ : r), // TODO REMOVE
199
+ withToken, withTestTokens)).filter(reward => chainIds.includes(reward.RewardToken.chainId));
195
200
  const promises = [];
196
201
  for (const [index, chainId] of chainIds.entries()) {
197
202
  const chain = chains.find(chain => chain.id === chainId);
@@ -108,6 +108,12 @@ export function generateCardName(type, typeInfo, campaign, symbols = [""]) {
108
108
  return `Curve ${typeInfo.name}`;
109
109
  }
110
110
  return `${typeInfo.name}`;
111
+ case tokenType.vicuna: {
112
+ const parsedName = typeInfo.name.split(" ");
113
+ parsedName.shift();
114
+ const parsedNameForCard = parsedName.join(" ");
115
+ return `Deposit liquidity on ${parsedNameForCard} vault on Vicuna Finance`;
116
+ }
111
117
  default:
112
118
  return `Hold ${typeInfo.name} (${campaign.campaignParameters.symbolTargetToken})`;
113
119
  }