Conversation
Adds a toggleable "Aave Shield" feature that blocks swap operations when price impact exceeds 25%. Enabled by default, persisted in localStorage, and accessible from the settings menu on both desktop and mobile. When Shield blocks a swap, the action button shows "Blocked by Shield" and an error banner explains the reason and how to disable it. Covers all 5 swap types: Swap, CollateralSwap, DebtSwap, RepayWithCollateral, and WithdrawAndSwap (both Paraswap and CoW Protocol providers).
Limit orders are off-chain intents that only execute at the user's specified price, so price impact is not meaningful. Also guard against empty/zero USD amounts that could falsely trigger the shield.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The loading issue was caused by empty/zero USD amounts falsely triggering 100% price impact. The zero-amount guard fixes this for both market and limit orders without needing to exclude limits.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c171fa5424
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
src/components/transactions/Swap/warnings/postInputs/ShieldSwapWarning.tsx
Show resolved
Hide resolved
|
📦 Next.js Bundle Analysis for aave-uiThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
Capture the new shield state before calling toggleShield() so the analytics event doesn't depend on closure timing. Also fix the zero-amount guard: a quote returning buyAmountUSD=0 with nonzero sell is a real scenario (total value loss from fees), not missing data. Only skip when sell amount is unpopulated.
|
📦 Next.js Bundle Analysis for aave-uiThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
…tages Show error (red) instead of warning (yellow) when price impact exceeds 30%. Bold the percentage values in both warning and confirmation text for better visibility.
|
📦 Next.js Bundle Analysis for aave-uiThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
|
Codex Review: Didn't find any major issues. Swish! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Reword the warning, confirmation checkbox, and add a "review before confirming" line to make the risk clearer to users.
|
📦 Next.js Bundle Analysis for aave-uiThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
Summary