Skip to content

Commit e950a9b

Browse files
authored
feat: delete hardcoded opportunity (#2811)
1 parent a4dadd2 commit e950a9b

File tree

1 file changed

+1
-42
lines changed

1 file changed

+1
-42
lines changed

src/hooks/useMerklIncentives.ts

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { ProtocolAction } from '@aave/contract-helpers';
22
import { ReserveIncentiveResponse } from '@aave/math-utils/dist/esm/formatters/incentive/calculate-reserve-incentives';
3-
import { AaveV3Ethereum } from '@bgd-labs/aave-address-book';
43
import { useQuery } from '@tanstack/react-query';
54
import { useRootStore } from 'src/store/root';
65
import { convertAprToApy } from 'src/utils/utils';
@@ -143,27 +142,7 @@ type WhitelistApiResponse = {
143142
whitelistedRewardTokens: string[];
144143
additionalIncentiveInfo: Record<string, ReserveIncentiveAdditionalData>;
145144
};
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+
167146
const MERKL_ENDPOINT = 'https://api.merkl.xyz/v4/opportunities?mainProtocolId=aave'; // Merkl API
168147
const WHITELIST_ENDPOINT = 'https://apps.aavechan.com/api/aave/merkl/whitelist-token-list'; // Endpoint to fetch whitelisted tokens
169148
const checkOpportunityAction = (
@@ -219,26 +198,6 @@ export const useMerklIncentives = ({
219198
queryKey: ['merklIncentives', market],
220199
staleTime: 1000 * 60 * 5,
221200
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-
242201
const opportunities = merklOpportunities.filter(
243202
(opportunitiy) =>
244203
rewardedAsset &&

0 commit comments

Comments
 (0)