Skip to content

Commit

Permalink
Merge pull request #3233 from OlympusDAO/RBSCapacity
Browse files Browse the repository at this point in the history
if wall is inactive set capacity to 0
  • Loading branch information
brightiron authored Nov 19, 2024
2 parents cf91d13 + e54f9b6 commit 23c3f98
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/views/Range/RangeChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ const RangeChart = (props: {
<DataRow title="Wall" balance={formatCurrency(lowerWall, 2, reserveSymbol)} />
<DataRow
title="Capacity"
balance={`${capacityFormatter.format(parseBigNumber(rangeData.low.capacity, 18))} ${reserveSymbol} `}
balance={`${
rangeData.low.active ? capacityFormatter.format(parseBigNumber(rangeData.low.capacity, 18)) : 0
} ${reserveSymbol} `}
/>
<Typography fontSize="15px" fontWeight={600} mt="33px">
Upper Range
Expand All @@ -132,7 +134,9 @@ const RangeChart = (props: {
<DataRow title="Wall" balance={formatCurrency(upperWall, 2, reserveSymbol)} />
<DataRow
title="Capacity"
balance={`${capacityFormatter.format(parseBigNumber(rangeData.high.capacity, 9))} OHM`}
balance={`${
rangeData.high.active ? capacityFormatter.format(parseBigNumber(rangeData.high.capacity, 9)) : 0
} OHM`}
/>
{label === "now" && (
<>
Expand Down
8 changes: 7 additions & 1 deletion src/views/Range/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,13 @@ export const Range = () => {
? parseBigNumber(upperMaxPayout, 9)
: parseBigNumber(rangeData.high.capacity, 9);

const maxCapacity = sellActive ? lowerMaxCapacity : upperMaxCapacity;
const maxCapacity = sellActive
? rangeData.low.active
? lowerMaxCapacity
: 0
: rangeData.high.active
? upperMaxCapacity
: 0;

useEffect(() => {
if (reserveAmount && ohmAmount) {
Expand Down

0 comments on commit 23c3f98

Please sign in to comment.