@@ -2,7 +2,6 @@ import { ProtocolAction } from '@aave/contract-helpers';
22import { ReserveIncentiveResponse } from '@aave/math-utils/dist/esm/formatters/incentive/calculate-reserve-incentives' ;
33import { Trans } from '@lingui/macro' ;
44import { Box , Typography } from '@mui/material' ;
5- import { useMeritIncentives } from 'src/hooks/useMeritIncentives' ;
65import { useMerklIncentives } from 'src/hooks/useMerklIncentives' ;
76import { convertAprToApy } from 'src/utils/utils' ;
87
@@ -298,14 +297,6 @@ export const IncentivesTooltipContent = ({
298297} : IncentivesTooltipContentProps ) => {
299298 const typographyVariant = 'secondary12' ;
300299
301- const { data : meritIncentives } = useMeritIncentives ( {
302- symbol,
303- market : market || '' ,
304- protocolAction,
305- protocolAPY,
306- protocolIncentives : incentives ,
307- } ) ;
308-
309300 const { data : merklIncentives } = useMerklIncentives ( {
310301 market : market || '' ,
311302 rewardedAsset : address ,
@@ -336,20 +327,13 @@ export const IncentivesTooltipContent = ({
336327 ) ;
337328 } ;
338329
339- const meritIncentivesAPR = meritIncentives ?. breakdown ?. meritIncentivesAPR || 0 ;
340330 const merklIncentivesAPR = merklIncentives ?. breakdown ?. merklIncentivesAPR || 0 ;
341331
342332 // For borrow, incentives are subtracted; for supply, they're added
343333 const isBorrow = protocolAction === ProtocolAction . borrow ;
344334 const totalAPY = isBorrow
345- ? protocolAPY -
346- ( incentivesNetAPR === 'Infinity' ? 0 : incentivesNetAPR ) -
347- meritIncentivesAPR -
348- merklIncentivesAPR
349- : protocolAPY +
350- ( incentivesNetAPR === 'Infinity' ? 0 : incentivesNetAPR ) +
351- meritIncentivesAPR +
352- merklIncentivesAPR ;
335+ ? protocolAPY - ( incentivesNetAPR === 'Infinity' ? 0 : incentivesNetAPR ) - merklIncentivesAPR
336+ : protocolAPY + ( incentivesNetAPR === 'Infinity' ? 0 : incentivesNetAPR ) + merklIncentivesAPR ;
353337
354338 return (
355339 < Box
@@ -419,41 +403,6 @@ export const IncentivesTooltipContent = ({
419403 ) ;
420404 } ) }
421405
422- { /* Show Merit Incentives if available */ }
423- { meritIncentives && meritIncentives . breakdown && (
424- < Row
425- height = { 32 }
426- caption = {
427- < Box sx = { { display : 'flex' , alignItems : 'center' , mb : 2 } } >
428- < img
429- src = { '/icons/other/aci-black.svg' }
430- width = "20px"
431- height = "20px"
432- alt = "Merit"
433- style = { { marginRight : '8px' } }
434- />
435- < Box sx = { { display : 'flex' , alignItems : 'center' } } >
436- < Typography variant = { typographyVariant } > Merit Incentives</ Typography >
437- < Typography variant = { typographyVariant } sx = { { ml : 0.5 } } >
438- { isBorrow ? '(-)' : '(+)' }
439- </ Typography >
440- </ Box >
441- </ Box >
442- }
443- width = "100%"
444- >
445- < FormattedNumber
446- value = {
447- isBorrow
448- ? - meritIncentives . breakdown . meritIncentivesAPR
449- : meritIncentives . breakdown . meritIncentivesAPR
450- }
451- percent
452- variant = { typographyVariant }
453- />
454- </ Row >
455- ) }
456-
457406 { /* Show Merkl Incentives if available */ }
458407 { merklIncentives && merklIncentives . breakdown && (
459408 < Row
@@ -507,8 +456,8 @@ export const IncentivesTooltipContent = ({
507456 </ Box >
508457 ) }
509458
510- { /* Show Total APY if we have Merit incentives or protocol APY */ }
511- { ( meritIncentives ?. breakdown || protocolAPY > 0 ) && (
459+ { /* Show Total APY if we have Merkl incentives or protocol APY */ }
460+ { protocolAPY > 0 && (
512461 < Box sx = { ( ) => ( { pt : 1 , mt : 1 , borderTop : '1px solid rgba(255, 255, 255, 0.1)' } ) } >
513462 < Row
514463 caption = {
0 commit comments