Skip to content

Conversation

orestiseth
Copy link
Contributor

@orestiseth orestiseth commented Oct 16, 2025

Note

Introduce an in-memory TTL cache and use it to cache spot price lookups (30s), updating assets use cases, wiring, and tests; bump snap version.

  • Assets pricing:
    • Caching spot prices: AssetsUseCases now uses a cache (ICache) to store spot prices for 30s, avoiding repeated lookups; refactors fetching loop and deduplicates by ticker.
    • Wiring: index.ts instantiates InMemoryCache and passes it to AssetsUseCases.
  • Store:
    • New cache: Add ICache interface and InMemoryCache implementation with TTL, bulk ops, and expiration handling.
  • Tests:
    • Add comprehensive tests for InMemoryCache.
    • Update AssetsUseCases.test.ts to mock cache and verify caching behavior.
  • Manifest:
    • Bump packages/snap/snap.manifest.json version to 1.3.0 and update shasum.

Written by Cursor Bugbot for commit 4e4f228. This will update automatically on new commits. Configure here.

@orestiseth orestiseth requested a review from a team as a code owner October 16, 2025 15:36
cursor[bot]

This comment was marked as outdated.

@orestiseth orestiseth merged commit 4b9c084 into main Oct 17, 2025
16 checks passed
@orestiseth orestiseth deleted the feat/cache-spot-prices-calls branch October 17, 2025 10:38
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.

3 participants