-
Notifications
You must be signed in to change notification settings - Fork 18
Milestone
Description
Close this issue if all data is able to be moved to a subgraph
Location: pages/api/pending-stake/[address].tsx, pages/api/score/[address].tsx, pages/api/regions/index.ts
Problem: Multiple API calls are made sequentially when they could run in parallel.
Example Fix:
// Before (sequential - 5s total)
const currentRound = await readContract(...);
const pendingStake = await readContract(...);
const pendingFees = await readContract(...);
// After (parallel - 2s total)
const currentRound = await readContract(...);
const [pendingStake, pendingFees] = await Promise.all([
readContract(...),
readContract(...)
]);We could also probably just make a single RPC ping with viem's readContracts method, which would make uncached page loads multiple times faster.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels