-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stablecoin Dashboard: Adding new stablecoin metrics (#461)
- Loading branch information
1 parent
a96dd8f
commit ababc49
Showing
27 changed files
with
197 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
{% macro get_p2p_metrics(chain) %} | ||
select date, p2p_native_transfer_volume, p2p_token_transfer_volume, p2p_stablecoin_transfer_volume, p2p_transfer_volume | ||
select | ||
date | ||
, p2p_native_transfer_volume | ||
, p2p_token_transfer_volume | ||
, p2p_transfer_volume | ||
from {{ ref("fact_" ~ chain ~ "_p2p_transfer_volume") }} | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,59 @@ | ||
{% macro get_stablecoin_metrics(chain) %} | ||
{% macro get_stablecoin_metrics(identifier, breakdown="chain") %} | ||
with mau as ( | ||
select | ||
chain, | ||
date, | ||
sum(total_supply) as stablecoin_total_supply, | ||
sum(txns) as stablecoin_txns, | ||
sum(dau) as stablecoin_dau, | ||
sum(transfer_volume) as stablecoin_transfer_volume, | ||
sum(deduped_transfer_volume) as deduped_stablecoin_transfer_volume | ||
from {{ ref("agg_" ~ chain ~ "_stablecoin_metrics") }} | ||
group by chain, date | ||
{% endmacro %} | ||
date_granularity as date | ||
, '{{ identifier }}' as {{breakdown}} | ||
, stablecoin_dau as stablecoin_mau | ||
, artemis_stablecoin_dau as artemis_stablecoin_mau | ||
, p2p_stablecoin_dau as p2p_stablecoin_mau | ||
from {{ ref("agg_monthly_stablecoin_breakdown_" ~ breakdown) }} | ||
{% if breakdown == "chain" %} | ||
where lower(chain) = lower('{{ identifier }}') | ||
{% elif breakdown == "symbol" %} | ||
where lower(symbol) = lower('{{ identifier }}') | ||
{% endif %} | ||
) | ||
, daily_metrics as ( | ||
select | ||
date_granularity as date | ||
, '{{ identifier }}' as {{ breakdown }} | ||
|
||
, stablecoin_transfer_volume as stablecoin_transfer_volume | ||
, stablecoin_daily_txns as stablecoin_txns | ||
, stablecoin_dau | ||
|
||
, artemis_stablecoin_transfer_volume | ||
, artemis_stablecoin_daily_txns as artemis_stablecoin_txns | ||
, artemis_stablecoin_dau | ||
|
||
, p2p_stablecoin_transfer_volume | ||
, p2p_stablecoin_daily_txns as p2p_stablecoin_txns | ||
, p2p_stablecoin_dau | ||
|
||
, stablecoin_supply as stablecoin_total_supply | ||
from {{ ref("agg_daily_stablecoin_breakdown_" ~ breakdown) }} | ||
{% if breakdown == "chain" %} | ||
where lower(chain) = lower('{{ identifier }}') | ||
{% elif breakdown == "symbol" %} | ||
where lower(symbol) = lower('{{ identifier }}') | ||
{% endif %} | ||
) | ||
select | ||
daily_metrics.date | ||
, daily_metrics.{{breakdown}} as {{ breakdown }} | ||
, stablecoin_transfer_volume | ||
, stablecoin_txns | ||
, stablecoin_dau | ||
, stablecoin_mau | ||
, artemis_stablecoin_transfer_volume | ||
, artemis_stablecoin_txns | ||
, artemis_stablecoin_dau | ||
, artemis_stablecoin_mau | ||
, p2p_stablecoin_transfer_volume | ||
, p2p_stablecoin_txns | ||
, p2p_stablecoin_dau | ||
, p2p_stablecoin_mau | ||
, stablecoin_total_supply | ||
from daily_metrics | ||
left join mau on daily_metrics.date = mau.date | ||
{% endmacro %} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
{{ | ||
config( | ||
materialized="incremental", | ||
unique_key="date", | ||
materialized="table", | ||
snowflake_warehouse="BUSD", | ||
database="busd", | ||
schema="core", | ||
alias="ez_metrics", | ||
) | ||
}} | ||
|
||
{{ get_stablecoin_ez_metrics("BUSD") }} | ||
{{ get_stablecoin_metrics("BUSD", breakdown='symbol') }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
{{ | ||
config( | ||
materialized="incremental", | ||
unique_key="date", | ||
materialized="table", | ||
snowflake_warehouse="CEUR", | ||
database="ceur", | ||
schema="core", | ||
alias="ez_metrics", | ||
) | ||
}} | ||
|
||
{{ get_stablecoin_ez_metrics("CEUR") }} | ||
{{ get_stablecoin_metrics("cEUR", breakdown='symbol') }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
{{ | ||
config( | ||
materialized="incremental", | ||
unique_key="date", | ||
materialized="table", | ||
snowflake_warehouse="CKES", | ||
database="ckes", | ||
schema="core", | ||
alias="ez_metrics", | ||
) | ||
}} | ||
|
||
{{ get_stablecoin_ez_metrics("CKES") }} | ||
{{ get_stablecoin_metrics("cKES", breakdown='symbol') }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
{{ | ||
config( | ||
materialized="incremental", | ||
unique_key="date", | ||
materialized="table", | ||
snowflake_warehouse="CREAL", | ||
database="creal", | ||
schema="core", | ||
alias="ez_metrics", | ||
) | ||
}} | ||
|
||
{{ get_stablecoin_ez_metrics("CREAL") }} | ||
{{ get_stablecoin_metrics("cREAL", breakdown='symbol') }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
{{ | ||
config( | ||
materialized="incremental", | ||
unique_key="date", | ||
materialized="table", | ||
snowflake_warehouse="CUSD", | ||
database="cusd", | ||
schema="core", | ||
alias="ez_metrics", | ||
) | ||
}} | ||
|
||
{{ get_stablecoin_ez_metrics("CUSD") }} | ||
{{ get_stablecoin_metrics("cUSD", breakdown='symbol') }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
{{ | ||
config( | ||
materialized="incremental", | ||
unique_key="date", | ||
materialized="table", | ||
snowflake_warehouse="DAI", | ||
database="dai", | ||
schema="core", | ||
alias="ez_metrics", | ||
) | ||
}} | ||
|
||
{{ get_stablecoin_ez_metrics("DAI") }} | ||
{{ get_stablecoin_metrics("DAI", breakdown='symbol') }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
{{ | ||
config( | ||
materialized="incremental", | ||
unique_key="date", | ||
materialized="table", | ||
snowflake_warehouse="EURC", | ||
database="eurc", | ||
schema="core", | ||
alias="ez_metrics", | ||
) | ||
}} | ||
|
||
{{ get_stablecoin_ez_metrics("EURC") }} | ||
{{ get_stablecoin_metrics("EURC", breakdown='symbol') }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.