Skip to content

Commit f6fb62e

Browse files
authored
feat: stopped hardcoded apy value & deleted logic for hardcoded values (#2690)
1 parent dfc252d commit f6fb62e

File tree

1 file changed

+0
-41
lines changed

1 file changed

+0
-41
lines changed

src/hooks/useMerklIncentives.ts

Lines changed: 0 additions & 41 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 { AaveV3Plasma } 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';
@@ -100,28 +99,6 @@ type WhitelistApiResponse = {
10099
additionalIncentiveInfo: Record<string, ReserveIncentiveAdditionalData>;
101100
};
102101

103-
const hardcodedIncentives: Record<string, ExtendedReserveIncentiveResponse> = {
104-
[AaveV3Plasma.ASSETS.USDe.A_TOKEN]: {
105-
incentiveAPR: '0.12',
106-
rewardTokenAddress: AaveV3Plasma.ASSETS.USDe.A_TOKEN,
107-
rewardTokenSymbol: 'aPlaUSDe',
108-
customMessage:
109-
'You must supply USDe and hold an equal or greater amount of sUSDe (by USD value) to receive the incentives. To be eligible, your assets supplied must be at least 2x your account equity, and you must not be borrowing any USDe. The rate provided to eligible users will change week by week, but will be roughly in line with the sUSDe rate for the forseeable future.',
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-
125102
const MERKL_ENDPOINT = 'https://api.merkl.xyz/v4/opportunities?mainProtocolId=aave'; // Merkl API
126103
const WHITELIST_ENDPOINT = 'https://apps.aavechan.com/api/aave/merkl/whitelist-token-list'; // Endpoint to fetch whitelisted tokens
127104
const checkOpportunityAction = (
@@ -176,24 +153,6 @@ export const useMerklIncentives = ({
176153
queryKey: ['merklIncentives', market],
177154
staleTime: 1000 * 60 * 5,
178155
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.06);
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-
197156
const opportunities = merklOpportunities.filter(
198157
(opportunitiy) =>
199158
rewardedAsset &&

0 commit comments

Comments
 (0)