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

Stablecoins: Ethereum Breakdown Table #221

Merged
merged 6 commits into from
Jun 25, 2024
Merged

Conversation

SebMelendez01
Copy link
Contributor

@SebMelendez01 SebMelendez01 commented Jun 20, 2024

  1. Creating BAM Stablecoin table
  2. This table will be used for all the graphics on the new stablecoin page.
  3. Currently an issue with the Total Supply
  • The sum of all the balances does not equal the total supply of stablecoins on ethereum.
  • Balances query
  1. Query below is an example of how one can get the metrics for the stablecoin API:
select 
    date
    , symbol
    ,sum(stablecoin_transfer_volume)
    ,sum(stablecoin_daily_txns)
    ,sum(stablecoin_transfer_volume) / sum(stablecoin_daily_txns)
    ,avg(stablecoin_dau)
    ,sum(p2p_stablecoin_transfer_volume)
    ,sum(p2p_stablecoin_daily_txns)
    ,sum(p2p_stablecoin_transfer_volume) / sum(p2p_stablecoin_daily_txns)
    ,avg(p2p_stablecoin_dau)
from pc_dbt_db.prod.agg_ethereum_daily_stablecoin_metrics_breakdown 
group by date
order by date desc

Changes

Right now the agg_metrics full refresh takes 2.5 hours. We may need to make this incremental
Screenshot 2024-06-25 at 2 08 57 PM

@SebMelendez01 SebMelendez01 requested a review from a team as a code owner June 20, 2024 22:21
@SebMelendez01 SebMelendez01 requested a review from anthonyyim June 20, 2024 23:21
{{ config(materialized="table") }}
select
date
, contract_address
Copy link
Contributor

Choose a reason for hiding this comment

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

it appears @akan72's leading commas have become contagious

i for one, support the people! SQL-fluff with leading commas coming soon

then 1
else 0
{% endif %}
end as is_p2p
Copy link
Contributor

Choose a reason for hiding this comment

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

this is the big change right?

Copy link
Contributor

Choose a reason for hiding this comment

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

does this table replace agg_chain_stablecoin_breakdown?

Copy link
Contributor Author

@SebMelendez01 SebMelendez01 Jun 20, 2024

Choose a reason for hiding this comment

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

Ya plan is to use this table to power the entire stablecoin page and create a BAM for stablecoins. Still need to figure out the issue with total supply tho.

@SebMelendez01 SebMelendez01 merged commit 536cfa4 into main Jun 25, 2024
3 checks passed
@SebMelendez01 SebMelendez01 deleted the sm-stablecoins-breakdown branch June 25, 2024 20:22
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.

2 participants