Skip to content

Commit

Permalink
Fix non-weighted pools displaying weight
Browse files Browse the repository at this point in the history
  • Loading branch information
Rawallon committed Sep 21, 2023
1 parent 8508bfd commit 5519524
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apps/balancer-tools/src/app/apr/api/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface PoolTokens {
address: string;
logoSrc: string;
symbol: string;
weight: string | null;
weight: number | null;
balance?: number;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default function PoolTokensTable({
tdClassNames="w-6"
linkClassNames="justify-end w-full"
>{`${(
parseFloat(token.weight) * 100
token.weight * 100
).toFixed()}%`}</Table.BodyCellLink>
)}
{token.balance && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,9 @@ function TableRow({
{tokens.map((token) => (
<Badge color="blue" classNames="w-fit">
{token.symbol}
{token.weight ? (
{PoolTypeEnum[poolType] == PoolTypeEnum.WEIGHTED ? (
<span className="text-xs ml-1 text-slate-400">
{(parseFloat(token.weight) * 100).toFixed()}%
{(token.weight! * 100).toFixed()}%
</span>
) : (
""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function TopPoolsChart({
.map(
(t) =>
`${t.symbol}${
t.weight ? `-${(parseFloat(t.weight) * 100).toFixed()}%` : ""
t.weight ? `-${(t.weight! * 100).toFixed()}%` : ""
}`,
)
.join(" "),
Expand Down

0 comments on commit 5519524

Please sign in to comment.