@merkl/api 0.10.327 → 0.10.328
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.
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.d.ts +2 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.js +2 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/VicunaProcessor.d.ts +28 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/VicunaProcessor.js +29 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/processorMapping.js +2 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1.js +2 -0
- package/dist/src/utils/generateCardName.js +6 -0
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -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
|
}
|
@@ -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
|
}
|