@merkl/api 0.12.0 → 0.12.2

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.
@@ -97,14 +97,14 @@ export const extractOpportunities = {
97
97
  },
98
98
  [Campaign.AMBIENTPROCESSOR]: ({ chainId, mainParameter, tvl, campaignParameters: params, poolBalanceToken0, poolBalanceToken1, computeChainId }, campaigns, prices) => {
99
99
  const { active, all } = campaigns;
100
- const pair = `${params.baseToken}-${params.quoteToken}`;
100
+ const pair = `${params.symbolBaseToken}-${params.symbolQuoteToken}`;
101
101
  const holdings = [
102
- { symbol: params.symbolCurrency0, amount: poolBalanceToken0 ?? 0 },
103
- { symbol: params.symbolCurrency1, amount: poolBalanceToken1 ?? 0 },
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.CLAMM}_${mainParameter}`,
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.CLAMM, ids: campaigns.all.map(c => c.campaignId) },
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
@@ -128,7 +128,7 @@ export async function AmbientDynamicData(chainId, campaigns) {
128
128
  address: d.campaignParameters.baseToken,
129
129
  chainId: chainId,
130
130
  symbol: symbolBaseToken,
131
- })) ?? 2800;
131
+ }));
132
132
  const priceToken1 = (await pricer.get({
133
133
  address: d.campaignParameters.quoteToken,
134
134
  chainId: chainId,