@merkl/api 0.12.0 → 0.12.1
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.
@@ -99,12 +99,12 @@ export const extractOpportunities = {
|
|
99
99
|
const { active, all } = campaigns;
|
100
100
|
const pair = `${params.baseToken}-${params.quoteToken}`;
|
101
101
|
const holdings = [
|
102
|
-
{ symbol: params.
|
103
|
-
{ symbol: params.
|
102
|
+
{ symbol: params.symbolBaseToken, amount: poolBalanceToken0 ?? 0 },
|
103
|
+
{ symbol: params.symbolQuoteToken, amount: poolBalanceToken1 ?? 0 },
|
104
104
|
];
|
105
105
|
const platform = "Ambient";
|
106
106
|
const opportunity = {
|
107
|
-
id: `${Campaign.
|
107
|
+
id: `${Campaign.AMBIENTPROCESSOR}_${mainParameter}`,
|
108
108
|
platform: platform,
|
109
109
|
name: [platform, pair].join(" "),
|
110
110
|
chainId: !computeChainId ? chainId : computeChainId,
|
@@ -121,7 +121,7 @@ export const extractOpportunities = {
|
|
121
121
|
tokenIcons: [params.baseToken, params.quoteToken],
|
122
122
|
rewardTokenIcons: getRewardTokenIcons(campaigns.active),
|
123
123
|
dailyRewardTokens: getRewardTokens(campaigns.active),
|
124
|
-
campaigns: { ...campaigns, type: Campaign.
|
124
|
+
campaigns: { ...campaigns, type: Campaign.AMBIENTPROCESSOR, ids: campaigns.all.map(c => c.campaignId) },
|
125
125
|
};
|
126
126
|
return opportunity;
|
127
127
|
},
|
@@ -1093,40 +1093,6 @@ export const extractOpportunities = {
|
|
1093
1093
|
};
|
1094
1094
|
return opportunity;
|
1095
1095
|
},
|
1096
|
-
[Campaign.AMBIENTPROCESSOR]: (campaign, campaigns, prices) => {
|
1097
|
-
const { chainId, tvl, campaignSubType, campaignParameters: params, computeChainId } = campaign;
|
1098
|
-
const { active, all } = campaigns;
|
1099
|
-
const aprBreakdown = active.reduce((res, campaign) => {
|
1100
|
-
res[`Campaign ${campaign.campaignId.slice(0, 8)}`] = {
|
1101
|
-
value: campaign.apr ?? 0,
|
1102
|
-
address: campaign.campaignId,
|
1103
|
-
type: EAprBreakdownType.DETAILS,
|
1104
|
-
};
|
1105
|
-
return res;
|
1106
|
-
}, {});
|
1107
|
-
const aprBreakdown2 = getCampaignsApr(active);
|
1108
|
-
const opportunity = {
|
1109
|
-
id: `${Campaign.AMBIENTPROCESSOR}_${campaign.mainParameter}`,
|
1110
|
-
platform: "Ambient",
|
1111
|
-
name: `Ambient ${params.symbolBaseToken} ${params.symbolQuoteToken} ${params.poolId.slice(0, 7)}`,
|
1112
|
-
chainId: !computeChainId ? chainId : computeChainId,
|
1113
|
-
distributionChainId: chainId,
|
1114
|
-
tvl,
|
1115
|
-
action: "pool",
|
1116
|
-
subtype: campaignSubType,
|
1117
|
-
status: getStatus(all),
|
1118
|
-
tags: getTags(campaigns.all),
|
1119
|
-
dailyrewards: getDailyRewards(active, prices),
|
1120
|
-
tokenIcons: ["AMBIENT"],
|
1121
|
-
campaigns: { ...campaigns, type: Campaign.HYPERDRIVELOGPROCESSOR, ids: campaigns.all.map(c => c.campaignId) },
|
1122
|
-
rewardTokenIcons: getRewardTokenIcons(campaigns.active),
|
1123
|
-
dailyRewardTokens: getRewardTokens(campaigns.active),
|
1124
|
-
apr: getApr(active),
|
1125
|
-
aprBreakdown,
|
1126
|
-
aprBreakdown2,
|
1127
|
-
};
|
1128
|
-
return opportunity;
|
1129
|
-
},
|
1130
1096
|
};
|
1131
1097
|
/**
|
1132
1098
|
* @returns the opportunities map with their corresponding campaign's data added
|