Skip to content

feat: Aave Shield#2900

Open
mgrabina wants to merge 6 commits intomainfrom
feat/aave-shield
Open

feat: Aave Shield#2900
mgrabina wants to merge 6 commits intomainfrom
feat/aave-shield

Conversation

@mgrabina
Copy link
Contributor

@mgrabina mgrabina commented Mar 13, 2026

Summary

  • Adds "Aave Shield", a toggleable protection that blocks swap operations when price impact exceeds 25%
  • Enabled by default, user preference persisted in localStorage
  • Toggle accessible from the settings gear menu (desktop and mobile)
  • When Shield blocks a swap, the submit button shows "Blocked by Shield" and an error banner explains the threshold and how to disable it
  • Covers all 5 swap types (Swap, CollateralSwap, DebtSwap, RepayWithCollateral, WithdrawAndSwap) across both Paraswap and CoW Protocol providers, including both market and limit orders
Screenshot 2026-03-13 at 10 33 15 AM Screenshot 2026-03-13 at 10 33 30 AM Screenshot 2026-03-13 at 10 33 47 AM Screenshot 2026-03-13 at 11 05 29 AM

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.
@vercel
Copy link

vercel bot commented Mar 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
interface Ready Ready Preview, Comment Mar 13, 2026 4:18pm

Request Review

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.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@github-actions
Copy link

@github-actions
Copy link

📦 Next.js Bundle Analysis for aave-ui

This 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.
@github-actions
Copy link

@github-actions
Copy link

📦 Next.js Bundle Analysis for aave-ui

This 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.
@mgrabina
Copy link
Contributor Author

@codex

@github-actions
Copy link

@github-actions
Copy link

📦 Next.js Bundle Analysis for aave-ui

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Swish!

ℹ️ 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".

@mgrabina mgrabina changed the title feat: Aave Shield - block high price impact swaps feat: Aave Shield Mar 13, 2026
Reword the warning, confirmation checkbox, and add a "review before
confirming" line to make the risk clearer to users.
@github-actions
Copy link

@github-actions
Copy link

📦 Next.js Bundle Analysis for aave-ui

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant