-
Notifications
You must be signed in to change notification settings - Fork 6
An 6028/testing-metrics-dex #454
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
Conversation
GROUP BY | ||
ALL | ||
), | ||
crosschain_total_volume AS ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
technically you don't need the second CTE to roll up to the blockchain level, you can add this to line 46 for example:
SUM(crosschain_volume) OVER(partition by blockchain) total
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait, small difference here. if I write the cumulative sum in the same cte, i'll be summing for chains where defillama has no dex data but we do like gnosis, then we'd face the division by 0 error.
If it's summed outside the cte, we're only comparing chains where both defillama + our data has data for
blockchain, | ||
platform_name, | ||
defillama_volume, | ||
defillama_volume_percent, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not land the crosschain volume here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh nevermind, this is meant to just be what's missing
models/silver/ai_metrics/defillama_comparison/silver_metrics__bridge_comparison.yml
Outdated
Show resolved
Hide resolved
platform_name | ||
) | ||
WHERE | ||
crosschain_volume IS NULL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is assuming if we have the platform we have full coverage? Do you think it makes sense to compare the actual volumes?
New model
silver_metrics__dex_comparison
which does the following:a. Compares dex volumes in the last 7 days for all chains in our complete dex swaps model against Defillama's dex volume table by chain
b. logs ONLY the top 5 protocols by volume that Defillama has that we currently DO not curate. This is also fuzzy matched and stripped off of any protocol versions. (v2 of this could be measuring against protocols that are in common too)
silver_metrics__dex_comparison
yml file will error IF there is a protocol that did > 10% of total defillama dex volume in the past 7 days AND we do not have that protocol curated2 tables for the above 2 tables but for bridges
1 new table to compare on a chain level for dex and bridge categories
new workflow that runs weekly on Monday to runs the model and test the data
dbt run -m models/silver/ai_metrics/defillama_comparison --full-refresh