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

add the link to specific queries on the source links #13916

Closed
1 of 2 tasks
nloureiro opened this issue Sep 20, 2024 · 5 comments · Fixed by #14083
Closed
1 of 2 tasks

add the link to specific queries on the source links #13916

nloureiro opened this issue Sep 20, 2024 · 5 comments · Fixed by #14083
Assignees
Labels
awaiting PR Issue is ready for a pull request bug 🐛 Something isn't working hacktoberfest Track hacktoberfest activity

Comments

@nloureiro
Copy link
Contributor

nloureiro commented Sep 20, 2024

Describe the bug

when ever is possible we should link to the specific pages/queries on the big numbers on the homepage

example: the link for dune analytics should go to a dashboard and not the homepage

Screen Shot 2024-09-20 10 02 01 AM

To reproduce

  1. Go to homepage
  2. scroll to big numbers section
  3. open the tooltip
  4. click on the source link on the tooltip

Expected behavior

change the source links

Screenshots

No response

Desktop (please complete the following information)

No response

Smartphone (please complete the following information)

No response

Additional context

No response

Would you like to work on this issue?

  • Yes
  • No
@nloureiro nloureiro added the bug 🐛 Something isn't working label Sep 20, 2024
@github-actions github-actions bot added the needs triage 📥 This issue needs triaged before being worked on label Sep 20, 2024
@corwintines corwintines added the hacktoberfest Track hacktoberfest activity label Sep 30, 2024
@isabelladebrito isabelladebrito removed the needs triage 📥 This issue needs triaged before being worked on label Sep 30, 2024
@Code-Hacker26
Copy link
Contributor

Hi @nloureiro,
I'm interested in working on this issue but need a bit more clarity to ensure I'm addressing it correctly
Specifically the link for dune analytics should go to a dashboard and not the homepage

@nloureiro
Copy link
Contributor Author

Hi @nloureiro, I'm interested in working on this issue but need a bit more clarity to ensure I'm addressing it correctly Specifically the link for dune analytics should go to a dashboard and not the homepage

Yes, that's correct. The idea is to give users the ability to verify the numbers on the most easy form possible

@wackerow
Copy link
Member

wackerow commented Oct 2, 2024

Hey @Code-Hacker26! Thanks for the help.

Let me try to help outline this... we have four (4) homepage metrics:

Value locked in DeFi
DeFi Llama:

Value protecting Ethereum

Dune Analytics:

CoinGecko:

We then multiply those together to get the total $ securing the network.

Average transaction cost AND Transactions in the last 24h
GrowThePie:

    const mostRecentDate = data.reduce((latest, item) => {
      const itemDate = new Date(item.date)
      return itemDate > new Date(latest) ? item.date : latest
    }, data[0].date)

^ Finds the date of the most recent available data, assigns to mostRecentDate

    const mostRecentData = data.filter(
      (item) =>
        item.date === mostRecentDate &&
        [TXCOSTS_MEDIAN_USD, TXCOUNT].includes(item.metric_key)
    )

^ Grabs most recent data for transaction costs and counts, assigns to mostRecentData

    let totalTxCount = 0
    let weightedSum = 0

    mostRecentData.forEach((item) => {
      if (item.metric_key !== TXCOSTS_MEDIAN_USD) return

      const txCountItem = mostRecentData.find(
        (txItem) =>
          txItem.metric_key === TXCOUNT && txItem.origin_key === item.origin_key
      )
      if (!txCountItem) return

      totalTxCount += txCountItem.value
      weightedSum += item.value * txCountItem.value
    })

    // The weighted average of txcosts_median_usd, by txcount on each network (origin_key)
    const weightedAverage = totalTxCount ? weightedSum / totalTxCount : 0
  • totalTxCount += txCountItem.value is tallying up the cumulative tx counts for Mainnet + all Ethereum layer 2 networks
  • weightedSum += item.value * txCountItem.value is tallying up the cumulative transaction-weighted median costs for each transactions on each network
  • weightedAverage is then calculated by dividing the weight cost total by the total transaction count: weightedSum / totalTxCount

This produces the "Average transaction cost" metrics, spanning the L2's available from that endpoint.


Hope this helps summarize how/where the metrics come from. Any help organizing this info to present to users (cc: @nloureiro) would be most appreciated! Assigning you =)

@wackerow wackerow added the awaiting PR Issue is ready for a pull request label Oct 2, 2024
@Code-Hacker26
Copy link
Contributor

Hi @wackerow,
Thank you for assigning this to me! I’ll work on it and submit the PR as soon as possible.

Best regards,

@Code-Hacker26
Copy link
Contributor

@nloureiro @wackerow, I've submitted the PR with updates to the four links in the homepage metrics section. Please review it and let me know if you have any suggestions or changes.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting PR Issue is ready for a pull request bug 🐛 Something isn't working hacktoberfest Track hacktoberfest activity
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants