fix(swap): review large trade costs and verify split settlement - #460
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and behavior
A large swap could show an optimistic minimum and a green “Done” while a streaming protocol had paid only its first outbound leg. The saved quote could also be presented as the received amount. For example, THORChain inbound
0x5c3b317f…c4170paid 2.16728726 Base ETH first and 1.55006707 Base ETH later; the first payout alone was below the 3.61863598 ETH memo minimum.This change shows the transaction memo minimum when available, keeps quoted and received amounts separate, and lists each protocol payout. THORChain and Maya completion now requires settlement evidence; a payout total below the minimum remains in progress. Legacy completed records without payout evidence show “verifying” until refreshed. The review screen also visualizes quoted cost, extra slippage allowance, and minimum retained value.
For input trades worth at least $1,000, the swap UI warns at 0.5% expected loss, requires acknowledgment at 1% expected loss or 2% loss at minimum receive, and blocks a route at 5% expected loss. The threshold uses the input’s USD value. Unknown market prices are labeled and require acknowledgment. Smaller trades retain lighter fee warnings. Quotes for large or unknown-value trades refresh after 30 seconds before signing. The parser evaluates all buildable Pioneer routes and chooses the greatest quoted destination output.
Validation
developworktree.git diff --checkpasses.Review limits