Skip to content

Token Metadata Individual Fetching issue #36

@aniket866

Description

@aniket866

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions