feat: add dynamic high-slippage warning banner with two-tier alert (Closes #111) - #136
Open
waterWang wants to merge 1 commit into
Open
Conversation
…loses Adamantine-guild#111) - Lower SLIPPAGE_WARNING_THRESHOLD from 5% to 2% so users are warned earlier about sandwich-attack risk - Add two-tier warning styling: - Amber/yellow for 2-10%: 'High slippage warning' - Red for >10%: 'Extreme slippage — high risk' - Improve warning text to explain MEV sandwich attack risks and poor execution prices - Add unit tests for the updated constants and thresholds [fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT]
3 tasks
Contributor
|
This PR cannot be merged automatically because it has merge conflicts. Please update the branch with the latest base branch and resolve the conflicts. After the conflicts are resolved and checks pass, the automation can review it again. |
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.
Summary
Adds a dynamic high-slippage warning banner to the slippage settings popover, implementing the requirements from issue #111.
Changes
1. Lowered warning threshold
SLIPPAGE_WARNING_THRESHOLDfrom5to2— users now see a warning when slippage exceeds 2%.2. Two-tier warning styling
High slippage warning— explains MEV sandwich attack risk and poor execution pricesExtreme slippage — high risk— warns of near-total fund loss3. Improved warning text
4. Tests
isSlippageRiskyfunction with the new 2% thresholdAcceptance Criteria Fulfilled