We are currently managing signer and ethers contracts manually in page.tsx. This can lead to race conditions and "sticky" state when switching accounts or networks.
- Improvement: Migrate to Wagmi and RainbowKit. They handle wallet connections, account changes, and network switching automatically.
- Improvement: Use TanStack Query (React Query) for your getAmountsOut calls. This gives you built-in loading states, caching, and automatic refetching when the user changes the amount.
We are currently managing signer and ethers contracts manually in page.tsx. This can lead to race conditions and "sticky" state when switching accounts or networks.