Skip to content

Refactor TimeSeriesService #70

Description

@BytecodeBrewer

Goal

Refactor TimeSeriesService into MarketDataService and add a storage-first workflow.

Why

ARGUS should use stored historical data before calling external APIs again. This keeps data access centralized and prepares the project for analytics and reporting workflows that can reuse saved market data.

Scope

  • Rename or refactor TimeSeriesService into MarketDataService
  • Check DuckDB for requested historical price bars first
  • Return stored price bars if the full requested data is available
  • Call the API client only if no matching stored data is found
  • Normalize fetched API data into internal models
  • Save fetched historical data to DuckDB before returning it
  • Keep client access inside MarketDataService

Out of scope

  • Partial range handling: if only part of the requested data exists, treat it as not found

Acceptance criteria

  • TimeSeriesService is refactored or renamed to MarketDataService
  • Historical data requests check DuckDB before calling an API client
  • Stored data is returned when the requested data exists
  • API client is called only when no matching stored data is found
  • Fetched API data is normalized into internal models
  • Fetched historical data is saved to DuckDB
  • External client calls are handled through MarketDataService
  • Tests cover storage hit and storage miss behavior

Note

Priority: Should

Metadata

Metadata

Labels

refactorImprovement of certain features or its functionalities

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions