Skip to content

Commit

Permalink
Stablecoins: Add Token Holders (#567)
Browse files Browse the repository at this point in the history
  • Loading branch information
SebMelendez01 authored Oct 24, 2024
1 parent 686b595 commit 38a9b63
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions macros/stablecoins/stablecoin_breakdown.sql
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ select
when sum(p2p_stablecoin_daily_txns) > 0 then sum(p2p_stablecoin_transfer_volume) / sum(p2p_stablecoin_daily_txns)
else 0
end as p2p_stablecoin_avg_txn_value
{% if granularity == 'day' and (breakdown == ['symbol'] or breakdown == ['chain']) %}
, count(distinct case when stablecoin_supply > 0 then from_address end) as stablecoin_token_holder_count
, count(distinct case when is_wallet::number = 1 and stablecoin_supply > 0 then from_address end) as p2p_stablecoin_token_holder_count
{% endif %}
{% if granularity == 'day' %}
, sum(stablecoin_supply) as stablecoin_supply
, sum(case when is_wallet::number = 1 then stablecoin_supply else 0 end) as p2p_stablecoin_supply
Expand Down

0 comments on commit 38a9b63

Please sign in to comment.