Skip to content

Commit

Permalink
fix(bex): negative apy
Browse files Browse the repository at this point in the history
  • Loading branch information
bearpong committed Jan 11, 2025
1 parent 9c7b8e0 commit 60babdd
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions apps/hub/src/app/pools/[poolId]/details/PoolPageContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,11 @@ export default function PoolPageContent({ poolId }: { poolId: string }) {
];

// FIXME we should share a function but the way we fetch doesnt align here with PoolsTable
const effectiveApy = useMemo(() => {
return (
Number(v3Pool?.aprItems.at(0)?.apr ?? 0) +
Number(gauge?.dynamicData?.apy ?? 0)
);
}, [v3Pool, gauge]);
const effectiveApy =
Number(v3Pool?.aprItems.at(0)?.apr ?? 0) +
(gauge?.dynamicData?.apy && Number(gauge?.dynamicData?.apy ?? 0) > 0
? Number(gauge?.dynamicData?.apy)
: 0);

if (!isPoolLoading && !pool) {
return notFound();
Expand Down

0 comments on commit 60babdd

Please sign in to comment.