Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add combined incentives - Merit part [skip cypress] #2325

Merged
merged 14 commits into from
Feb 19, 2025
Merged
12 changes: 6 additions & 6 deletions .github/workflows/build-test-deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:
(github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name &&
!contains(github.head_ref, 'dependabot'))
strategy:
matrix:
build:
- name: 'out'
cypress_enabled: 'false'
- name: 'out_cypress'
cypress_enabled: 'true'
matrix:
build:
- name: 'out'
cypress_enabled: 'false'
- name: 'out_cypress'
cypress_enabled: 'true'
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
- name: 'Dependency Review'
uses: actions/dependency-review-action@v2
with:
fail-on-severity: critical
fail-on-severity: critical
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
Loading