Skip to content

fix: add KNOWN_POOLS guard before fetchAllVaults in vaults/[vaultId].ts - #292

Merged
collinsezedike merged 2 commits into
mainfrom
fix/known-pools-early-exit-vault-id
Jun 29, 2026
Merged

collinsezedike merged 2 commits into
mainfrom
fix/known-pools-early-exit-vault-id

Conversation

@collinsezedike

@collinsezedike collinsezedike commented Jun 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • api/v1/vaults/[vaultId].ts called fetchAllVaults() (a full DeFiLlama round-trip on cache miss) before checking whether the requested vault ID is actually known
  • An unrecognised ID triggered the full fetch only to return a 404, wasting network and time
  • Added a module-scope KNOWN_VAULT_IDS set derived from KNOWN_POOLS values and check it before calling fetchAllVaults(), returning 404 immediately for unrecognised IDs without any I/O

Test plan

  • pnpm lint && pnpm typecheck && pnpm test pass locally
  • A request for an unknown vault ID returns 404 instantly without triggering DeFiLlama calls

Closes #279

@vercel

vercel Bot commented Jun 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
meridian Ready Ready Preview, Comment Jun 29, 2026 6:34pm

@collinsezedike
collinsezedike merged commit 3f6fdef into main Jun 29, 2026
5 checks passed
@collinsezedike
collinsezedike deleted the fix/known-pools-early-exit-vault-id branch June 29, 2026 18:35

This branch was successfully deployed

1 active deployment
Preview — bce50968 Deployed Jun 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Chore] Add KNOWN_POOLS early-exit guard in api/v1/vaults/[vaultId].ts

1 participant