Skip to content

Historical price data: add chart UI and increase default data points #12218

@premiumjibles

Description

@premiumjibles

Problem

"Get price data on past 24 hours" — backend works but results dump as plain text. Two gaps:

tk ticket: sa-lurv

  1. No UI component — every other market data tool has a *UI.tsx card, but getHistoricalPrices does not
  2. Default dataPoints=2 is too sparse — returns just start/end values instead of a meaningful time series for 24h

Fix

  1. Create HistoricalPricesUI.tsx with a price chart (sparkline or line chart). Will need a lightweight chart library (recharts, lightweight-charts) or custom SVG sparkline — no chart library exists in the project yet.
  2. Increase default dataPoints for short ranges (≤7 days → 24 points for hourly resolution)
  3. Update system prompt to guide LLM to request more data points for recent ranges

Key Files

  • apps/agentic-server/src/tools/getHistoricalPrices.ts
  • apps/agentic-server/src/lib/asset/coingecko/api.ts
  • apps/agentic-chat/src/components/tools/ (new UI component)

Acceptance Criteria

  • HistoricalPricesUI renders visual price chart for returned data points
  • 24h queries return enough data points for meaningful chart
  • Percent change and start/end prices clearly displayed
  • Multiple assets render comparison view

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions