Skip to content

Commit

Permalink
fix: etherfi points
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinGbz committed Mar 6, 2025
1 parent 92d5cd5 commit b96fb73
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 4 deletions.
File renamed without changes
22 changes: 19 additions & 3 deletions src/components/incentives/IncentivesButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { SuperFestTooltip } from '../infoTooltips/SuperFestTooltip';
import { FormattedNumber } from '../primitives/FormattedNumber';
import { TokenIcon } from '../primitives/TokenIcon';
import { EthenaAirdropTooltipContent } from './EthenaIncentivesTooltipContent';
import { EtherFiAirdropTooltipContent } from './EtherfiIncentivesTooltipContent';
import { getSymbolMap, IncentivesTooltipContent } from './IncentivesTooltipContent';
import { MeritIncentivesTooltipContent } from './MeritIncentivesTooltipContent';
import { SonicAirdropTooltipContent } from './SonicIncentivesTooltipContent';
Expand Down Expand Up @@ -129,7 +130,7 @@ export const PointsIncentiveButton = (params: { market: string; rewardedAsset?:
setOpen={setOpen}
open={open}
>
<ContentButton
<ContentPoints
value={pointsIncentivesTooltips.ethenaPoints}
iconSrc={'/icons/other/ethena.svg'}
/>
Expand All @@ -144,12 +145,27 @@ export const PointsIncentiveButton = (params: { market: string; rewardedAsset?:
setOpen={setOpen}
open={open}
>
<ContentButton
<ContentPoints
value={pointsIncentivesTooltips.sonicPoints}
iconSrc={'/icons/networks/sonic.svg'}
/>
</ContentWithTooltip>
)}
{pointsIncentivesTooltips.etherfiPoints && (
<ContentWithTooltip
tooltipContent={
<EtherFiAirdropTooltipContent multiplier={pointsIncentivesTooltips.etherfiPoints} />
}
withoutHover
setOpen={setOpen}
open={open}
>
<ContentPoints
value={pointsIncentivesTooltips.etherfiPoints}
iconSrc={'/icons/other/etherfi.svg'}
/>
</ContentWithTooltip>
)}
</>
);
};
Expand Down Expand Up @@ -334,7 +350,7 @@ export const Content = ({
);
};

const ContentButton = ({ value, iconSrc }: { value: number; iconSrc: string }) => {
const ContentPoints = ({ value, iconSrc }: { value: number; iconSrc: string }) => {
const [open, setOpen] = useState(false);
const trackEvent = useRootStore((store) => store.trackEvent);

Expand Down
26 changes: 25 additions & 1 deletion src/hooks/usePointsIncentives.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
import { AaveV3Ethereum, AaveV3EthereumLido } from '@bgd-labs/aave-address-book';
import {
AaveV3Arbitrum,
AaveV3Base,
AaveV3Ethereum,
AaveV3EthereumEtherFi,
AaveV3EthereumLido,
AaveV3Linea,
AaveV3Scroll,
AaveV3ZkSync,
} from '@bgd-labs/aave-address-book';
import { CustomMarket } from 'src/ui-config/marketsConfig';

const SONIC_DATA_MAP: Map<string, number> = new Map([
Expand All @@ -15,9 +24,21 @@ const ETHENA_DATA_MAP: Map<string, number> = new Map([
[`${CustomMarket.proto_lido_v3}-${AaveV3EthereumLido.ASSETS.GHO.V_TOKEN}`, 5],
]);

const ETHERFI_DATA_MAP: Map<string, number> = new Map([
[`${CustomMarket.proto_mainnet_v3}-${AaveV3Ethereum.ASSETS.weETH.A_TOKEN}`, 3],
[`${CustomMarket.proto_etherfi_v3}-${AaveV3EthereumEtherFi.ASSETS.weETH.A_TOKEN}`, 3],
// [`${CustomMarket.proto_lido_v3}-${AaveV3EthereumLido.ASSETS.weETH.A_TOKEN}`, 3],
[`${CustomMarket.proto_arbitrum_v3}-${AaveV3Arbitrum.ASSETS.weETH.A_TOKEN}`, 3],
[`${CustomMarket.proto_base_v3}-${AaveV3Base.ASSETS.weETH.A_TOKEN}`, 3],
[`${CustomMarket.proto_scroll_v3}-${AaveV3Scroll.ASSETS.weETH.A_TOKEN}`, 3],
[`${CustomMarket.proto_zksync_v3}-${AaveV3ZkSync.ASSETS.weETH.A_TOKEN}`, 3],
[`${CustomMarket.proto_linea_v3}-${AaveV3Linea.ASSETS.weETH.A_TOKEN}`, 3],
]);

export type PointsIncentivesTooltipsConfig = {
ethenaPoints: number | undefined;
sonicPoints: number | undefined;
etherfiPoints: number | undefined;
};

export const usePointsIncentives = ({
Expand All @@ -31,17 +52,20 @@ export const usePointsIncentives = ({
return {
ethenaPoints: undefined,
sonicPoints: undefined,
etherfiPoints: undefined,
} as PointsIncentivesTooltipsConfig;
}

const ethenaPointsEnabled = true;
const sonicPointsEnabled = true;
const etherfiPointsEnabled = true;

const key = `${market}-${rewardedAsset}`;

const tooltipsConfig: PointsIncentivesTooltipsConfig = {
ethenaPoints: ethenaPointsEnabled ? ETHENA_DATA_MAP.get(key) : undefined,
sonicPoints: sonicPointsEnabled ? SONIC_DATA_MAP.get(key) : undefined,
etherfiPoints: etherfiPointsEnabled ? ETHERFI_DATA_MAP.get(key) : undefined,
};

return tooltipsConfig;
Expand Down

0 comments on commit b96fb73

Please sign in to comment.