Skip to content

Commit

Permalink
fix deposit build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
yvesfracari committed Dec 4, 2024
1 parent 17008a3 commit 1e52b8a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion apps/deposit-pool/src/components/PoolItemInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import { formatNumber } from "@bleu.builders/ui";
import type { IPool } from "@bleu/cow-hooks-ui";

export function PoolItemInfo({ pool }: { pool: IPool }) {
if (!pool.dynamicData) return null;
const aprSumPct =
pool.dynamicData.aprItems.reduce((acc, { apr }) => acc + apr, 0) * 100;

return (
<div className="flex text-right items-end flex-col gap-1 text-xs">
<i>TVL: ${formatNumber(pool.dynamicData.totalLiquidity, 2)}</i>
<i>TVL: ${formatNumber(pool.dynamicData?.totalLiquidity || 0, 2)}</i>
<i>APR: {formatNumber(aprSumPct, 2)}%</i>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion apps/deposit-pool/src/utils/math.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function calculateProportionalTokenAmounts({
{
address: pool.address,
totalShares: formatUnits(
BigInt(pool.dynamicData.totalShares.toString()),
BigInt(pool.dynamicData?.totalShares.toString() || "0"),
pool.decimals,
) as `${number}`,
tokens: poolBalances.map((balance) => ({
Expand Down

0 comments on commit 1e52b8a

Please sign in to comment.