Skip to content

Commit bbc20a1

Browse files
authored
✨ Add new USDe incentives + improve Merkl tooltip (#2553)
1 parent ff2a6cb commit bbc20a1

4 files changed

Lines changed: 68 additions & 11 deletions

File tree

src/components/incentives/IncentivesTooltipContent.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ const IncentivesSymbolMap: {
133133
symbol: 'aEURC',
134134
aToken: true,
135135
},
136+
aEthUSDe: {
137+
tokenIconSymbol: 'USDe',
138+
symbol: 'aUSDe',
139+
aToken: true,
140+
},
136141
};
137142

138143
interface IncentivesTooltipContentProps {

src/components/incentives/MerklIncentivesTooltipContent.tsx

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,34 @@ export const MerklIncentivesTooltipContent = ({
5050
</Trans>
5151
</Typography>
5252

53-
<Typography variant="caption" color="text.secondary" mb={3}>
53+
<Typography variant="caption" color="text.strong" mb={3}>
5454
<Trans>Merkl rewards are claimed through the</Trans>{' '}
55-
<Link
56-
href="https://app.merkl.xyz/"
57-
sx={{ textDecoration: 'underline' }}
58-
variant="caption"
59-
color="text.secondary"
60-
>
55+
<Link href="https://app.merkl.xyz/" sx={{ textDecoration: 'underline' }} variant="caption">
6156
official app
6257
</Link>
6358
{'.'}
59+
{merklIncentives.customClaimMessage ? (
60+
<>
61+
{' '}
62+
<Trans> {merklIncentives.customClaimMessage}</Trans>
63+
</>
64+
) : null}
6465
</Typography>
66+
6567
{merklIncentives.customMessage ? (
6668
<Typography variant="caption" color="text.strong" mb={3}>
67-
<Trans>{merklIncentives.customMessage}</Trans>
69+
<Trans>{merklIncentives.customMessage}</Trans>{' '}
70+
<Link
71+
href={
72+
merklIncentives.customForumLink
73+
? merklIncentives.customForumLink
74+
: 'https://governance.aave.com/t/arfc-set-aci-as-emission-manager-for-liquidity-mining-programs/17898'
75+
}
76+
sx={{ textDecoration: 'underline' }}
77+
variant="caption"
78+
>
79+
Learn more
80+
</Link>
6881
</Typography>
6982
) : null}
7083

src/hooks/useMerklIncentives.ts

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,15 @@ type MerklOpportunity = {
8787
};
8888
};
8989

90-
export type ExtendedReserveIncentiveResponse = ReserveIncentiveResponse & {
91-
customMessage: string;
92-
customForumLink: string;
90+
type ReserveIncentiveAdditionalData = {
91+
customClaimMessage?: string;
92+
customMessage?: string;
93+
customForumLink?: string;
9394
};
9495

96+
export type ExtendedReserveIncentiveResponse = ReserveIncentiveResponse &
97+
ReserveIncentiveAdditionalData;
98+
9599
const allAaveAssets = [
96100
AaveV3Ethereum.ASSETS,
97101
AaveV3EthereumLido.ASSETS,
@@ -111,6 +115,28 @@ const allAaveAssets = [
111115
AaveV3Soneium.ASSETS,
112116
];
113117

118+
const additionalIncentiveData: Record<string, ReserveIncentiveAdditionalData> = {
119+
[AaveV3Ethereum.ASSETS.USDe.A_TOKEN]: {
120+
customMessage:
121+
'You must supply USDe and hold an equal or greater amount of sUSDe (by USD value) to receive the incentives. To be eligible, your assets supplied must be at least 2x your account equity, and you must not be borrowing any USDe.',
122+
},
123+
[AaveV3Ethereum.ASSETS.USDtb.A_TOKEN]: {
124+
customMessage:
125+
'You must supply USDtb to receive incentives. To be eligible, you must not be borrowing any USDtb.',
126+
customClaimMessage: 'Rewards will be claimable starting in early August.',
127+
customForumLink: 'https://x.com/ethena_labs/status/1950194502192550149',
128+
},
129+
};
130+
131+
const hardcodedIncentives: Record<string, ExtendedReserveIncentiveResponse> = {
132+
[AaveV3Ethereum.ASSETS.USDe.A_TOKEN]: {
133+
incentiveAPR: '0.12',
134+
rewardTokenAddress: AaveV3Ethereum.ASSETS.USDe.A_TOKEN,
135+
rewardTokenSymbol: 'aEthUSDe',
136+
...additionalIncentiveData[AaveV3Ethereum.ASSETS.USDe.A_TOKEN],
137+
},
138+
};
139+
114140
const getUnderlyingAndAToken = (assets: {
115141
[key: string]: {
116142
UNDERLYING: Address;
@@ -125,6 +151,7 @@ const getUnderlyingAndAToken = (assets: {
125151

126152
const otherTokensWhitelisted = [
127153
'0x04eadd7b10ea9a484c60860aea7a7c0aec09b9f0', // aUSDtb wrapper contract
154+
'0x3a4de44B29995a3D8Cd02d46243E1563E55bCc8b', // Aave Ethereum USDe (wrapped)
128155
];
129156

130157
const whitelistedRewardTokens = [
@@ -166,6 +193,12 @@ export const useMerklIncentives = ({
166193
queryKey: ['merklIncentives', market],
167194
staleTime: 1000 * 60 * 5,
168195
select: (merklOpportunities) => {
196+
const hardcodedIncentive = rewardedAsset ? hardcodedIncentives[rewardedAsset] : undefined;
197+
198+
if (hardcodedIncentive) {
199+
return hardcodedIncentive;
200+
}
201+
169202
const opportunities = merklOpportunities.filter(
170203
(opportunitiy) =>
171204
rewardedAsset &&
@@ -197,10 +230,15 @@ export const useMerklIncentives = ({
197230
return null;
198231
}
199232

233+
const incentiveAdditionalData = rewardedAsset
234+
? additionalIncentiveData[rewardedAsset]
235+
: undefined;
236+
200237
return {
201238
incentiveAPR: apr.toString(),
202239
rewardTokenAddress: rewardToken.address,
203240
rewardTokenSymbol: rewardToken.symbol,
241+
...incentiveAdditionalData,
204242
} as ExtendedReserveIncentiveResponse;
205243
},
206244
});

src/locales/en/messages.po

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,7 @@ msgstr "deposited"
11281128

11291129
#: src/components/incentives/MeritIncentivesTooltipContent.tsx
11301130
#: src/components/incentives/MerklIncentivesTooltipContent.tsx
1131+
#: src/components/incentives/MerklIncentivesTooltipContent.tsx
11311132
#: src/components/MarketSwitcher.tsx
11321133
#: src/components/transactions/DelegationTxsWrapper.tsx
11331134
#: src/components/transactions/DelegationTxsWrapper.tsx

0 commit comments

Comments
 (0)