-
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.
- Loading branch information
1 parent
5f355ac
commit e56eaf6
Showing
7 changed files
with
209 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
models/metrics/stablecoins/breakdowns/agg_daily_stablecoin_breakdown_application.sql
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{{ config(materialized="table", snowflake_warehouse="STABLECOIN_V2_LG") }} | ||
select | ||
date | ||
, chain | ||
, symbol | ||
, count(distinct case when stablecoin_daily_txns > 0 then from_address end) as stablecoin_dau | ||
, sum(stablecoin_transfer_volume) as stablecoin_transfer_volume | ||
, sum(stablecoin_daily_txns) as stablecoin_daily_txns | ||
, count(distinct case when stablecoin_daily_txns > 0 then from_address end) as artemis_stablecoin_dau | ||
, sum(artemis_stablecoin_transfer_volume) as artemis_stablecoin_transfer_volume | ||
, sum(artemis_stablecoin_daily_txns) as artemis_stablecoin_daily_txns | ||
, count(distinct case when stablecoin_daily_txns > 0 then from_address end) as p2p_stablecoin_dau | ||
, sum(p2p_stablecoin_transfer_volume) as p2p_stablecoin_transfer_volume | ||
, sum(p2p_stablecoin_daily_txns) as p2p_stablecoin_daily_txns | ||
, sum(stablecoin_supply) as stablecoin_supply | ||
, sum(case when is_wallet::number = 1 then stablecoin_supply else 0 end) as p2p_stablecoin_supply | ||
from {{ ref("agg_daily_stablecoin_breakdown_silver") }} | ||
group by date, symbol, chain | ||
order by date |
31 changes: 31 additions & 0 deletions
31
models/metrics/stablecoins/breakdowns/agg_daily_stablecoin_breakdown_category.sql
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{{ config(materialized="table", snowflake_warehouse="STABLECOIN_V2_LG") }} | ||
select | ||
date | ||
, category | ||
, count(distinct case when stablecoin_daily_txns > 0 then from_address end) as stablecoin_dau | ||
, sum(stablecoin_transfer_volume) as stablecoin_transfer_volume | ||
, sum(stablecoin_daily_txns) as stablecoin_daily_txns | ||
, case | ||
when sum(stablecoin_daily_txns) > 0 then sum(stablecoin_transfer_volume) / sum(stablecoin_daily_txns) | ||
else 0 | ||
end as stablecoin_avg_txn_value | ||
, count(distinct case when artemis_stablecoin_daily_txns > 0 then from_address end) as artemis_stablecoin_dau | ||
, sum(artemis_stablecoin_transfer_volume) as artemis_stablecoin_transfer_volume | ||
, sum(artemis_stablecoin_daily_txns) as artemis_stablecoin_daily_txns | ||
, case | ||
when sum(artemis_stablecoin_daily_txns) > 0 then sum(artemis_stablecoin_transfer_volume) / sum(artemis_stablecoin_daily_txns) | ||
else 0 | ||
end as artemis_stablecoin_avg_txn_value | ||
, count(distinct case when p2p_stablecoin_daily_txns > 0 then from_address end) as p2p_stablecoin_dau | ||
, sum(p2p_stablecoin_transfer_volume) as p2p_stablecoin_transfer_volume | ||
, sum(p2p_stablecoin_daily_txns) as p2p_stablecoin_daily_txns | ||
, case | ||
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 | ||
|
||
, sum(stablecoin_supply) as stablecoin_supply | ||
, sum(case when is_wallet::number = 1 then stablecoin_supply else 0 end) as p2p_stablecoin_supply | ||
from {{ ref("agg_daily_stablecoin_breakdown_silver") }} | ||
group by date, category | ||
order by date |
32 changes: 32 additions & 0 deletions
32
models/metrics/stablecoins/breakdowns/agg_daily_stablecoin_breakdown_category_chain.sql
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{{ config(materialized="table", snowflake_warehouse="STABLECOIN_V2_LG_2") }} | ||
select | ||
date | ||
, chain | ||
, category | ||
, count(distinct case when stablecoin_daily_txns > 0 then from_address end) as stablecoin_dau | ||
, sum(stablecoin_transfer_volume) as stablecoin_transfer_volume | ||
, sum(stablecoin_daily_txns) as stablecoin_daily_txns | ||
, case | ||
when sum(stablecoin_daily_txns) > 0 then sum(stablecoin_transfer_volume) / sum(stablecoin_daily_txns) | ||
else 0 | ||
end as stablecoin_avg_txn_value | ||
, count(distinct case when artemis_stablecoin_daily_txns > 0 then from_address end) as artemis_stablecoin_dau | ||
, sum(artemis_stablecoin_transfer_volume) as artemis_stablecoin_transfer_volume | ||
, sum(artemis_stablecoin_daily_txns) as artemis_stablecoin_daily_txns | ||
, case | ||
when sum(artemis_stablecoin_daily_txns) > 0 then sum(artemis_stablecoin_transfer_volume) / sum(artemis_stablecoin_daily_txns) | ||
else 0 | ||
end as artemis_stablecoin_avg_txn_value | ||
, count(distinct case when p2p_stablecoin_daily_txns > 0 then from_address end) as p2p_stablecoin_dau | ||
, sum(p2p_stablecoin_transfer_volume) as p2p_stablecoin_transfer_volume | ||
, sum(p2p_stablecoin_daily_txns) as p2p_stablecoin_daily_txns | ||
, case | ||
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 | ||
|
||
, sum(stablecoin_supply) as stablecoin_supply | ||
, sum(case when is_wallet::number = 1 then stablecoin_supply else 0 end) as p2p_stablecoin_supply | ||
from {{ ref("agg_daily_stablecoin_breakdown_silver") }} | ||
group by date, category, chain | ||
order by date |
33 changes: 33 additions & 0 deletions
33
...s/metrics/stablecoins/breakdowns/agg_daily_stablecoin_breakdown_category_symbol_chain.sql
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{{ config(materialized="table", snowflake_warehouse="STABLECOIN_V2_LG_2") }} | ||
select | ||
date | ||
, chain | ||
, category | ||
, symbol | ||
, count(distinct case when stablecoin_daily_txns > 0 then from_address end) as stablecoin_dau | ||
, sum(stablecoin_transfer_volume) as stablecoin_transfer_volume | ||
, sum(stablecoin_daily_txns) as stablecoin_daily_txns | ||
, case | ||
when sum(stablecoin_daily_txns) > 0 then sum(stablecoin_transfer_volume) / sum(stablecoin_daily_txns) | ||
else 0 | ||
end as stablecoin_avg_txn_value | ||
, count(distinct case when artemis_stablecoin_daily_txns > 0 then from_address end) as artemis_stablecoin_dau | ||
, sum(artemis_stablecoin_transfer_volume) as artemis_stablecoin_transfer_volume | ||
, sum(artemis_stablecoin_daily_txns) as artemis_stablecoin_daily_txns | ||
, case | ||
when sum(artemis_stablecoin_daily_txns) > 0 then sum(artemis_stablecoin_transfer_volume) / sum(artemis_stablecoin_daily_txns) | ||
else 0 | ||
end as artemis_stablecoin_avg_txn_value | ||
, count(distinct case when p2p_stablecoin_daily_txns > 0 then from_address end) as p2p_stablecoin_dau | ||
, sum(p2p_stablecoin_transfer_volume) as p2p_stablecoin_transfer_volume | ||
, sum(p2p_stablecoin_daily_txns) as p2p_stablecoin_daily_txns | ||
, case | ||
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 | ||
|
||
, sum(stablecoin_supply) as stablecoin_supply | ||
, sum(case when is_wallet::number = 1 then stablecoin_supply else 0 end) as p2p_stablecoin_supply | ||
from {{ ref("agg_daily_stablecoin_breakdown_silver") }} | ||
group by date, category, symbol, chain | ||
order by date |
31 changes: 31 additions & 0 deletions
31
models/metrics/stablecoins/breakdowns/agg_daily_stablecoin_breakdown_chain.sql
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{{ config(materialized="table", snowflake_warehouse="STABLECOIN_V2_LG") }} | ||
select | ||
date | ||
, chain | ||
, count(distinct case when stablecoin_daily_txns > 0 then from_address end) as stablecoin_dau | ||
, sum(stablecoin_transfer_volume) as stablecoin_transfer_volume | ||
, sum(stablecoin_daily_txns) as stablecoin_daily_txns | ||
, case | ||
when sum(stablecoin_daily_txns) > 0 then sum(stablecoin_transfer_volume) / sum(stablecoin_daily_txns) | ||
else 0 | ||
end as stablecoin_avg_txn_value | ||
, count(distinct case when artemis_stablecoin_daily_txns > 0 then from_address end) as artemis_stablecoin_dau | ||
, sum(artemis_stablecoin_transfer_volume) as artemis_stablecoin_transfer_volume | ||
, sum(artemis_stablecoin_daily_txns) as artemis_stablecoin_daily_txns | ||
, case | ||
when sum(artemis_stablecoin_daily_txns) > 0 then sum(artemis_stablecoin_transfer_volume) / sum(artemis_stablecoin_daily_txns) | ||
else 0 | ||
end as artemis_stablecoin_avg_txn_value | ||
, count(distinct case when p2p_stablecoin_daily_txns > 0 then from_address end) as p2p_stablecoin_dau | ||
, sum(p2p_stablecoin_transfer_volume) as p2p_stablecoin_transfer_volume | ||
, sum(p2p_stablecoin_daily_txns) as p2p_stablecoin_daily_txns | ||
, case | ||
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 | ||
|
||
, sum(stablecoin_supply) as stablecoin_supply | ||
, sum(case when is_wallet::number = 1 then stablecoin_supply else 0 end) as p2p_stablecoin_supply | ||
from {{ ref("agg_daily_stablecoin_breakdown_silver") }} | ||
group by date, chain | ||
order by date |
31 changes: 31 additions & 0 deletions
31
models/metrics/stablecoins/breakdowns/agg_daily_stablecoin_breakdown_symbol.sql
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{{ config(materialized="table", snowflake_warehouse="STABLECOIN_V2_LG") }} | ||
select | ||
date | ||
, symbol | ||
, count(distinct case when stablecoin_daily_txns > 0 then from_address end) as stablecoin_dau | ||
, sum(stablecoin_transfer_volume) as stablecoin_transfer_volume | ||
, sum(stablecoin_daily_txns) as stablecoin_daily_txns | ||
, case | ||
when sum(stablecoin_daily_txns) > 0 then sum(stablecoin_transfer_volume) / sum(stablecoin_daily_txns) | ||
else 0 | ||
end as stablecoin_avg_txn_value | ||
, count(distinct case when artemis_stablecoin_daily_txns > 0 then from_address end) as artemis_stablecoin_dau | ||
, sum(artemis_stablecoin_transfer_volume) as artemis_stablecoin_transfer_volume | ||
, sum(artemis_stablecoin_daily_txns) as artemis_stablecoin_daily_txns | ||
, case | ||
when sum(artemis_stablecoin_daily_txns) > 0 then sum(artemis_stablecoin_transfer_volume) / sum(artemis_stablecoin_daily_txns) | ||
else 0 | ||
end as artemis_stablecoin_avg_txn_value | ||
, count(distinct case when p2p_stablecoin_daily_txns > 0 then from_address end) as p2p_stablecoin_dau | ||
, sum(p2p_stablecoin_transfer_volume) as p2p_stablecoin_transfer_volume | ||
, sum(p2p_stablecoin_daily_txns) as p2p_stablecoin_daily_txns | ||
, case | ||
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 | ||
|
||
, sum(stablecoin_supply) as stablecoin_supply | ||
, sum(case when is_wallet::number = 1 then stablecoin_supply else 0 end) as p2p_stablecoin_supply | ||
from {{ ref("agg_daily_stablecoin_breakdown_silver") }} | ||
group by date, symbol | ||
order by date |
32 changes: 32 additions & 0 deletions
32
models/metrics/stablecoins/breakdowns/agg_daily_stablecoin_breakdown_symbol_chain.sql
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{{ config(materialized="table", snowflake_warehouse="STABLECOIN_V2_LG_2") }} | ||
select | ||
date | ||
, chain | ||
, symbol | ||
, count(distinct case when stablecoin_daily_txns > 0 then from_address end) as stablecoin_dau | ||
, sum(stablecoin_transfer_volume) as stablecoin_transfer_volume | ||
, sum(stablecoin_daily_txns) as stablecoin_daily_txns | ||
, case | ||
when sum(stablecoin_daily_txns) > 0 then sum(stablecoin_transfer_volume) / sum(stablecoin_daily_txns) | ||
else 0 | ||
end as stablecoin_avg_txn_value | ||
, count(distinct case when artemis_stablecoin_daily_txns > 0 then from_address end) as artemis_stablecoin_dau | ||
, sum(artemis_stablecoin_transfer_volume) as artemis_stablecoin_transfer_volume | ||
, sum(artemis_stablecoin_daily_txns) as artemis_stablecoin_daily_txns | ||
, case | ||
when sum(artemis_stablecoin_daily_txns) > 0 then sum(artemis_stablecoin_transfer_volume) / sum(artemis_stablecoin_daily_txns) | ||
else 0 | ||
end as artemis_stablecoin_avg_txn_value | ||
, count(distinct case when p2p_stablecoin_daily_txns > 0 then from_address end) as p2p_stablecoin_dau | ||
, sum(p2p_stablecoin_transfer_volume) as p2p_stablecoin_transfer_volume | ||
, sum(p2p_stablecoin_daily_txns) as p2p_stablecoin_daily_txns | ||
, case | ||
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 | ||
|
||
, sum(stablecoin_supply) as stablecoin_supply | ||
, sum(case when is_wallet::number = 1 then stablecoin_supply else 0 end) as p2p_stablecoin_supply | ||
from {{ ref("agg_daily_stablecoin_breakdown_silver") }} | ||
group by date, symbol, chain | ||
order by date |