Skip to content

Commit

Permalink
fix(trading): required vol shown if current is zero (#5449)
Browse files Browse the repository at this point in the history
  • Loading branch information
MadalinaRaicu authored Dec 5, 2023
1 parent 51ab02a commit eb81f4a
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions apps/trading/components/fees-container/fees-container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -312,16 +312,23 @@ export const CurrentVolume = ({
}) => {
const nextTier = tiers[tierIndex + 1];
const requiredForNextTier = nextTier
? Number(nextTier.minimumRunningNotionalTakerVolume) - windowLengthVolume
: 0;
? new BigNumber(nextTier.minimumRunningNotionalTakerVolume).minus(
windowLengthVolume
)
: new BigNumber(0);
const currentVolume = new BigNumber(windowLengthVolume);

return (
<div>
<Stat
value={formatNumberRounded(new BigNumber(windowLengthVolume))}
value={
currentVolume.isZero()
? `<${formatNumberRounded(requiredForNextTier)}`
: formatNumberRounded(currentVolume)
}
text={t('Past %s epochs', windowLength.toString())}
/>
{requiredForNextTier > 0 && (
{requiredForNextTier.isGreaterThan(0) && (
<Stat
value={formatNumber(requiredForNextTier)}
text={t('Required for next tier')}
Expand Down

0 comments on commit eb81f4a

Please sign in to comment.