Bug Description
-
With a wallet connected and positions held, the portfolio page fires ~23,673 RPC requests over a 60-second idle window (no user interaction). This exhausts the public RPC's rate limit (429s + CORS blocks), which breaks the getLogs cost-basis scan, so P&L renders as -100%.
-
Root cause: useIndexedDB and its wrapper useFatePoolsStorage each return a fresh object literal every render. The portfolio effect that depends on storage sees a new identity each render, re-runs, sets state with a new array, and re-renders, looping indefinitely.
Steps to Reproduce
- Connect a wallet on Sepolia with at least one held position.
- Open /portfolio and leave it idle (no interaction).
- Open DevTools > Network, filter RPC: request count climbs into the thousands within 60 seconds.
- P&L shows -100% because the getLogs scan is rate-limited out.
Logs and Screenshots
Environment Details
- OS: Windows 11
- Browser: Chrome / Brave
- Next.js 15 static export, wagmi + viem
- Chain: Sepolia (11155111), wallet connected, 3 held positions
Impact
High - Major feature is broken
Code of Conduct
Bug Description
With a wallet connected and positions held, the portfolio page fires ~23,673 RPC requests over a 60-second idle window (no user interaction). This exhausts the public RPC's rate limit (429s + CORS blocks), which breaks the getLogs cost-basis scan, so P&L renders as -100%.
Root cause: useIndexedDB and its wrapper useFatePoolsStorage each return a fresh object literal every render. The portfolio effect that depends on
storagesees a new identity each render, re-runs, sets state with a new array, and re-renders, looping indefinitely.Steps to Reproduce
Logs and Screenshots
Environment Details
Impact
High - Major feature is broken
Code of Conduct