Skip to content

Commit

Permalink
feat(staking): include warmup token in pool utilization (#1931)
Browse files Browse the repository at this point in the history
  • Loading branch information
keyvankhademi authored Sep 18, 2024
1 parent 4709e7d commit 8baf597
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions apps/staking/src/components/OracleIntegrityStaking/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,8 @@ const doSort = (
}
case SortField.PoolUtilization: {
const value = Number(
a.poolUtilization * b.poolCapacity - b.poolUtilization * a.poolCapacity,
(a.poolUtilization + a.poolUtilizationDelta) * b.poolCapacity -
(b.poolUtilization + b.poolUtilizationDelta) * a.poolCapacity,
);
return value === 0 ? Number(a.poolCapacity - b.poolCapacity) : value;
}
Expand Down Expand Up @@ -935,9 +936,17 @@ const Publisher = ({
const utilizationPercent = useMemo(
() =>
publisher.poolCapacity > 0n
? Number((100n * publisher.poolUtilization) / publisher.poolCapacity)
? Number(
(100n *
(publisher.poolUtilization + publisher.poolUtilizationDelta)) /
publisher.poolCapacity,
)
: Number.NaN,
[publisher.poolUtilization, publisher.poolCapacity],
[
publisher.poolUtilization,
publisher.poolUtilizationDelta,
publisher.poolCapacity,
],
);

return (
Expand Down Expand Up @@ -979,7 +988,10 @@ const Publisher = ({
</div>
<Label className="mt-1 flex flex-row items-center justify-center gap-1 text-sm">
<span>
<Tokens>{publisher.poolUtilization}</Tokens>
<Tokens>
{publisher.poolUtilization +
publisher.poolUtilizationDelta}
</Tokens>
</span>
<span>/</span>
<span>
Expand Down

0 comments on commit 8baf597

Please sign in to comment.