-
Notifications
You must be signed in to change notification settings - Fork 455
All Swaps Modals Refactor + CoW Protocol Adapters support #2739
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
61ade69 to
e8fb88d
Compare
e8fb88d to
515287a
Compare
515287a to
0744de1
Compare
ee84766 to
ef4092a
Compare
ef4092a to
71e1637
Compare
b43732a to
8b52a92
Compare
|
📦 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! 🙌 |
68038f6 to
9114bb4
Compare
|
📦 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! 🙌 |
|
📦 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! 🙌 |
cde5f04 to
88ae066
Compare
|
📦 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! 🙌 |
672683d to
752f37a
Compare
Summary
Why
Architecture
Key changes
src/components/transactions/Swap/with a clear separation:modals/(entry + content),inputs/,warnings/,details/,actions/,hooks/,helpers/,types/,constants/,analytics/.helpers/shared/provider.helpers.ts#getSwitchProviderchooses CoW when supported, else falls back to ParaSwap.hooks/useSwapQuoteorchestrates quotes and normalizes results across providers.hooks/useFlowSelectorderives HF impact and selects flash‑loan vs simple flow.hooks/useSwapOrderAmountscomputes normalized sell/buy amounts, applies partner fee, slippage, and handles inversion.hooks/useSwapGasEstimationprovides consistent gas hints and toggles Gas Station.actions/approval/useSwapTokenApproval.tshandles ERC‑20 approvals, EIP‑2612 permits, and Aave credit delegation, including USDT reset logic.Architecture and docs
src/components/transactions/Swap/README.mdsrc/components/transactions/Swap/docs/swap-modal-architecture.pngmodals/request/BaseSwapModalContent.tsx(composition root, hook order, state ownership)hooks/*(quotes, flow selection, amounts, slippage, gas, reserves, native max)actions/*(CoW/ParaSwap, protocol flows, responsibilities, flash‑loan notes)helpers/shared/provider.helpers.ts(provider selection policy)types/state.types.ts,types/params.types.ts,types/tokens.types.ts,types/quote.types.ts,types/shared.types.ts(field‑level TSDoc)Important logic clarifications
isInvertedSwapandprocessedSideso orders/quotes are correctly built:UX behavior
safeSlippagederived for guards; CoW suggested slippage surfaces warnings if user input is too low.Testing notes