-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce the default slippage from 3% to 2% #14863
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
shared/constants/swaps.js
Outdated
@@ -206,3 +206,5 @@ export const TOKEN_BUCKET_PRIORITY = { | |||
OWNED: 'owned', | |||
TOP: 'top', | |||
}; | |||
|
|||
export const DEFAULT_SLIPPAGE = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay!
@@ -40,16 +41,16 @@ export default function SlippageButtons({ | |||
const [enteringCustomValue, setEnteringCustomValue] = useState(false); | |||
const [activeButtonIndex, setActiveButtonIndex] = useState(() => { | |||
if (currentSlippage === 3) { | |||
return 1; | |||
return 1; // 3% slippage. | |||
} else if (currentSlippage === 2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way we can use the constant in this?
}} | ||
> | ||
2% | ||
{`${SLIPPAGE.DEFAULT}%`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we localize this? It seems like in persian and turkish the percentage sign comes first.
currentSlippage !== SLIPPAGE.DEFAULT && | ||
currentSlippage !== SLIPPAGE.HIGH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit]
currentSlippage !== SLIPPAGE.DEFAULT && | |
currentSlippage !== SLIPPAGE.HIGH | |
!Object.values(SLIPPAGE).includes(currentSlippage) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohhh, I like this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nit otherwise LGTM!
Explanation
Reduce the default slippage from 3% to 2%.
Screenshots
Before:
After: