You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Chore] Add KNOWN_POOLS early-exit guard in api/v1/vaults/[vaultId].ts #279
api/v1/vaults/[vaultId].ts calls fetchAllVaults() before checking whether the requested vaultId is known. On a cache miss, this triggers a full DeFiLlama round-trip only to return a 404. An unknown vault ID should be rejected immediately with no I/O.
Fix
Check KNOWN_POOLS (an O(1) map lookup by vault ID) before calling fetchAllVaults() and return 404 immediately for unrecognised IDs:
if(!KNOWN_POOLS[vaultId]){returnres.status(404).json({error: "Vault not found"});}constvaults=awaitfetchAllVaults();
Acceptance Criteria
pnpm lint && pnpm typecheck && pnpm test pass with no errors
A request for an unknown vault ID returns 404 without making any network call
Activity