Skip to content

Conversation

@fhqvst
Copy link
Contributor

@fhqvst fhqvst commented Oct 15, 2025

Summary

With this PR we now consume historical price data from the Benchmarks API instead of using our own hand-rolled Clickhouse query.

One downside is that we don't have confidence intervals in the Benchmarks API...

Rationale

Our clients' users have complained that they're seeing inconsistent data in insights hub vs. the data on our clients' pages. With this change we now make sure that the data our clients are consuming is the same one we're using on insights hub, meaning there shouldn't be any inconsistencies.

How has this been tested?

  • Current tests cover my changes
  • Added new tests
  • Manually tested the code

@linear
Copy link

linear bot commented Oct 15, 2025

@vercel
Copy link

vercel bot commented Oct 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
component-library Ready Ready Preview Comment Nov 12, 2025 10:20am
insights Ready Ready Preview Comment Nov 12, 2025 10:20am
5 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
api-reference Skipped Skipped Nov 12, 2025 10:20am
developer-hub Skipped Skipped Nov 12, 2025 10:20am
entropy-explorer Skipped Skipped Nov 12, 2025 10:20am
proposals Skipped Skipped Nov 12, 2025 10:20am
staking Skipped Skipped Nov 12, 2025 10:20am

Copy link
Collaborator

@cprussin cprussin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change is overall good! But I think there's a few more things before we ship it:

  1. I think the /historical-prices endpoint is now dead code, can you check and clean it up if so?
  2. @ali-behjati can you tell us how hard it would be to add CI to the benchmarks endpoint? Is it feasible? I really hate losing CI from the historical charts, plus it does seem reasonable that we might want to have CI in the benchmarks apis.

// Transform OHLC data to our format using close prices
const data = benchmarkData.t.map((timestamp, i) => ({
time: timestamp as UTCTimestamp,
price: benchmarkData.c[i], // Use close price
Copy link
Collaborator

@cprussin cprussin Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love this -- I think we will need to put more thought in here. If we aren't showing OHLC candles, I think the chart will be misleading. Plus, we should have full resolution (individual points) when zoomed all the way in, so OHLC doesn't really make sense at that resolution. Let's grab some time to chat through this

@ali-behjati
Copy link
Collaborator

@cprussin it shouldn't be so hard to add it but takes a bit of time. we need to change the materialized views to add it and need to expose a new endpoint that returns it in the benchmarks.

@fhqvst fhqvst force-pushed the fhqvst/ui-276-use-benchmarks-api-for-historical-data branch from a697c35 to d52a2b4 Compare November 12, 2025 10:16
@vercel vercel bot temporarily deployed to Preview – developer-hub November 12, 2025 10:16 Inactive
@vercel vercel bot temporarily deployed to Preview – api-reference November 12, 2025 10:16 Inactive
@vercel vercel bot temporarily deployed to Preview – staking November 12, 2025 10:16 Inactive
@vercel vercel bot temporarily deployed to Preview – proposals November 12, 2025 10:16 Inactive
@vercel vercel bot temporarily deployed to Preview – entropy-explorer November 12, 2025 10:16 Inactive
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.

4 participants