Skip to content

Commit ecca11d

Browse files
authored
fix: Affiliate values (dydxprotocol#2025)
1 parent 914f345 commit ecca11d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/views/Affiliates/cards/AffiliateProgressCard.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ export const AffiliateProgressCard = ({
1414
}) => {
1515
const stringGetter = useStringGetter();
1616

17-
const progressRatio = volume / AFFILIATES_REQUIRED_VOLUME_USD;
18-
const remaining = AFFILIATES_REQUIRED_VOLUME_USD - volume;
17+
const progressRatio = Math.min(1, volume / AFFILIATES_REQUIRED_VOLUME_USD);
18+
const remaining = Math.max(0, AFFILIATES_REQUIRED_VOLUME_USD - volume);
19+
1920
return (
2021
<div className={className} tw="flex flex-col gap-1.5 rounded-1 p-1">
2122
<div tw="flex items-center justify-between gap-0.5">

0 commit comments

Comments
 (0)