|
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'; |
@@ -143,27 +142,7 @@ type WhitelistApiResponse = { |
143 | 142 | whitelistedRewardTokens: string[]; |
144 | 143 | additionalIncentiveInfo: Record<string, ReserveIncentiveAdditionalData>; |
145 | 144 | }; |
146 | | -const hardcodedIncentives: Record<string, ExtendedReserveIncentiveResponse> = { |
147 | | - [AaveV3Ethereum.ASSETS.USDT.V_TOKEN]: { |
148 | | - incentiveAPR: '0.15', |
149 | | - rewardTokenAddress: AaveV3Ethereum.ASSETS.USDT.A_TOKEN, |
150 | | - rewardTokenSymbol: 'syrupUSDT', |
151 | | - customMessage: |
152 | | - 'You need to supply syrupUSDT and borrow USDT to be eligible to this incentive campaign. This is a program initiated and implemented by ACI in collaboration with Merkl', |
153 | | - breakdown: { |
154 | | - protocolAPY: 0, |
155 | | - protocolIncentivesAPR: 0, |
156 | | - merklIncentivesAPR: 0, |
157 | | - totalAPY: 0, |
158 | | - isBorrow: true, |
159 | | - breakdown: { |
160 | | - protocol: 0, |
161 | | - protocolIncentives: 0, |
162 | | - merklIncentives: 0, |
163 | | - }, |
164 | | - }, |
165 | | - }, |
166 | | -}; |
| 145 | + |
167 | 146 | const MERKL_ENDPOINT = 'https://api.merkl.xyz/v4/opportunities?mainProtocolId=aave'; // Merkl API |
168 | 147 | const WHITELIST_ENDPOINT = 'https://apps.aavechan.com/api/aave/merkl/whitelist-token-list'; // Endpoint to fetch whitelisted tokens |
169 | 148 | const checkOpportunityAction = ( |
@@ -219,26 +198,6 @@ export const useMerklIncentives = ({ |
219 | 198 | queryKey: ['merklIncentives', market], |
220 | 199 | staleTime: 1000 * 60 * 5, |
221 | 200 | select: (merklOpportunities) => { |
222 | | - // Temporary hardcoded incentive |
223 | | - const hardcodedIncentive = rewardedAsset ? hardcodedIncentives[rewardedAsset] : undefined; |
224 | | - if (hardcodedIncentive) { |
225 | | - const protocolIncentivesAPR = protocolIncentives.reduce((sum, inc) => { |
226 | | - return sum + (inc.incentiveAPR === 'Infinity' ? 0 : +inc.incentiveAPR); |
227 | | - }, 0); |
228 | | - const merklIncentivesAPY = convertAprToApy(0.015); |
229 | | - return { |
230 | | - ...hardcodedIncentive, |
231 | | - breakdown: { |
232 | | - protocolAPY, |
233 | | - isBorrow: true, |
234 | | - protocolIncentivesAPR, |
235 | | - merklIncentivesAPR: merklIncentivesAPY, |
236 | | - totalAPY: protocolAPY + protocolIncentivesAPR - merklIncentivesAPY, |
237 | | - } as MerklIncentivesBreakdown, |
238 | | - } as ExtendedReserveIncentiveResponse; |
239 | | - } |
240 | | - // END |
241 | | - |
242 | 201 | const opportunities = merklOpportunities.filter( |
243 | 202 | (opportunitiy) => |
244 | 203 | rewardedAsset && |
|
0 commit comments