Skip to content

Commit f4ed190

Browse files
committed
feat: deleted mock data and added description
1 parent e6ff7c1 commit f4ed190

File tree

4 files changed

+28
-84
lines changed

4 files changed

+28
-84
lines changed

src/components/incentives/IncentivesTooltipContent.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,14 @@ export const getSymbolMap = (incentive: ReserveIncentiveResponse) => {
197197
...IncentivesSymbolMap[rewardTokenSymbol],
198198
rewardTokenAddress: incentive.rewardTokenAddress,
199199
incentiveAPR: incentive.incentiveAPR,
200+
description: incentive.description,
200201
}
201202
: {
202203
...incentive,
203204
tokenIconSymbol: rewardTokenSymbol,
204205
symbol: rewardTokenSymbol,
205206
aToken: false,
207+
description: incentive.description,
206208
};
207209
};
208210

src/components/incentives/MerklIncentivesTooltipContent.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,22 @@ export const MerklIncentivesTooltipContent = ({
7979
Learn more
8080
</Link>
8181
</Typography>
82-
) : null}
82+
) : (
83+
<Typography variant="caption" color="text.strong" mb={3}>
84+
<Trans>{merklIncentivesFormatted.description}</Trans>{' '}
85+
<Link
86+
href={
87+
merklIncentives.customForumLink
88+
? merklIncentives.customForumLink
89+
: 'https://governance.aave.com/t/arfc-set-aci-as-emission-manager-for-liquidity-mining-programs/17898'
90+
}
91+
sx={{ textDecoration: 'underline' }}
92+
variant="caption"
93+
>
94+
Learn more
95+
</Link>
96+
</Typography>
97+
)}
8398

