Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dune API to fetch total eth staked #13395

Merged
merged 1 commit into from
Jul 17, 2024
Merged

Dune API to fetch total eth staked #13395

merged 1 commit into from
Jul 17, 2024

Conversation

pettinarip
Copy link
Member

@pettinarip pettinarip commented Jul 14, 2024

The current implementation fetches ~20 times to get all the data needed for the total eth staked chart on the home page.

This causes a few problems:

  • bad DX because you have to wait a long time for these fetches to run
  • the granularity of the chart is not very good since we are omitting days to avoid calling more times the API
  • (most importantly) hitting rate limits and causing the build to fail

Description

This PR uses a different API (Dune API) to do just one fetch call and simplify the whole process.

We shouldn't have any issues with rate limits now since the Dune API free plan supports 40 req per min for this type of operation.

It uses the following query forked and customized for our case (limited to the last 90 days).

@github-actions github-actions bot added the tooling 🔧 Changes related to tooling of the project label Jul 14, 2024
Copy link

netlify bot commented Jul 14, 2024

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit a7607b3
🔍 Latest deploy log https://app.netlify.com/sites/ethereumorg/deploys/6693cc645679640008bad62b
😎 Deploy Preview https://deploy-preview-13395--ethereumorg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 44 (🔴 down 7 from production)
Accessibility: 92 (no change from production)
Best Practices: 91 (🔴 down 7 from production)
SEO: 93 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@wackerow
Copy link
Member

@pettinarip Looks great! Higher resolution chart in the end as well... Still in draft for any reason?

@pettinarip pettinarip marked this pull request as ready for review July 15, 2024 15:45
@wackerow wackerow merged commit 22794fb into dev Jul 17, 2024
10 of 11 checks passed
@wackerow wackerow deleted the eth-staked-dune-api branch July 17, 2024 07:15
This was referenced Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tooling 🔧 Changes related to tooling of the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants