Skip to content

Crypto cache refactor#45

Merged
dbrowne merged 2 commits intobetafrom
crypto-cache-refactor
Jan 23, 2026
Merged

Crypto cache refactor#45
dbrowne merged 2 commits intobetafrom
crypto-cache-refactor

Conversation

@dbrowne
Copy link
Copy Markdown
Owner

@dbrowne dbrowne commented Jan 23, 2026

Separate crypto-loaders crate and add unified cache implementation

  • Create new crypto-loaders crate for non-AlphaVantage crypto data
  • Move CoinGecko, CoinMarketCap, CoinPaprika, CoinCap, SosoValue providers
  • Add CryptoSymbolLoader, CryptoMappingService, and details loader
  • Implement unified CacheHelper with CacheConfig and CacheConfigProvider trait
  • Refactor price loaders to use CacheRepository instead of direct DB connections
  • Add standard cache TTL constants and key prefixes
  • Refactor av-core market types into separate modules

   - Create new crypto-loaders crate for non-AlphaVantage crypto data
   - Move CoinGecko, CoinMarketCap, CoinPaprika, CoinCap, SosoValue providers
   - Add CryptoSymbolLoader, CryptoMappingService, and details loader
   - Implement unified CacheHelper with CacheConfig and CacheConfigProvider trait
   - Refactor price loaders to use CacheRepository instead of direct DB connections
   - Add standard cache TTL constants and key prefixes
   - Refactor av-core market types into separate modules
Copy link
Copy Markdown

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.

Pull request overview

This PR separates non-AlphaVantage crypto functionality into a new crypto-loaders crate and refactors the existing loader stack to use a unified, repository-based caching interface while also modularizing some av-core market types.

Changes:

  • Added new crates/crypto-loaders crate with providers (CoinGecko/CMC/CoinPaprika/CoinCap/SosoValue), core types, errors, symbol/details loaders, metadata, mapping, and social modules.
  • Introduced av-loaders::cache unified cache helper/config + TTL/key constants, and refactored multiple loaders to use CacheRepository instead of raw DB connections.
  • Updated av-client construction APIs to return Result (and updated call sites), and refactored av-core::types::market into submodules with re-exports.

Reviewed changes

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

Show a summary per file
File Description
crates/crypto-loaders/Cargo.toml New standalone crate definition and deps for moved crypto loaders/providers.
crates/crypto-loaders/src/* New crypto-loaders API surface: types/errors/traits + providers + loaders + mapping/metadata/social modules.
crates/av-loaders/src/cache.rs New unified cache config/helper + TTL/key conventions for loader caching.
crates/av-loaders/src/*loader.rs Updated multiple loaders to use CacheRepository and TTL constants via CacheConfigProvider.
crates/av-loaders/src/crypto/* Re-exports/adapters/wrappers integrating crypto-loaders into av-loaders.
crates/av-client/src/{transport,client}.rs Transport::new and AlphaVantageClient::new now return Result, with updated docs/tests.
crates/av-database/postgres/src/repository.rs Faster failure behavior for DB context creation + pool connection timeout.
crates/av-core/src/types/market/* Split market types into modules and re-exported through types::market.
crates/av-cli/src/commands/load/*.rs Updated CLI client construction to handle AlphaVantageClient::new -> Result.
Cargo.toml / Cargo.lock Added new workspace member crypto-loaders and updated lockfile.
Files not reviewed (1)
  • .idea/alphavantage.iml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/crypto-loaders/src/mapping/discovery.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment