@@ -19,6 +19,7 @@ enum OpportunityStatus {
1919type 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' ;
185113const MERKL_ENDPOINT = 'https://api.merkl.xyz/v4/opportunities?mainProtocolId=aave' ; // Merkl API
186114const WHITELIST_ENDPOINT = 'https://apps.aavechan.com/api/aave/merkl/whitelist-token-list' ; // Endpoint to fetch whitelisted tokens
187115const 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 ,
0 commit comments