Skip to content

Commit

Permalink
fix: chore fix
Browse files Browse the repository at this point in the history
  • Loading branch information
damnnou committed Mar 14, 2024
1 parent f3c361a commit b2e4c7f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/farming/ActiveFarming/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const ActiveFarming = ({
});

const bonusRewardEarnedUSD = useRewardEarnedUSD({
token: farming.rewardToken,
token: farming.bonusRewardToken,
reward: bonusRewardEarned,
});

Expand Down
2 changes: 1 addition & 1 deletion src/components/position/ActiveFarmingCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const ActiveFarmingCard = ({
});

const bonusRewardEarnedUSD = useRewardEarnedUSD({
token: farming.rewardToken,
token: farming.bonusRewardToken,
reward: bonusRewardEarned,
});

Expand Down
6 changes: 3 additions & 3 deletions src/hooks/farming/useRewardEarnedUSD.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ export function useRewardEarnedUSD({
token,
reward,
}: {
token: TokenFieldsFragment;
token: TokenFieldsFragment | null;
reward: bigint;
}): number {
const { data: nativePrice } = useNativePriceQuery();

return useMemo(() => {
const formattedRewardEarned = Number(
formatUnits(reward, token.decimals)
formatUnits(reward, token?.decimals)
);

const rewardUSD =
token.derivedMatic *
token?.derivedMatic *
formattedRewardEarned *
nativePrice?.bundles[0].maticPriceUSD;

Expand Down

0 comments on commit b2e4c7f

Please sign in to comment.