Skip to content
Merged
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
24 changes: 6 additions & 18 deletions src/components/incentives/MerklIncentivesTooltipContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ export const MerklIncentivesTooltipContent = ({
merklIncentives.onChainCampaignId?.toLowerCase()
)
: undefined;
const learnMoreLink =
merklIncentives.customForumLink ??
merklIncentives.merklOpportunityUrl ??
'https://governance.aave.com/t/arfc-set-aci-as-emission-manager-for-liquidity-mining-programs/17898';
return (
<Box
sx={{
Expand Down Expand Up @@ -117,30 +121,14 @@ export const MerklIncentivesTooltipContent = ({
{merklIncentives.customMessage ? (
<Typography variant="caption" color="text.strong" mb={3}>
<Trans>{merklIncentives.customMessage}</Trans>{' '}
<Link
href={
merklIncentives.customForumLink
? merklIncentives.customForumLink
: 'https://governance.aave.com/t/arfc-set-aci-as-emission-manager-for-liquidity-mining-programs/17898'
}
sx={{ textDecoration: 'underline' }}
variant="caption"
>
<Link href={learnMoreLink} sx={{ textDecoration: 'underline' }} variant="caption">
Learn more
</Link>
</Typography>
) : (
<Typography variant="caption" color="text.strong" mb={3}>
<Trans>{merklIncentives.description}</Trans>{' '}
<Link
href={
merklIncentives.customForumLink
? merklIncentives.customForumLink
: 'https://governance.aave.com/t/arfc-set-aci-as-emission-manager-for-liquidity-mining-programs/17898'
}
sx={{ textDecoration: 'underline' }}
variant="caption"
>
<Link href={learnMoreLink} sx={{ textDecoration: 'underline' }} variant="caption">
Learn more
</Link>
</Typography>
Expand Down
3 changes: 3 additions & 0 deletions src/hooks/useMerklIncentives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export type ExtendedReserveIncentiveResponse = ReserveIncentiveResponse &
ReserveIncentiveAdditionalData & {
breakdown: MerklIncentivesBreakdown;
description?: string;
merklOpportunityUrl?: string;
isSelf?: boolean;
rewardsTokensMappedApys?: {
token: {
Expand Down Expand Up @@ -145,6 +146,7 @@ export type MerklIncentivesBreakdown = {

const MERKL_ENDPOINT =
'https://api.merkl.xyz/v4/opportunities?mainProtocolId=aave&items=100&status=LIVE'; // Merkl API
const MERKL_OPPORTUNITY_URL = 'https://app.merkl.xyz/opportunities';
const AAVE_NET_APR_DISTRIBUTION_TYPE = 'AAVE_NET_APR';
const convertApyToApr = (apy: number) => 12 * ((1 + apy) ** (1 / 12) - 1);

Expand Down Expand Up @@ -328,6 +330,7 @@ export const useMerklIncentives = ({
rewardTokenAddress: rewardToken.address,
rewardTokenSymbol: rewardToken.symbol,
description: description,
merklOpportunityUrl: `${MERKL_OPPORTUNITY_URL}/${primaryOpportunity.id}`,
...incentiveAdditionalData,
isSelf,
rewardsTokensMappedApys,
Expand Down
Loading