8499
<Box sx={{ width: '100%' }}>
85100
{merklIncentives.breakdown ? (

src/hooks/useMerklIncentives.ts

Lines changed: 9 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ enum OpportunityStatus {
1919
type MerklOpportunity = {
2020
chainId: number;
2121
type: string;
22+
description?: string;
2223
identifier: Address;
2324
name: string;
2425
status: OpportunityStatus;
@@ -108,80 +109,7 @@ type WhitelistApiResponse = {
108109
whitelistedRewardTokens: string[];
109110
additionalIncentiveInfo: Record<string, ReserveIncentiveAdditionalData>;
110111
};
111-
// TODO: Remove mock before production
112-
const ethfiMockOpportunity: MerklOpportunity = {
113-
chainId: 9745,
114-
type: 'AAVE_SUPPLY',
115-
identifier: '0xaf1a7a488c8348b41d5860c04162af7d3d38a996' as Address,
116-
name: 'Lend weETH on Aave (ETHFI Bonus)',
117-
status: OpportunityStatus.LIVE,
118-
action: OpportunityAction.LEND,
119-
tvl: 1000000,
120-
apr: 5.0,
121-
dailyRewards: 500,
122-
tags: [],
123-
id: 'mock-ethfi-campaign-2',
124-
explorerAddress: '0xaf1a7a488c8348b41d5860c04162af7d3d38a996' as Address,
125-
tokens: [
126-
{
127-
id: '14178706307683891785',
128-
name: 'Aave Plasma weETH',
129-
chainId: 9745,
130-
address: '0xaf1a7a488c8348b41d5860c04162af7d3d38a996' as Address,
131-
decimals: 18,
132-
icon: '',
133-
verified: false,
134-
isTest: false,
135-
price: 4156.526571271317,
136-
symbol: 'aPlaweETH',
137-
},
138-
{
139-
id: '3885658325202072166',
140-
name: 'Wrapped eETH',
141-
chainId: 9745,
142-
address: '0xa3d68b74bf0528fdd07263c60d6488749044914b' as Address,
143-
decimals: 18,
144-
icon: 'https://storage.googleapis.com/merkl-static-assets/tokens/weETH.webp',
145-
verified: true,
146-
isTest: false,
147-
price: 4156.526571271317,
148-
symbol: 'weETH',
149-
},
150-
],
151-
rewardsRecord: {
152-
id: 'mock-ethfi-rewards-record',
153-
total: 500,
154-
timestamp: '1761125029',
155-
breakdowns: [
156-
{
157-
token: {
158-
id: 'ethfi-token-id',
159-
name: 'Ether.fi Governance Token',
160-
chainId: 9745,
161-
address: '0xfe0c30065b384f05761f15d0cc899d4f9f9cc0eb',
162-
decimals: 18,
163-
symbol: 'ETHFI',
164-
displaySymbol: 'ETHFI',
165-
icon: 'https://assets.coingecko.com/coins/images/35958/standard/etherfi.png',
166-
verified: true,
167-
isTest: false,
168-
type: 'TOKEN',
169-
isNative: false,
170-
price: 3.25,
171-
},
172-
amount: '153846153846153846153',
173-
value: 500,
174-
distributionType: 'DUTCH_AUCTION',
175-
id: 'mock-ethfi-breakdown-id',
176-
campaignId: 'mock-ethfi-campaign-id',
177-
dailyRewardsRecordId: 'mock-ethfi-daily-rewards-id',
178-
},
179-
],
180-
},
181-
};
182-
183-
// TODO: Remove mock before production
184-
const mockaddressWeETH = '0xfe0c30065b384f05761f15d0cc899d4f9f9cc0eb';
112+
const mockaddressWeETH = '0xFe0c30065B384F05761f15d0CC899D4F9F9Cc0eB';
185113
const MERKL_ENDPOINT = 'https://api.merkl.xyz/v4/opportunities?mainProtocolId=aave'; // Merkl API
186114
const WHITELIST_ENDPOINT = 'https://apps.aavechan.com/api/aave/merkl/whitelist-token-list'; // Endpoint to fetch whitelisted tokens
187115
const checkOpportunityAction = (
@@ -206,10 +134,11 @@ const useWhitelistedTokens = () => {
206134
}
207135
const data = await response.json();
208136

209-
// TODO: Remove mock before production
137+
// TODO: Remove hardcoded addition once we have ETHFI in the whitelist API
210138
if (!data.whitelistedRewardTokens.includes(mockaddressWeETH.toLowerCase())) {
211139
data.whitelistedRewardTokens.push(mockaddressWeETH.toLowerCase());
212140
}
141+
213142
return data;
214143
},
215144
queryKey: ['whitelistedTokens'],
@@ -237,8 +166,7 @@ export const useMerklIncentives = ({
237166
queryFn: async () => {
238167
const response = await fetch(`${MERKL_ENDPOINT}`);
239168
const merklOpportunities: MerklOpportunity[] = await response.json();
240-
// TODO: Remove mock before production
241-
merklOpportunities.push(ethfiMockOpportunity);
169+
242170
return merklOpportunities;
243171
},
244172
queryKey: ['merklIncentives', market],
@@ -250,9 +178,8 @@ export const useMerklIncentives = ({
250178
opportunitiy.explorerAddress &&
251179
opportunitiy.explorerAddress.toLowerCase() === rewardedAsset.toLowerCase() &&
252180
protocolAction &&
253-
checkOpportunityAction(opportunitiy.action, protocolAction)
254-
// disabled to allow cross-chain incentives e.g. ethfi on weETH
255-
// opportunitiy.chainId === currentChainId
181+
checkOpportunityAction(opportunitiy.action, protocolAction) &&
182+
opportunitiy.chainId === currentChainId
256183
);
257184

258185
if (opportunities.length === 0) {
@@ -262,9 +189,6 @@ export const useMerklIncentives = ({
262189
const validOpportunities = opportunities.filter(
263190
(opp) => opp.status === OpportunityStatus.LIVE && opp.apr > 0
264191
);
265-
if (validOpportunities.length === 0) {
266-
return null;
267-
}
268192

269193
if (!whitelistData?.whitelistedRewardTokens) {
270194
return null;
@@ -291,6 +215,7 @@ export const useMerklIncentives = ({
291215

292216
const primaryOpportunity = whitelistedOpportunities[0];
293217
const rewardToken = primaryOpportunity.rewardsRecord.breakdowns[0].token;
218+
const description = primaryOpportunity.description;
294219

295220
const protocolIncentivesAPR = protocolIncentives.reduce((sum, inc) => {
296221
return sum + (inc.incentiveAPR === 'Infinity' ? 0 : +inc.incentiveAPR);
@@ -308,6 +233,7 @@ export const useMerklIncentives = ({
308233
incentiveAPR: merklIncentivesAPY.toString(),
309234
rewardTokenAddress: rewardToken.address,
310235
rewardTokenSymbol: rewardToken.symbol,
236+
description: description,
311237
...incentiveAdditionalData,
312238
allOpportunities: whitelistedOpportunities.map((opp) => ({
313239
name: opp.name,

src/locales/en/messages.po

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,6 +1233,7 @@ msgstr "deposited"
12331233
#: src/components/incentives/MeritIncentivesTooltipContent.tsx
12341234
#: src/components/incentives/MerklIncentivesTooltipContent.tsx
12351235
#: src/components/incentives/MerklIncentivesTooltipContent.tsx
1236+
#: src/components/incentives/MerklIncentivesTooltipContent.tsx
12361237
#: src/components/MarketSwitcher.tsx
12371238
#: src/components/transactions/DelegationTxsWrapper.tsx
12381239
#: src/components/transactions/DelegationTxsWrapper.tsx

0 commit comments

Comments
 (0)