Skip to content

Conversation

@DanielSchiavini
Copy link
Contributor

This pull request introduces a caching mechanism to optimize API calls and refactors existing code to use this new caching system.

  • cache API responses for pool data, USD prices and CRV APY, with a cache duration of 5 minutes.
    • Moved functions _getCachedData, _getPoolsFromApi, _getAllPoolsFromApi, and _getUsdPricesFromApi to handle cached data retrieval with backwards compatibility.
    • Replaced the cached _getPoolsFromApi function with uncached_getPoolsFromApi and added new functions uncached_getAllPoolsFromApi
    • moved uncached_getUsdPricesFromApi and uncached_getCrvApyFromApi to external-api
  • Updated various files to import functions from cached.js instead of external-api.js:
  • Added error handling so pools throw a better error if the pool ID is not found, listing available pools.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

@DanielSchiavini DanielSchiavini marked this pull request as ready for review April 9, 2025 08:55
0xtutti
0xtutti previously approved these changes Apr 9, 2025
fedorovdg
fedorovdg previously approved these changes May 12, 2025
@DanielSchiavini DanielSchiavini merged commit b83ceba into master May 21, 2025
1 check passed
@DanielSchiavini DanielSchiavini deleted the perf/usd-rates branch May 21, 2025 13:22
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.

5 participants