Skip to content

Commit

Permalink
adding new stablecoin models
Browse files Browse the repository at this point in the history
  • Loading branch information
SebMelendez01 committed Aug 14, 2024
1 parent 5f355ac commit e56eaf6
Show file tree
Hide file tree
Showing 7 changed files with 209 additions and 0 deletions.
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
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
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
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
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
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
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

0 comments on commit e56eaf6

Please sign in to comment.