-
Notifications
You must be signed in to change notification settings - Fork 191
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: custom slippage improvements for UI and cowswap swapper #5908
Conversation
Current dependencies on/for this PR: This stack of pull requests is managed by Graphite. |
src/components/MultiHopTrade/components/TradeInput/components/TradeQuotes/TradeQuote.tsx
Show resolved
Hide resolved
src/components/MultiHopTrade/components/MultiHopTradeConfirm/components/Hop.tsx
Show resolved
Hide resolved
if (!quote) return | ||
|
||
const isError = | ||
userSlippageDecimal !== undefined && quote.slippageTolerancePercentage !== userSlippageDecimal |
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.
Non-blocking, but can we use a consistent vernacular for both of these? i.e slippageDecimal
or slipperPercentage
(perhaps percentageDecimal
).
Reading this is a bit confusing
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.
Also, can we use a different terminology than error here? While we do display it as an error for users, not being able to set custom slippage is not an actual runtime error, it's part of the flow for swappers that don't support it, so this adds to the confusion
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.
yeah agreed, I've pushed a commit to align things a bit better 8996988
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.
also a88fa6b
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 locally. Conceptual stamp except for one question.
1inch
- Default slippage
- Custom slippage is honored at final quote time
CoW
- Default slippage
- Custom slippage is honored
According to this implementation:
100 indeed is correct as 1% slippage ✅
THOR non-streaming swaps
-
Default slippage
-
Custom slippage
@woodenfurniture the default 1% doesn't seem to be reflected at quote time here, though I believe this is on purpose because of our implementation, as we use limit over slippage? Memo for reference: =:THOR.RUNE:thor125dwsa39yeylqc7pn59l079dur502nsleyrgup:194410385:ss:0
https://viewblock.io/thorchain/tx/c8ceabdf8aad8f680a79c27ee1625942d103c06a17144dc7d09776c3d0ad68bb
Streaming swaps
- Default slippage bps
- Custom slippage
Custom slippage is unable to get set for streaming swaps, and auto bps are used as they should ✅
0a250ea
to
8996988
Compare
correct, we're manually implementing slippage through the limit mechanism here: |
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.
Akschual stamp after q. has been answered.
984b893
to
005adca
Compare
Description
Some types of swappers (thorchain streaming swaps) dont support the ability to specify the slippage when getting a quote, and we need a way to propagate this to users. Other swappers (0x) only provide slippage protection for certain pairs.
This PR implements a UI change that shows users what quotes are affected.
Pull Request Type
Issue (if applicable)
closes #5779
Risk
Testing
Engineering
Carefully check the implementation of custom slippage for cowswap.
Operations
Screenshots (if applicable)
Cowswap default slippage value - see matching payload
Cowswap custom slippage value - see matching payload
Completed cow trade with custom slippage (note bottom right of UI
Video showing slippage UI behaviour
slippage.mov