Skip to content

Commit 27f9745

Browse files
authored
fix: filter Merkl campaign by chain id (#2619)
1 parent 87d9d1d commit 27f9745

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/components/incentives/IncentivesTooltipContent.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ const IncentivesSymbolMap: {
6161
symbol: 'aPYUSD',
6262
aToken: true,
6363
},
64+
aArbARB: {
65+
tokenIconSymbol: 'ARB',
66+
symbol: 'aARB',
67+
aToken: true,
68+
},
6469
aArbWETH: {
6570
tokenIconSymbol: 'WETH',
6671
symbol: 'aWETH',

src/hooks/useMerklIncentives.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ProtocolAction } from '@aave/contract-helpers';
22
import { ReserveIncentiveResponse } from '@aave/math-utils/dist/esm/formatters/incentive/calculate-reserve-incentives';
33
import { useQuery } from '@tanstack/react-query';
4+
import { useRootStore } from 'src/store/root';
45
import { additionalIncentiveInfo } from 'src/utils/addtional-incentive-infos';
56
import { convertAprToApy } from 'src/utils/utils';
67
import { whitelistedRewardTokens } from 'src/utils/whitelist';
@@ -127,6 +128,8 @@ export const useMerklIncentives = ({
127128
protocolAPY?: number;
128129
protocolIncentives?: ReserveIncentiveResponse[];
129130
}) => {
131+
const currentChainId = useRootStore((state) => state.currentChainId);
132+
130133
return useQuery({
131134
queryFn: async () => {
132135
const response = await fetch(`${MERKL_ENDPOINT}`);
@@ -148,7 +151,8 @@ export const useMerklIncentives = ({
148151
opportunitiy.explorerAddress &&
149152
opportunitiy.explorerAddress.toLowerCase() === rewardedAsset.toLowerCase() &&
150153
protocolAction &&
151-
checkOpportunityAction(opportunitiy.action, protocolAction)
154+
checkOpportunityAction(opportunitiy.action, protocolAction) &&
155+
opportunitiy.chainId === currentChainId
152156
);
153157

154158
if (opportunities.length === 0) {

0 commit comments

Comments
 (0)