Skip to content
This repository was archived by the owner on Jul 7, 2026. It is now read-only.

Fix swap functionality, add quote calculation, and clean up UI#8

Open
0xPotatoofdoom wants to merge 1 commit into
Uniswap:mainfrom
0xPotatoofdoom:fix/swap-ui-improvements
Open

Fix swap functionality, add quote calculation, and clean up UI#8
0xPotatoofdoom wants to merge 1 commit into
Uniswap:mainfrom
0xPotatoofdoom:fix/swap-ui-improvements

Conversation

@0xPotatoofdoom

Copy link
Copy Markdown

Summary

  • Fix dependency conflicts (MUI v5->v7, TypeScript v4->v5) that prevented npm install
  • Fix Unichain Sepolia network config to use public RPC (https://sepolia.unichain.org) instead of missing env var
  • Implement on-chain swap quote calculation using pool state (sqrtPriceX96, liquidity) from StateView contract
  • Apply slippage tolerance to amountOutMinimum (default 5%) to prevent V4TooLittleReceived reverts on hooked pools
  • Fix precision loss when formatting large token amounts
  • Add confetti animation on successful swap and fix success message being immediately cleared
  • Clean up UI: truncate balance/quote decimals, remove placeholder $0.00 USD values, fix input layout, remove unused Explore tab and Test Pool deployer

Test plan

  • Run npm install and npm run start -- app should build and serve without errors
  • Paste a valid pool key JSON and select tokens -- quote should auto-populate in "You receive" field
  • Execute a swap -- transaction should succeed and confetti should fire
  • Verify token balances display with truncated decimals (max 4)
  • Verify Explore tab is removed from nav and Test Pool section is removed from swap page

🤖 Generated with Claude Code

- Fix dependency conflicts (MUI v5->v7, TypeScript v4->v5)
- Fix Unichain Sepolia RPC to use public endpoint
- Implement swap quote calculation using on-chain pool state
- Apply slippage tolerance to amountOutMinimum (default 5% for hooked pools)
- Fix precision loss in large token amount formatting
- Add confetti animation on successful swap
- Fix success message being cleared immediately after swap
- Truncate balance decimals and quote output for readable UI
- Remove unused Explore nav tab and Test Pool deployer
- Remove placeholder $0.00 USD values
- Fix input layout so amount field isn't crushed by token selector
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant