-
-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
Token Metadata Fetching
Issue:
Token metadata (name, symbol, decimals) is fetched individually inside loops across pool, user pool, and trade log functions.
Where:
getPools()getUserPools()getBuyTradeEventLogs(),getSellTradeEventLogs()swapInEventLogs(),swapOutEventLogs()
Impact:
This causes excessive RPC calls, increasing the risk of rate limits (429 errors) and slow page loads.
Proposed Fix:
Use a multicall-based metadata fetch combined with a local in-memory cache.
Sample Snippets:
Previous (inside loops)
const token = await this.getToken(address);Fix (cache + multicall)
if (tokenCache[address]) return tokenCache[address];const results = await publicClient.multicall({ contracts });Why:
Reduces repeated RPC calls, avoids rate limiting, and significantly improves
@kaneki003 What's your view on this , Feel free to assign
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels