@merkl/api 0.11.2 → 0.11.4
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/entities/opportunity.js +34 -0
- 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/EqualizerGaugeProcessor.d.ts +28 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/EqualizerGaugeProcessor.js +28 -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/modules/v4/kyberzap/kyberzap.model.d.ts +2 -0
- package/dist/src/modules/v4/kyberzap/kyberzap.model.js +3 -0
- package/dist/src/utils/generateCardName.d.ts +1 -1
- package/dist/src/utils/generateCardName.js +5 -3
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -1063,6 +1063,40 @@ export const extractOpportunities = {
|
|
1063
1063
|
};
|
1064
1064
|
return opportunity;
|
1065
1065
|
},
|
1066
|
+
[Campaign.AMBIENTPROCESSOR]: (campaign, campaigns, prices) => {
|
1067
|
+
const { chainId, tvl, campaignSubType, campaignParameters: params, computeChainId } = campaign;
|
1068
|
+
const { active, all } = campaigns;
|
1069
|
+
const aprBreakdown = active.reduce((res, campaign) => {
|
1070
|
+
res[`Campaign ${campaign.campaignId.slice(0, 8)}`] = {
|
1071
|
+
value: campaign.apr ?? 0,
|
1072
|
+
address: campaign.campaignId,
|
1073
|
+
type: EAprBreakdownType.DETAILS,
|
1074
|
+
};
|
1075
|
+
return res;
|
1076
|
+
}, {});
|
1077
|
+
const aprBreakdown2 = getCampaignsApr(active);
|
1078
|
+
const opportunity = {
|
1079
|
+
id: `${Campaign.AMBIENTPROCESSOR}_${campaign.mainParameter}`,
|
1080
|
+
platform: "Ambient",
|
1081
|
+
name: `Ambient ${params.symbolBaseToken} ${params.symbolQuoteToken} ${params.poolId.slice(0, 7)}`,
|
1082
|
+
chainId: !computeChainId ? chainId : computeChainId,
|
1083
|
+
distributionChainId: chainId,
|
1084
|
+
tvl,
|
1085
|
+
action: "pool",
|
1086
|
+
subtype: campaignSubType,
|
1087
|
+
status: getStatus(all),
|
1088
|
+
tags: getTags(campaigns.all),
|
1089
|
+
dailyrewards: getDailyRewards(active, prices),
|
1090
|
+
tokenIcons: ["AMBIENT"],
|
1091
|
+
campaigns: { ...campaigns, type: Campaign.HYPERDRIVELOGPROCESSOR, ids: campaigns.all.map(c => c.campaignId) },
|
1092
|
+
rewardTokenIcons: getRewardTokenIcons(campaigns.active),
|
1093
|
+
dailyRewardTokens: getRewardTokens(campaigns.active),
|
1094
|
+
apr: getApr(active),
|
1095
|
+
aprBreakdown,
|
1096
|
+
aprBreakdown2,
|
1097
|
+
};
|
1098
|
+
return opportunity;
|
1099
|
+
},
|
1066
1100
|
};
|
1067
1101
|
/**
|
1068
1102
|
* @returns the opportunities map with their corresponding campaign's data added
|
@@ -78,7 +78,8 @@ export declare enum tokenType {
|
|
78
78
|
lendle_borrowing = "lendle_borrowing",
|
79
79
|
lendle_lending = "lendle_lending",
|
80
80
|
takotako_borrowing = "takotako_borrowing",
|
81
|
-
takotako_lending = "takotako_lending"
|
81
|
+
takotako_lending = "takotako_lending",
|
82
|
+
equalizer_gauge = "equalizer_gauge"
|
82
83
|
}
|
83
84
|
export declare const tokenTypeToProtocol: {
|
84
85
|
[key in tokenType]: {
|
@@ -80,6 +80,7 @@ export var tokenType;
|
|
80
80
|
tokenType["lendle_lending"] = "lendle_lending";
|
81
81
|
tokenType["takotako_borrowing"] = "takotako_borrowing";
|
82
82
|
tokenType["takotako_lending"] = "takotako_lending";
|
83
|
+
tokenType["equalizer_gauge"] = "equalizer_gauge";
|
83
84
|
})(tokenType || (tokenType = {}));
|
84
85
|
export const tokenTypeToProtocol = {
|
85
86
|
[tokenType.aave_borrowing]: { protocol: "Aave" },
|
@@ -191,4 +192,5 @@ export const tokenTypeToProtocol = {
|
|
191
192
|
[tokenType.lendle_lending]: { protocol: "Lendle" },
|
192
193
|
[tokenType.takotako_borrowing]: { protocol: "TakoTako" },
|
193
194
|
[tokenType.takotako_lending]: { protocol: "TakoTako" },
|
195
|
+
[tokenType.equalizer_gauge]: { protocol: "Equalizer" },
|
194
196
|
};
|
package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/EqualizerGaugeProcessor.d.ts
ADDED
@@ -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 dataRawEqualizerGauge;
|
7
|
+
call: string;
|
8
|
+
target: keyof callKeysEqualizerGauge;
|
9
|
+
metaData?: any;
|
10
|
+
};
|
11
|
+
type callKeysEqualizerGauge = mandatoryCallKeys & {
|
12
|
+
tokenPrice: string;
|
13
|
+
name: string;
|
14
|
+
};
|
15
|
+
type dataRawEqualizerGauge = callKeysEqualizerGauge & {};
|
16
|
+
type dataTypeEqualizerGauge = dataType & {
|
17
|
+
tokenPrice: string;
|
18
|
+
};
|
19
|
+
export declare class EqualizerGaugeProcessor extends GenericProcessor<callKeysEqualizerGauge, dataRawEqualizerGauge, dataTypeEqualizerGauge> {
|
20
|
+
rounds: {
|
21
|
+
round1: callType[];
|
22
|
+
round2: callType[];
|
23
|
+
round3: callType[];
|
24
|
+
round4: callType[];
|
25
|
+
};
|
26
|
+
processingRound5(_index: number, type: tokenType, typeInfo: dataRawEqualizerGauge, _calls: string[], campaign: CampaignParameters<Campaign.ERC20>, _pricer: Pricer): Promise<dataTypeEqualizerGauge>;
|
27
|
+
}
|
28
|
+
export {};
|
package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/EqualizerGaugeProcessor.js
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
import { generateCardName } from "../../../../../utils/generateCardName";
|
2
|
+
import axios from "axios";
|
3
|
+
import { GenericProcessor } from "./GenericProcessor";
|
4
|
+
export class EqualizerGaugeProcessor 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 EXTERNAL_EQUALIZER_ENDPOINT = "https://eqapi-sonic-prod-ltanm.ondigitalocean.app/sonic/v4/gauges/";
|
14
|
+
const data = (await axios(EXTERNAL_EQUALIZER_ENDPOINT)).data.data;
|
15
|
+
const tvl = data[typeInfo.tokenAddress].token0.reserveUsd + data[typeInfo.tokenAddress].token1.reserveUsd;
|
16
|
+
const priceTargetToken = tvl / totalSupply;
|
17
|
+
const displayName = `Stake into ${data[typeInfo.tokenAddress].pair.displayName} Equalizer Gauge`;
|
18
|
+
return {
|
19
|
+
...typeInfo,
|
20
|
+
totalSupply,
|
21
|
+
tvl,
|
22
|
+
whitelistedSupplyTargetToken,
|
23
|
+
blacklistedSupply,
|
24
|
+
priceTargetToken,
|
25
|
+
cardName: generateCardName(type, typeInfo, campaign, [], displayName),
|
26
|
+
};
|
27
|
+
}
|
28
|
+
}
|
@@ -8,6 +8,7 @@ import { BeefyProcessor } from "./BeefyProcessor";
|
|
8
8
|
import { CompoundProcessor } from "./CompoundProcessor";
|
9
9
|
import { ERC4626Processor } from "./ERC4626Processor";
|
10
10
|
import { EnzymeProcessor } from "./EnzymeProcessor";
|
11
|
+
import { EqualizerGaugeProcessor } from "./EqualizerGaugeProcessor";
|
11
12
|
import { EulerBorrowProcessor } from "./EulerBorrowProcessor";
|
12
13
|
import { EulerLendProcessor } from "./EulerLendProcessor";
|
13
14
|
import { FluidProcessor } from "./FluidProcessor";
|
@@ -116,4 +117,5 @@ export const processorMapping = {
|
|
116
117
|
[tokenType.lendle_lending]: AaveProcessor,
|
117
118
|
[tokenType.takotako_lending]: AaveProcessor,
|
118
119
|
[tokenType.takotako_borrowing]: AaveProcessor,
|
120
|
+
[tokenType.equalizer_gauge]: EqualizerGaugeProcessor,
|
119
121
|
};
|
@@ -132,6 +132,8 @@ function satisfiesNameConditions(name, type) {
|
|
132
132
|
return lowerCaseName.includes("cian");
|
133
133
|
case tokenType.concrete:
|
134
134
|
return lowerCaseName.includes("concrete");
|
135
|
+
case tokenType.equalizer_gauge:
|
136
|
+
return lowerCaseName.includes("equalizer");
|
135
137
|
default:
|
136
138
|
return false;
|
137
139
|
}
|
@@ -4,6 +4,8 @@ export declare const dexIdToProtocolId: {
|
|
4
4
|
readonly DEX_PANCAKESWAPV3: "pancakeswap-v3";
|
5
5
|
readonly DEX_SUSHISWAPV3: "sushiswap-v3";
|
6
6
|
readonly DEX_CURVE: "curve";
|
7
|
+
readonly DEX_SYNCSWAP_V3: "syncswap";
|
8
|
+
readonly DEX_ZKSWAP_V3: "zkswap";
|
7
9
|
readonly DEX_QUICKSWAPV3UNI: "quickswap-uni";
|
8
10
|
readonly DEX_QUICKSWAPV3ALGEBRA: "quickswap-algebra";
|
9
11
|
readonly DEX_THRUSTERV3: "thruster";
|
@@ -6,6 +6,9 @@ export const dexIdToProtocolId = {
|
|
6
6
|
DEX_PANCAKESWAPV3: "pancakeswap-v3",
|
7
7
|
DEX_SUSHISWAPV3: "sushiswap-v3",
|
8
8
|
DEX_CURVE: "curve",
|
9
|
+
DEX_SYNCSWAP_V3: "syncswap",
|
10
|
+
// DEX_SYNCSWAP_V1_V2: "syncswap",
|
11
|
+
DEX_ZKSWAP_V3: "zkswap",
|
9
12
|
DEX_QUICKSWAPV3UNI: "quickswap-uni",
|
10
13
|
DEX_QUICKSWAPV3ALGEBRA: "quickswap-algebra",
|
11
14
|
DEX_THRUSTERV3: "thruster",
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { tokenType } from "../libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
|
2
2
|
import type { Campaign, CampaignParameters } from "@sdk";
|
3
|
-
export declare function generateCardName(type: tokenType, typeInfo: any, campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>, symbols?: string[]): string;
|
3
|
+
export declare function generateCardName(type: tokenType, typeInfo: any, campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>, symbols?: string[], displayName?: string): string;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { tokenType } from "../libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
|
2
|
-
export function generateCardName(type, typeInfo, campaign, symbols = [""]) {
|
2
|
+
export function generateCardName(type, typeInfo, campaign, symbols = [""], displayName) {
|
3
3
|
switch (type) {
|
4
4
|
case tokenType.uniswapv2:
|
5
5
|
case tokenType.poolside:
|
@@ -132,13 +132,15 @@ export function generateCardName(type, typeInfo, campaign, symbols = [""]) {
|
|
132
132
|
case tokenType.concrete:
|
133
133
|
case tokenType.cian:
|
134
134
|
return `Deposit ${typeInfo.symbolAsset} into ${typeInfo.name.replace("Ether.Fi", "Veda")}`;
|
135
|
+
case tokenType.equalizer_gauge:
|
136
|
+
return `${displayName}`;
|
135
137
|
default:
|
136
138
|
// OVERRIDE
|
137
139
|
switch (typeInfo.tokenAddress) {
|
138
140
|
case "0x3a8099D8FE5C072bB035381003993393072D3ec7":
|
139
|
-
return
|
141
|
+
return "Hold pufETH on DeSyn (dpufETH)";
|
140
142
|
case "0x1f2aa9680910aC5a4527FA72001dC249943f60b4 ":
|
141
|
-
return
|
143
|
+
return "Hold pufETH on Karak (pufETH)";
|
142
144
|
default:
|
143
145
|
return `Hold ${typeInfo.name} (${campaign.campaignParameters.symbolTargetToken})`;
|
144
146
|
}
|