Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

Validate Home Page subgraph values with Dune #123

Closed
ramirotw opened this issue Jun 15, 2022 · 10 comments
Closed

Validate Home Page subgraph values with Dune #123

ramirotw opened this issue Jun 15, 2022 · 10 comments
Assignees
Labels
app:Explorer Explorer App

Comments

@ramirotw
Copy link
Contributor

Description
Find discrepancies between the home page values and what the Dune dashboard shows

Home Page: https://pr98--gpui.review.gnosisdev.com/
Dune: https://dune.com/gnosis.protocol/Gnosis-Protocol-V2

@GabrielCamba
Copy link

This issue I think is related to this one cowprotocol/subgraph#7.

It'll be great to have all in a single place to avoid confusions.

@ramirotw
Copy link
Contributor Author

Yes you are right, but that issue is more general as we should validate all the data coming from the subgraph. This issue is more focused on the home page, so we have less to check.

@elena-zh
Copy link

@ramirotw , could you please clarify: should I compare data from this task with Dune or with the subgraph?
As in the task description you mention that with the Dune, in the comment above - with the subgraph.

@ramirotw
Copy link
Contributor Author

Sorry @elena-zh for the misunderstanding. The data we are currently showing on the Home Page comes from the subgraph, so it's basically comparing what the Home Page (subgraph) has vs what Dune has.

e.g. Total Volume
image
image

@elena-zh
Copy link

@ramirotw , Then, there is no need in this task.
I mean, if the task is to find discrepancies, so I have it already in my list, and as @GabrielCamba mentioned, it is cowprotocol/subgraph#7 , and the data do not match (known issue from that task).

But if I need to verify that the data on Home page comes and shows exact data from the subgraph, we can leave this task opened.

@ramirotw
Copy link
Contributor Author

Ok, if it makes sense for you to track the changes on that issue and document, I'm fine with it. The idea was to focus on what we are currently showing on the Home Page as it is the first thing users will notice. Like Total Volume, Fees, or Total Tokens (2,495 vs 2,184 which I don't see on the document)

@elena-zh
Copy link

@GabrielCamba , could you please clarify how do you calculate total tokens (based on what tabled/events, etc.) that are placed into the 'Totals' table?
image

Also, I need clarifications in:

  1. In what table Last Batch data recorded in the Graphql?
  2. In what table/group of tables I can calculate a number of '24h Transactions'
  3. The same is for '24h Fees',

Thanks

@GabrielCamba
Copy link

@elena-zh totals.tokens are added every time we receive an address in a trade (sellToken or buyToken) that doesn't exist in our records. That token is created in the tokens collection. You can't query 2000 tokens at one. That's why it's recomended to use pagination:

tokens(first: 100, skip: 200) {
    id
    address
    firstTradeTimestamp
    name
  }

Changing the skip number you'll be able to query all tokens. first execution skip 0, then 100, then 200 and so on. Please let me know if something is not clear enough.

About last 24 hours trades and fees you can query DailyTotals.

If you need to roll up 24 hours you can do the following:

{
_meta {
 block {
   number
 }
}

this query will give you the last indexed block number. let's suppose is 10000 then we need to substract the amount of blocks that are being created on a day. Let's say 6300 in ethereum network. then you can build this query: (10000 - 6300 = 3700)

totals(block: {number: 3700}){
    feesUsd
  }

This query will inform the results at that specific block.

@elena-zh
Copy link

elena-zh commented Jun 29, 2022

Top tokens traded discrepancy (token addresses that are not encountered in Graph, but exist in Dune) can be found here
The data is selected on 29/06/2022

Missing in Graph tokens are highlighted in red.

@elena-zh
Copy link

Discrepancy in Daily volume (on the 08/06/2022) can be found here

More info is in cowprotocol/subgraph#7 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
app:Explorer Explorer App
Projects
None yet
Development

No branches or pull requests

3 participants