|
1 | 1 | import { ProtocolAction } from '@aave/contract-helpers'; |
2 | 2 | import { ReserveIncentiveResponse } from '@aave/math-utils/dist/esm/formatters/incentive/calculate-reserve-incentives'; |
3 | | -import { AaveV3Ethereum } from '@bgd-labs/aave-address-book'; |
4 | 3 | import { useQuery } from '@tanstack/react-query'; |
5 | 4 | import { useRootStore } from 'src/store/root'; |
6 | 5 | import { convertAprToApy } from 'src/utils/utils'; |
@@ -100,28 +99,6 @@ type WhitelistApiResponse = { |
100 | 99 | additionalIncentiveInfo: Record<string, ReserveIncentiveAdditionalData>; |
101 | 100 | }; |
102 | 101 |
|
103 | | -const hardcodedIncentives: Record<string, ExtendedReserveIncentiveResponse> = { |
104 | | - [AaveV3Ethereum.ASSETS.PYUSD.A_TOKEN]: { |
105 | | - incentiveAPR: '0.43', |
106 | | - rewardTokenAddress: AaveV3Ethereum.ASSETS.PYUSD.A_TOKEN, |
107 | | - rewardTokenSymbol: 'aEthPYUSD', |
108 | | - customMessage: |
109 | | - 'You need to supply PYUSD without holding any PYUSD debt. This is a program initiated and implemented by ACI in collaboration with Merkl.', |
110 | | - breakdown: { |
111 | | - protocolAPY: 0, |
112 | | - protocolIncentivesAPR: 0, |
113 | | - merklIncentivesAPR: 0, |
114 | | - totalAPY: 0, |
115 | | - isBorrow: false, |
116 | | - breakdown: { |
117 | | - protocol: 0, |
118 | | - protocolIncentives: 0, |
119 | | - merklIncentives: 0, |
120 | | - }, |
121 | | - }, |
122 | | - }, |
123 | | -}; |
124 | | - |
125 | 102 | const MERKL_ENDPOINT = 'https://api.merkl.xyz/v4/opportunities?mainProtocolId=aave'; // Merkl API |
126 | 103 | const WHITELIST_ENDPOINT = 'https://apps.aavechan.com/api/aave/merkl/whitelist-token-list'; // Endpoint to fetch whitelisted tokens |
127 | 104 | const checkOpportunityAction = ( |
@@ -176,23 +153,6 @@ export const useMerklIncentives = ({ |
176 | 153 | queryKey: ['merklIncentives', market], |
177 | 154 | staleTime: 1000 * 60 * 5, |
178 | 155 | select: (merklOpportunities) => { |
179 | | - const hardcodedIncentive = rewardedAsset ? hardcodedIncentives[rewardedAsset] : undefined; |
180 | | - |
181 | | - if (hardcodedIncentive) { |
182 | | - const protocolIncentivesAPR = protocolIncentives.reduce((sum, inc) => { |
183 | | - return sum + (inc.incentiveAPR === 'Infinity' ? 0 : +inc.incentiveAPR); |
184 | | - }, 0); |
185 | | - const merklIncentivesAPY = convertAprToApy(0.1); |
186 | | - return { |
187 | | - ...hardcodedIncentive, |
188 | | - breakdown: { |
189 | | - protocolAPY, |
190 | | - protocolIncentivesAPR, |
191 | | - merklIncentivesAPR: merklIncentivesAPY, |
192 | | - totalAPY: protocolAPY + protocolIncentivesAPR + merklIncentivesAPY, |
193 | | - } as MerklIncentivesBreakdown, |
194 | | - } as ExtendedReserveIncentiveResponse; |
195 | | - } |
196 | 156 | const opportunities = merklOpportunities.filter( |
197 | 157 | (opportunitiy) => |
198 | 158 | rewardedAsset && |
|
0 commit comments