Skip to content

Commit

Permalink
feat: add pyusd Merit campaign [skip cypress] (#2269)
Browse files Browse the repository at this point in the history
  • Loading branch information
NandyBa authored Dec 11, 2024
1 parent d5a9402 commit 681a94c
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/components/incentives/IncentivesTooltipContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ const IncentivesSymbolMap: {
symbol: 'aUSDT',
aToken: true,
},
aEthPYUSD: {
tokenIconSymbol: 'PYUSD',
symbol: 'aPYUSD',
aToken: true,
},
aAvaSAVAX: {
tokenIconSymbol: 'sAVAX',
symbol: 'asAVAX',
Expand Down
8 changes: 6 additions & 2 deletions src/components/incentives/MeritIncentivesTooltipContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const MeritIncentivesTooltipContent = ({
}}
>
<Typography variant="caption" color="text.primary" mb={3}>
<Trans>Eligible for the merit program.</Trans>
<Trans>Eligible for the Merit program.</Trans>
</Typography>

<Typography variant="caption" color="text.secondary" mb={3}>
Expand All @@ -36,7 +36,11 @@ export const MeritIncentivesTooltipContent = ({
does not guarantee the program and accepts no liability.
</Trans>{' '}
<Link
href="https://governance.aave.com/t/arfc-merit-a-new-aave-alignment-user-reward-system/16646"
href={
meritIncentives.customForumLink
? meritIncentives.customForumLink
: 'https://governance.aave.com/t/arfc-merit-a-new-aave-alignment-user-reward-system/16646'
}
sx={{ textDecoration: 'underline' }}
variant="caption"
color="text.secondary"
Expand Down
16 changes: 16 additions & 0 deletions src/hooks/useMeritIncentives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { CustomMarket } from 'src/ui-config/marketsConfig';

export enum MeritAction {
ETHEREUM_STKGHO = 'ethereum-stkgho',
ETHEREUM_SUPPLY_PYUSD = 'ethereum-supply-pyusd',
SUPPLY_CBBTC_BORROW_USDC = 'ethereum-supply-cbbtc-borrow-usdc',
SUPPLY_WBTC_BORROW_USDT = 'ethereum-supply-wbtc-borrow-usdt',
BASE_SUPPLY_CBBTC = 'base-supply-cbbtc',
Expand All @@ -26,6 +27,7 @@ type MeritIncentives = {

export type ExtendedReserveIncentiveResponse = ReserveIncentiveResponse & {
customMessage: string;
customForumLink: string;
};

const url = 'https://apps.aavechan.com/api/merit/aprs';
Expand All @@ -34,6 +36,7 @@ export type MeritReserveIncentiveData = Omit<ReserveIncentiveResponse, 'incentiv
action: MeritAction;
protocolAction?: ProtocolAction;
customMessage?: string;
customForumLink?: string;
};

const getMeritData = (market: string, symbol: string): MeritReserveIncentiveData[] | undefined =>
Expand Down Expand Up @@ -84,6 +87,18 @@ const MERIT_DATA_MAP: Record<string, Record<string, MeritReserveIncentiveData[]>
customMessage: 'You must supply wBTC and borrow USDT in order to receive merit rewards.',
},
],
PYUSD: [
{
action: MeritAction.ETHEREUM_SUPPLY_PYUSD,
rewardTokenAddress: AaveV3Ethereum.ASSETS.PYUSD.A_TOKEN,
rewardTokenSymbol: 'aEthPYUSD',
protocolAction: ProtocolAction.supply,
customForumLink:
'https://governance.aave.com/t/arfc-pyusd-reserve-configuration-update-incentive-campaign/19573',
customMessage:
'Borrowing of some assets may impact the amount of rewards you are eligible for. Please check the forum post for the full eligibility criteria.'
},
],
},
[CustomMarket.proto_base_v3]: {
cbBTC: [
Expand Down Expand Up @@ -188,6 +203,7 @@ export const useMeritIncentives = ({
rewardTokenAddress: incentive.rewardTokenAddress,
rewardTokenSymbol: incentive.rewardTokenSymbol,
customMessage: incentive.customMessage,
customForumLink: incentive.customForumLink,
} as ExtendedReserveIncentiveResponse;
},
});
Expand Down
2 changes: 1 addition & 1 deletion src/locales/en/messages.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1001,8 +1001,8 @@ msgid "Efficiency mode (E-Mode)"
msgstr "Efficiency mode (E-Mode)"

#: src/components/incentives/MeritIncentivesTooltipContent.tsx
msgid "Eligible for the merit program."
msgstr "Eligible for the merit program."
msgid "Eligible for the Merit program."
msgstr "Eligible for the Merit program."

#: src/layouts/FeedbackDialog.tsx
msgid "Email"
Expand Down

1 comment on commit 681a94c

@github-actions
Copy link

Choose a reason for hiding this comment

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

This commit was deployed on ipfs

Please sign in to comment.