-
Notifications
You must be signed in to change notification settings - Fork 177
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
feat: warn against high price impact at confirm step #5032
feat: warn against high price impact at confirm step #5032
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
src/components/MultiHopTrade/components/TradeConfirm/TradeConfirm.tsx
Outdated
Show resolved
Hide resolved
62bf9cd
to
4c89583
Compare
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.
Tested and working as described, though my only concerns are more from a product perspective.
The price impact percentage constant calculated in this PR includes the buy asset protocol fee in the receive amount, which is unrelated to price impacts caused by illiquid pools.
@shapeshift/product thoughts?
src/components/MultiHopTrade/components/TradeConfirm/TradeConfirm.tsx
Outdated
Show resolved
Hide resolved
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.
See testing notes at the bottom of the stack (#5033).
Description
Now that we have custom slippage under flag, we can implement #4858, since users may input custom slippage up to 30%, effectively having a maximum downside of 30% on the trade itself (excluding fees, which are separate from the trade value and are typically paid in addition to it for most swappers).Disregard this. This is only implemented for price impact (the fiat difference between what you're selling and what you're getting), discusses this one out with @reallybeard and confirmed having slippage under the same umbrella would be all sorts of weird.
Pull Request Type
Issue (if applicable)
closes #4858
Risk
This may show when it shouldn't, test accordingly
Testing
Repeat the above with a favorable trade (e.g ERC-20 -> ERC-20 on Gnosis) and high custom slippage, ensuring the high custom slippage is reflected with a confirmed window, not the price impact downside (which should be very low, closeish to 0)Engineering
Operations
Screenshots (if applicable)
High slippage taking precedence over low price impactHigh price impact taking precedence over low slippageHigh slippage