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
  • Trend Analysis get their own serivce and they call analytics to create charts (not vise versa)
  • Add a MarketDataSet to internal models so this service can reliably transport dataframe with internal meta data
  • 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
  • Add MarketDataSet
  • Created new Service trend_analysis_service
  • 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
  • Tests for storage hit and storage miss behavior + exception handeling tests
  • tests for the new service

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