Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/components/incentives/IncentivesButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export const MerklIncentivesButton = (params: {
protocolAction?: ProtocolAction;
protocolAPY?: number;
protocolIncentives?: ReserveIncentiveResponse[];
hideValue?: boolean;
}) => {
const [open, setOpen] = useState(false);
const { data: merklIncentives } = useMerklIncentives(params);
Expand All @@ -197,7 +198,11 @@ export const MerklIncentivesButton = (params: {
setOpen={setOpen}
open={open}
>
<Content incentives={[incentiveData]} incentivesNetAPR={incentiveAPR} />
<Content
incentives={[incentiveData]}
incentivesNetAPR={incentiveAPR}
hideValue={params.hideValue}
/>
</ContentWithTooltip>
);
};
Expand Down
9 changes: 9 additions & 0 deletions src/components/incentives/IncentivesCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ export const IncentivesCard = ({
const isSghoPage =
typeof router?.asPath === 'string' && router.asPath.toLowerCase().startsWith('/sgho');
const hideMeritValue = symbol === 'GHO' && !isSghoPage;
const isMarketsOrDashboardPage =
typeof router?.pathname === 'string' &&
(router.pathname.startsWith('/dashboard') || router.pathname.startsWith('/markets'));
// Hide GHO Merkl value on dashboard/markets; show only the badge icon.
const hideMerklValue =
symbol === 'GHO' &&
(protocolAction === ProtocolAction.borrow || protocolAction === ProtocolAction.supply) &&
isMarketsOrDashboardPage;

const incentivesContent = (
<>
Expand All @@ -136,6 +144,7 @@ export const IncentivesCard = ({
protocolAction={protocolAction}
protocolAPY={protocolAPY}
protocolIncentives={incentives || []}
hideValue={hideMerklValue}
/>
<EthenaIncentivesButton rewardedAsset={address} />
<EtherfiIncentivesButton symbol={symbol} market={market} protocolAction={protocolAction} />
Expand Down
5 changes: 5 additions & 0 deletions src/components/incentives/IncentivesTooltipContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ const IncentivesSymbolMap: {
symbol: 'awrsETH',
aToken: true,
},
aPlaGHO: {
tokenIconSymbol: 'GHO',
symbol: 'aGHO',
aToken: true,
},
};

interface IncentivesTooltipContentProps {
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useMerklIncentives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ type WhitelistApiResponse = {
};

const MERKL_ENDPOINT =
'https://api-merkl.angle.money/v4/opportunities?mainProtocolId=aave&items=100&status=LIVE'; // Merkl API
'https://api.merkl.xyz/v4/opportunities?mainProtocolId=aave&items=100&status=LIVE'; // Merkl API
const WHITELIST_ENDPOINT = 'https://apps.aavechan.com/api/aave/merkl/whitelist-token-list'; // Endpoint to fetch whitelisted tokens
Comment on lines 146 to 148
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useMerklIncentives fetches a third-party API but does not check response.ok before calling response.json(). If Merkl returns a non-2xx (rate limit, outage, HTML error page), this will throw a less actionable JSON parse error and can result in noisy retries/cached errors. Add an explicit response.ok guard and throw a descriptive error (include status / endpoint) similar to the whitelist fetch in this file.

Copilot uses AI. Check for mistakes.
const checkOpportunityAction = (
opportunityAction: OpportunityAction,
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useMerklPointsIncentives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type ReserveIncentiveAdditionalData = {
// Normalize to lowercase for case-insensitive comparison
const INK_POINT_TOKEN_ADDRESSES = ['0x40aBd730Cc9dA34a8EE9823fEaBDBa35E50c4ac7'.toLowerCase()];
const MERKL_TYDRO_ENDPOINT =
'https://api-merkl.angle.money/v4/opportunities?mainProtocolId=tydro&chainName=ink&items=100&status=LIVE'; // Merkl API
'https://api.merkl.xyz/v4/opportunities?mainProtocolId=tydro&chainName=ink&items=100&status=LIVE'; // Merkl API

Comment on lines 33 to 35
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useMerklPointsIncentives does not validate the Merkl API response before parsing JSON. A non-2xx response (temporary outage / rate limit) will currently surface as an unhelpful JSON parse error. Add a response.ok check (and ideally a descriptive thrown error) before response.json() to make failures debuggable and avoid confusing UI states.

Copilot uses AI. Check for mistakes.
const checkOpportunityAction = (
opportunityAction: OpportunityAction,
Expand Down
Loading