Skip to content

Commit

Permalink
feat: add combined incentives - Merit part [skip cypress] (#2325)
Browse files Browse the repository at this point in the history
  • Loading branch information
NandyBa authored Feb 19, 2025
1 parent a1ab68b commit 4f4fe06
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 3 deletions.
1 change: 1 addition & 0 deletions public/icons/tokens/rez.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions src/components/incentives/IncentivesTooltipContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@ const IncentivesSymbolMap: {
symbol: 'aPYUSD',
aToken: true,
},
aArbWETH: {
tokenIconSymbol: 'WETH',
symbol: 'aWETH',
aToken: true,
},
aArbwstETH: {
tokenIconSymbol: 'wstETH',
symbol: 'awstETH',
aToken: true,
},
aBaswstETH: {
tokenIconSymbol: 'wstETH',
symbol: 'awstETH',
aToken: true,
},
aAvaSAVAX: {
tokenIconSymbol: 'sAVAX',
symbol: 'asAVAX',
Expand Down
117 changes: 114 additions & 3 deletions src/hooks/useMeritIncentives.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
import { ProtocolAction } from '@aave/contract-helpers';
import { ReserveIncentiveResponse } from '@aave/math-utils/dist/esm/formatters/incentive/calculate-reserve-incentives';
import { AaveV3Avalanche, AaveV3Base, AaveV3Ethereum } from '@bgd-labs/aave-address-book';
import {
AaveV3Arbitrum,
AaveV3Avalanche,
AaveV3Base,
AaveV3Ethereum,
AaveV3EthereumLido,
} from '@bgd-labs/aave-address-book';
import { useQuery } from '@tanstack/react-query';
import { CustomMarket } from 'src/ui-config/marketsConfig';

export enum MeritAction {
ETHEREUM_STKGHO = 'ethereum-stkgho',
ETHEREUM_SUPPLY_PYUSD = 'ethereum-supply-pyusd',
ETHEREUM_SUPPLY_ETHX = 'ethereum-supply-ethx',
ETHEREUM_PRIME_SUPPLY_ETH = 'ethereum-prime-supply-weth',
ETHEREUM_PRIME_SUPPLY_EZETH = 'ethereum-prime-supply-ezeth',
SUPPLY_CBBTC_BORROW_USDC = 'ethereum-supply-cbbtc-borrow-usdc',
SUPPLY_WBTC_BORROW_USDT = 'ethereum-supply-wbtc-borrow-usdt',
ARBITRUM_SUPPLY_ETH = 'arbitrum-supply-weth',
ARBITRUM_SUPPLY_WSTETH = 'arbitrum-supply-wsteth',
ARBITRUM_SUPPLY_EZETH = 'arbitrum-supply-ezeth',
BASE_SUPPLY_CBBTC = 'base-supply-cbbtc',
BASE_SUPPLY_USDC = 'base-supply-usdc',
BASE_SUPPLY_WSTETH = 'base-supply-wsteth',
BASE_SUPPLY_EZETH = 'base-supply-ezeth',
BASE_BORROW_USDC = 'base-borrow-usdc',
AVALANCHE_SUPPLY_BTCB = 'avalanche-supply-btcb',
AVALANCHE_SUPPLY_USDC = 'avalanche-supply-usdc',
Expand Down Expand Up @@ -44,6 +57,11 @@ export type MeritReserveIncentiveData = Omit<ReserveIncentiveResponse, 'incentiv
const getMeritData = (market: string, symbol: string): MeritReserveIncentiveData[] | undefined =>
MERIT_DATA_MAP[market]?.[symbol];

const antiLoopMessage =
'Borrowing of some assets may impact the amount of rewards you are eligible for. Please check the forum post for the full eligibility criteria.';
const joinedEthCorrelatedIncentiveForumLink =
'https://governance.aave.com/t/arfc-set-aci-as-emission-manager-for-liquidity-mining-programs/17898/56';

const MERIT_DATA_MAP: Record<string, Record<string, MeritReserveIncentiveData[]>> = {
[CustomMarket.proto_mainnet_v3]: {
GHO: [
Expand Down Expand Up @@ -99,8 +117,7 @@ const MERIT_DATA_MAP: Record<string, Record<string, MeritReserveIncentiveData[]>
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.',
customMessage: antiLoopMessage,
},
],
ETHx: [
Expand All @@ -112,6 +129,80 @@ const MERIT_DATA_MAP: Record<string, Record<string, MeritReserveIncentiveData[]>
},
],
},
[CustomMarket.proto_lido_v3]: {
ETH: [
{
action: MeritAction.ETHEREUM_PRIME_SUPPLY_ETH,
rewardTokenAddress: AaveV3EthereumLido.ASSETS.WETH.A_TOKEN,
rewardTokenSymbol: 'aEthLidoWETH',
protocolAction: ProtocolAction.supply,
customMessage: antiLoopMessage,
customForumLink: joinedEthCorrelatedIncentiveForumLink,
},
],
WETH: [
{
action: MeritAction.ETHEREUM_PRIME_SUPPLY_ETH,
rewardTokenAddress: AaveV3EthereumLido.ASSETS.WETH.A_TOKEN,
rewardTokenSymbol: 'aEthLidoWETH',
protocolAction: ProtocolAction.supply,
customMessage: antiLoopMessage,
customForumLink: joinedEthCorrelatedIncentiveForumLink,
},
],
ezETH: [
{
action: MeritAction.ETHEREUM_PRIME_SUPPLY_EZETH,
rewardTokenAddress: '0x3B50805453023a91a8bf641e279401a0b23FA6F9', // Renzo (REZ)
rewardTokenSymbol: 'REZ',
protocolAction: ProtocolAction.supply,
customMessage: antiLoopMessage,
customForumLink: joinedEthCorrelatedIncentiveForumLink,
},
],
},
[CustomMarket.proto_arbitrum_v3]: {
ETH: [
{
action: MeritAction.ARBITRUM_SUPPLY_ETH,
rewardTokenAddress: AaveV3Arbitrum.ASSETS.WETH.A_TOKEN,
rewardTokenSymbol: 'aArbWETH',
protocolAction: ProtocolAction.supply,
customMessage: antiLoopMessage,
customForumLink: joinedEthCorrelatedIncentiveForumLink,
},
],
WETH: [
{
action: MeritAction.ARBITRUM_SUPPLY_ETH,
rewardTokenAddress: AaveV3Arbitrum.ASSETS.WETH.A_TOKEN,
rewardTokenSymbol: 'aArbWETH',
protocolAction: ProtocolAction.supply,
customMessage: antiLoopMessage,
customForumLink: joinedEthCorrelatedIncentiveForumLink,
},
],
wstETH: [
{
action: MeritAction.ARBITRUM_SUPPLY_WSTETH,
rewardTokenAddress: AaveV3Ethereum.ASSETS.wstETH.UNDERLYING,
rewardTokenSymbol: 'aArbwstETH',
protocolAction: ProtocolAction.supply,
customMessage: antiLoopMessage,
customForumLink: joinedEthCorrelatedIncentiveForumLink,
},
],
ezETH: [
{
action: MeritAction.ARBITRUM_SUPPLY_EZETH,
rewardTokenAddress: '0x3B50805453023a91a8bf641e279401a0b23FA6F9', // Renzo (REZ)
rewardTokenSymbol: 'REZ',
protocolAction: ProtocolAction.supply,
customMessage: antiLoopMessage,
customForumLink: joinedEthCorrelatedIncentiveForumLink,
},
],
},
[CustomMarket.proto_base_v3]: {
cbBTC: [
{
Expand All @@ -135,6 +226,26 @@ const MERIT_DATA_MAP: Record<string, Record<string, MeritReserveIncentiveData[]>
protocolAction: ProtocolAction.borrow,
},
],
wstETH: [
{
action: MeritAction.BASE_SUPPLY_WSTETH,
rewardTokenAddress: AaveV3Base.ASSETS.wstETH.UNDERLYING,
rewardTokenSymbol: 'aBaswstETH',
protocolAction: ProtocolAction.supply,
customMessage: antiLoopMessage,
customForumLink: joinedEthCorrelatedIncentiveForumLink,
},
],
ezETH: [
{
action: MeritAction.BASE_SUPPLY_EZETH,
rewardTokenAddress: '0x3B50805453023a91a8bf641e279401a0b23FA6F9', // Renzo (REZ)
rewardTokenSymbol: 'REZ',
protocolAction: ProtocolAction.supply,
customMessage: antiLoopMessage,
customForumLink: joinedEthCorrelatedIncentiveForumLink,
},
],
},
[CustomMarket.proto_avalanche_v3]: {
['BTC.b']: [
Expand Down

1 comment on commit 4f4fe06

@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.