From 539b5726306fb0845bdd2c5982907c05676c0edc Mon Sep 17 00:00:00 2001 From: MartinGbz Date: Fri, 6 Dec 2024 19:57:01 +0100 Subject: [PATCH 1/3] feat: add new savax merit campaigns --- .../incentives/IncentivesTooltipContent.tsx | 5 +++ src/hooks/useMeritIncentives.ts | 40 ++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/src/components/incentives/IncentivesTooltipContent.tsx b/src/components/incentives/IncentivesTooltipContent.tsx index ce77fc87e5..04032b827d 100644 --- a/src/components/incentives/IncentivesTooltipContent.tsx +++ b/src/components/incentives/IncentivesTooltipContent.tsx @@ -43,6 +43,11 @@ const IncentivesSymbolMap: { symbol: 'aUSDT', aToken: true, }, + aAvaSAVAX: { + tokenIconSymbol: 'sAVAX', + symbol: 'asAVAX', + aToken: true, + }, }; interface IncentivesTooltipContentProps { diff --git a/src/hooks/useMeritIncentives.ts b/src/hooks/useMeritIncentives.ts index 68e77297d7..2c50d45cc8 100644 --- a/src/hooks/useMeritIncentives.ts +++ b/src/hooks/useMeritIncentives.ts @@ -1,6 +1,6 @@ import { ProtocolAction } from '@aave/contract-helpers'; import { ReserveIncentiveResponse } from '@aave/math-utils/dist/esm/formatters/incentive/calculate-reserve-incentives'; -import { AaveV3Base, AaveV3Ethereum } from '@bgd-labs/aave-address-book'; +import { AaveV3Avalanche, AaveV3Base, AaveV3Ethereum } from '@bgd-labs/aave-address-book'; import { useQuery } from '@tanstack/react-query'; import { CustomMarket } from 'src/ui-config/marketsConfig'; @@ -11,6 +11,10 @@ export enum MeritAction { BASE_SUPPLY_CBBTC = 'base-supply-cbbtc', BASE_SUPPLY_USDC = 'base-supply-usdc', BASE_BORROW_USDC = 'base-borrow-usdc', + AVALANCHE_SUPPLY_BTCB = 'avalanche-supply-btcb', + AVALANCHE_SUPPLY_USDC = 'avalanche-supply-usdc', + AVALANCHE_SUPPLY_USDT = 'avalanche-supply-usdt', + AVALANCHE_SUPPLY_SAVAX = 'avalanche-supply-savax', } type MeritIncentives = { @@ -105,6 +109,40 @@ const MERIT_DATA_MAP: Record }, ], }, + [CustomMarket.proto_avalanche_v3]: { + ['BTC.b']: [ + { + action: MeritAction.AVALANCHE_SUPPLY_BTCB, + rewardTokenAddress: AaveV3Avalanche.ASSETS.BTCb.A_TOKEN, + rewardTokenSymbol: 'aAvaSAVAX', + protocolAction: ProtocolAction.supply, + }, + ], + USDC: [ + { + action: MeritAction.AVALANCHE_SUPPLY_USDC, + rewardTokenAddress: AaveV3Avalanche.ASSETS.USDC.A_TOKEN, + rewardTokenSymbol: 'aAvaSAVAX', + protocolAction: ProtocolAction.supply, + }, + ], + USDt: [ + { + action: MeritAction.AVALANCHE_SUPPLY_USDT, + rewardTokenAddress: AaveV3Avalanche.ASSETS.USDt.A_TOKEN, + rewardTokenSymbol: 'aAvaSAVAX', + protocolAction: ProtocolAction.supply, + }, + ], + sAVAX: [ + { + action: MeritAction.AVALANCHE_SUPPLY_SAVAX, + rewardTokenAddress: AaveV3Avalanche.ASSETS.sAVAX.A_TOKEN, + rewardTokenSymbol: 'aAvaSAVAX', + protocolAction: ProtocolAction.supply, + }, + ], + }, }; export const useMeritIncentives = ({ From e16dfe791897da4f438d1d00d8242f71a48e39dc Mon Sep 17 00:00:00 2001 From: MartinGbz Date: Fri, 6 Dec 2024 19:58:00 +0100 Subject: [PATCH 2/3] feat: mock api return --- src/hooks/useMeritIncentives.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hooks/useMeritIncentives.ts b/src/hooks/useMeritIncentives.ts index 2c50d45cc8..e79ac6ba7c 100644 --- a/src/hooks/useMeritIncentives.ts +++ b/src/hooks/useMeritIncentives.ts @@ -160,6 +160,11 @@ export const useMeritIncentives = ({ const data = await response.json(); const meritIncentives = data.currentAPR as MeritIncentives; + meritIncentives.actionsAPR['avalanche-supply-btcb'] = 1; + meritIncentives.actionsAPR['avalanche-supply-usdc'] = 2; + meritIncentives.actionsAPR['avalanche-supply-usdt'] = 3; + meritIncentives.actionsAPR['avalanche-supply-savax'] = 4; + return meritIncentives; }, queryKey: ['meritIncentives'], From bda6ecf422dfaff3cdba3ec10eca9f8b9eb3f772 Mon Sep 17 00:00:00 2001 From: MartinGbz Date: Sat, 7 Dec 2024 02:35:23 +0100 Subject: [PATCH 3/3] fix: remove api mock --- src/hooks/useMeritIncentives.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/hooks/useMeritIncentives.ts b/src/hooks/useMeritIncentives.ts index e79ac6ba7c..2c50d45cc8 100644 --- a/src/hooks/useMeritIncentives.ts +++ b/src/hooks/useMeritIncentives.ts @@ -160,11 +160,6 @@ export const useMeritIncentives = ({ const data = await response.json(); const meritIncentives = data.currentAPR as MeritIncentives; - meritIncentives.actionsAPR['avalanche-supply-btcb'] = 1; - meritIncentives.actionsAPR['avalanche-supply-usdc'] = 2; - meritIncentives.actionsAPR['avalanche-supply-usdt'] = 3; - meritIncentives.actionsAPR['avalanche-supply-savax'] = 4; - return meritIncentives; }, queryKey: ['meritIncentives'],