Skip to content

Commit 84f214c

Browse files
committed
Merge branch 'main' into chore/banner-swap-update
2 parents 14b7d54 + 3c11748 commit 84f214c

File tree

14 files changed

+101
-47
lines changed

14 files changed

+101
-47
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
"test:coverage": "jest --coverage"
3232
},
3333
"dependencies": {
34-
"@aave/contract-helpers": "1.36.0",
35-
"@aave/math-utils": "1.36.0",
34+
"@aave/contract-helpers": "1.36.1",
35+
"@aave/math-utils": "1.36.1",
3636
"@amplitude/analytics-browser": "^2.13.0",
3737
"@bgd-labs/aave-address-book": "^4.25.1",
3838
"@cowprotocol/app-data": "^3.1.0",

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/helpers/useGovernanceDelegate.tsx

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -252,13 +252,8 @@ export const useGovernanceDelegate = (
252252

253253
const unsignedPayloads: string[] = [];
254254
for (const tx of delegationParameters) {
255-
if (delegationType !== DelegationType.ALL) {
256-
const payload = await delegationTokenService.prepareV3DelegateByTypeSignature(tx);
257-
unsignedPayloads.push(payload);
258-
} else {
259-
const payload = await delegationTokenService.prepareV3DelegateByTypeSignature(tx);
260-
unsignedPayloads.push(payload);
261-
}
255+
const payload = await delegationTokenService.prepareV3DelegateByTypeSignature(tx);
256+
unsignedPayloads.push(payload);
262257
}
263258
try {
264259
const signedPayload: SignatureLike[] = [];
@@ -303,7 +298,6 @@ export const useGovernanceDelegate = (
303298
} else {
304299
let txs: EthereumTransactionTypeExtended[] = [];
305300
if (delegationType === DelegationType.ALL) {
306-
// TODO check if this is working as normal
307301
txs = await delegate({
308302
delegatee,
309303
governanceToken:
@@ -312,13 +306,8 @@ export const useGovernanceDelegate = (
312306
: delegationTokenType === DelegationTokenType.STKAAVE
313307
? governanceV3Config.votingAssets.stkAaveTokenAddress
314308
: governanceV3Config.votingAssets.aAaveTokenAddress,
315-
// delegationTokenType === DelegationTokenType.AAVE
316-
// ? governanceConfig.aaveTokenAddress
317-
// : governanceConfig.stkAaveTokenAddress,
318309
});
319310
} else {
320-
// TODO check if this is working as normal
321-
322311
txs = await delegateByType({
323312
delegatee,
324313
delegationType: delegationType.toString(),
@@ -328,9 +317,6 @@ export const useGovernanceDelegate = (
328317
: delegationTokenType === DelegationTokenType.STKAAVE
329318
? governanceV3Config.votingAssets.stkAaveTokenAddress
330319
: governanceV3Config.votingAssets.aAaveTokenAddress,
331-
// delegationTokenType === DelegationTokenType.AAVE
332-
// ? governanceConfig.aaveTokenAddress
333-
// : governanceConfig.stkAaveTokenAddress,
334320
});
335321
}
336322
setActionTx(txs[0]);

src/hooks/paraswap/useCollateralRepaySwap.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,7 @@ export const useCollateralRepaySwap = ({
127127
} catch (e) {
128128
console.error(e);
129129
const message =
130-
convertParaswapErrorMessage(e.message) ||
131-
'There was an issue fetching data from Velora';
130+
convertParaswapErrorMessage(e.message) || 'There was an issue fetching data from Velora';
132131
setError(message);
133132
} finally {
134133
setLoading(false);

src/hooks/paraswap/useCollateralSwap.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ export const useCollateralSwap = ({
108108
} catch (e) {
109109
console.error(e);
110110
const message =
111-
convertParaswapErrorMessage(e.message) ||
112-
'There was an issue fetching data from Velora';
111+
convertParaswapErrorMessage(e.message) || 'There was an issue fetching data from Velora';
113112
setError(message);
114113
} finally {
115114
setLoading(false);

src/hooks/paraswap/useDebtSwitch.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ export const useDebtSwitch = ({
111111
} catch (e) {
112112
console.error(e);
113113
const message =
114-
convertParaswapErrorMessage(e.message) ||
115-
'There was an issue fetching data from Velora';
114+
convertParaswapErrorMessage(e.message) || 'There was an issue fetching data from Velora';
116115
setError(message);
117116
} finally {
118117
setLoading(false);

src/hooks/useEthenaIncentives.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const getEthenaData = (assetAddress: string): number | undefined =>
44
ETHENA_DATA_MAP.get(assetAddress);
55

66
const ETHENA_DATA_MAP: Map<string, number> = new Map([
7-
[AaveV3Ethereum.ASSETS.USDe.A_TOKEN, 25],
7+
[AaveV3Ethereum.ASSETS.USDe.A_TOKEN, 5],
88
[AaveV3Ethereum.ASSETS.sUSDe.A_TOKEN, 5],
99
[AaveV3EthereumLido.ASSETS.sUSDe.A_TOKEN, 5],
1010
[AaveV3Ethereum.ASSETS.GHO.V_TOKEN, 5],

src/hooks/useMeritIncentives.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export enum MeritAction {
4848
AVALANCHE_SUPPLY_USDT = 'avalanche-supply-usdt',
4949
AVALANCHE_SUPPLY_SAVAX = 'avalanche-supply-savax',
5050
AVALANCHE_SUPPLY_AUSD = 'avalanche-supply-ausd',
51+
AVALANCHE_SUPPLY_GHO = 'avalanche-supply-gho',
5152
SONIC_SUPPLY_USDCE = 'sonic-supply-usdce',
5253
SONIC_SUPPLY_STS_BORROW_WS = 'sonic-supply-sts-borrow-ws',
5354
GNOSIS_BORROW_EURE = 'gnosis-borrow-eure',
@@ -516,6 +517,15 @@ const MERIT_DATA_MAP: Record<string, Record<string, MeritReserveIncentiveData[]>
516517
customForumLink: AusdRenewalForumLink,
517518
},
518519
],
520+
GHO: [
521+
{
522+
action: MeritAction.AVALANCHE_SUPPLY_GHO,
523+
rewardTokenAddress: AaveV3Avalanche.ASSETS.GHO.A_TOKEN,
524+
rewardTokenSymbol: 'aAvaSAVAX',
525+
protocolAction: ProtocolAction.supply,
526+
customMessage: antiLoopMessage,
527+
},
528+
],
519529
},
520530
[CustomMarket.proto_sonic_v3]: {
521531
['USDC']: [

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
});

0 commit comments

Comments
 (0)