From b5e53ff9c9cd03fff1cdb1581067c03c0885f367 Mon Sep 17 00:00:00 2001 From: AGMASO Date: Fri, 29 May 2026 12:23:12 +0200 Subject: [PATCH] fix: needed adjustments for points campaigns --- src/hooks/useEthenaIncentives.ts | 5 ++++- src/hooks/useEtherfiIncentives.ts | 5 ++++- src/hooks/useMerklPointsIncentives.ts | 9 +++++++-- src/hooks/useSonicIncentives.tsx | 3 ++- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/hooks/useEthenaIncentives.ts b/src/hooks/useEthenaIncentives.ts index 5258d93184..e3d7acea58 100644 --- a/src/hooks/useEthenaIncentives.ts +++ b/src/hooks/useEthenaIncentives.ts @@ -41,7 +41,10 @@ export const useEthenaIncentives = (rewardedAsset?: string): number | undefined if (!data) return undefined; const ethena = data.find( - (i) => i.__typename === 'SupplyPointsIncentive' && i.program.name === 'Ethena Rewards' + (i) => + i.__typename === 'SupplyPointsIncentive' && + i.kind === 'LOYALTY' && + i.program.name === 'Ethena Rewards' ); if (!ethena || ethena.__typename !== 'SupplyPointsIncentive') { return undefined; diff --git a/src/hooks/useEtherfiIncentives.ts b/src/hooks/useEtherfiIncentives.ts index e398bcc85d..716b270cbe 100644 --- a/src/hooks/useEtherfiIncentives.ts +++ b/src/hooks/useEtherfiIncentives.ts @@ -44,7 +44,10 @@ export const useEtherfiIncentives = ( if (!isSupplyContext || !data) return undefined; const etherfi = data.find( - (i) => i.__typename === 'SupplyPointsIncentive' && i.program.name === 'Ether.fi Loyalty' + (i) => + i.__typename === 'SupplyPointsIncentive' && + i.kind === 'LOYALTY' && + i.program.name === 'Ether.fi Loyalty' ); if (!etherfi || etherfi.__typename !== 'SupplyPointsIncentive') { return undefined; diff --git a/src/hooks/useMerklPointsIncentives.ts b/src/hooks/useMerklPointsIncentives.ts index 5e11ad2387..c30e0b78dd 100644 --- a/src/hooks/useMerklPointsIncentives.ts +++ b/src/hooks/useMerklPointsIncentives.ts @@ -56,9 +56,14 @@ export const useMerklPointsIncentives = ({ }); const isBorrow = protocolAction === ProtocolAction.borrow; - const targetTypename = isBorrow ? 'BorrowPointsIncentive' : 'SupplyPointsIncentive'; - const incentive = query.data?.find((i) => i.__typename === targetTypename); + const incentive = query.data?.find((i) => { + if (isBorrow) { + return i.__typename === 'BorrowPointsIncentive' && i.kind === 'CAMPAIGN'; + } + + return i.__typename === 'SupplyPointsIncentive' && i.kind === 'CAMPAIGN'; + }); if ( !incentive || diff --git a/src/hooks/useSonicIncentives.tsx b/src/hooks/useSonicIncentives.tsx index 3f117d1752..e609fcf3a4 100644 --- a/src/hooks/useSonicIncentives.tsx +++ b/src/hooks/useSonicIncentives.tsx @@ -35,7 +35,8 @@ export const useSonicIncentives = (rewardedAsset?: string): number | undefined = if (!data) return undefined; const sonic = data.find( - (i) => i.__typename === 'SupplyPointsIncentive' && i.program.name === 'Sonic' + (i) => + i.__typename === 'SupplyPointsIncentive' && i.kind === 'LOYALTY' && i.program.name === 'Sonic' ); if (!sonic || sonic.__typename !== 'SupplyPointsIncentive') return undefined;