From 041e390439551009df2283ea7f3af21aee842561 Mon Sep 17 00:00:00 2001 From: Anthony Yim Date: Fri, 28 Jun 2024 14:19:35 -0400 Subject: [PATCH] Add metrics breakdown table for EVM chains (#259) --- .../dimensions/contracts/dim_base_contract_addresses.sql | 2 +- .../contracts/dim_blast_contract_addresses.sql | 8 ++++++++ .../dimensions/contracts/dim_bsc_contract_addresses.sql | 8 ++++++++ .../agg_arbitrum_daily_stablecoin_metrics_breakdown.sql | 9 +++++++++ .../agg_avalanche_daily_stablecoin_metrics_breakdown.sql | 9 +++++++++ .../agg_blast_daily_stablecoin_metrics_breakdown.sql | 9 +++++++++ .../bsc/agg_bsc_daily_stablecoin_metrics_breakdown.sql | 9 +++++++++ .../agg_optimism_daily_stablecoin_metrics_breakdown.sql | 9 +++++++++ .../agg_polygon_daily_stablecoin_metrics_breakdown.sql | 9 +++++++++ 9 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 models/dimensions/contracts/dim_blast_contract_addresses.sql create mode 100644 models/dimensions/contracts/dim_bsc_contract_addresses.sql create mode 100644 models/staging/arbitrum/agg_arbitrum_daily_stablecoin_metrics_breakdown.sql create mode 100644 models/staging/avalanche/agg_avalanche_daily_stablecoin_metrics_breakdown.sql create mode 100644 models/staging/blast/agg_blast_daily_stablecoin_metrics_breakdown.sql create mode 100644 models/staging/bsc/agg_bsc_daily_stablecoin_metrics_breakdown.sql create mode 100644 models/staging/optimism/agg_optimism_daily_stablecoin_metrics_breakdown.sql create mode 100644 models/staging/polygon/agg_polygon_daily_stablecoin_metrics_breakdown.sql diff --git a/models/dimensions/contracts/dim_base_contract_addresses.sql b/models/dimensions/contracts/dim_base_contract_addresses.sql index 309e139e..2fbe3ef5 100644 --- a/models/dimensions/contracts/dim_base_contract_addresses.sql +++ b/models/dimensions/contracts/dim_base_contract_addresses.sql @@ -5,4 +5,4 @@ ) }} -{{distinct_contract_addresses("base")}} \ No newline at end of file +{{distinct_contract_addresses("base")}} diff --git a/models/dimensions/contracts/dim_blast_contract_addresses.sql b/models/dimensions/contracts/dim_blast_contract_addresses.sql new file mode 100644 index 00000000..bf1419a0 --- /dev/null +++ b/models/dimensions/contracts/dim_blast_contract_addresses.sql @@ -0,0 +1,8 @@ +{{ + config( + materialized="incremental", + snowflake_warehouse="BLAST" + ) +}} + +{{distinct_contract_addresses("blast")}} diff --git a/models/dimensions/contracts/dim_bsc_contract_addresses.sql b/models/dimensions/contracts/dim_bsc_contract_addresses.sql new file mode 100644 index 00000000..4155ec02 --- /dev/null +++ b/models/dimensions/contracts/dim_bsc_contract_addresses.sql @@ -0,0 +1,8 @@ +{{ + config( + materialized="incremental", + snowflake_warehouse="BSC" + ) +}} + +{{distinct_contract_addresses("bsc")}} diff --git a/models/staging/arbitrum/agg_arbitrum_daily_stablecoin_metrics_breakdown.sql b/models/staging/arbitrum/agg_arbitrum_daily_stablecoin_metrics_breakdown.sql new file mode 100644 index 00000000..0a95d9d6 --- /dev/null +++ b/models/staging/arbitrum/agg_arbitrum_daily_stablecoin_metrics_breakdown.sql @@ -0,0 +1,9 @@ +{{ + config( + materialized="incremental", + unique_key=["date", "contract_address", "from_address"], + snowflake_warehouse="BALANCES_LG", + ) +}} + +{{ agg_daily_stablecoin_metrics_breakdown("arbitrum") }} diff --git a/models/staging/avalanche/agg_avalanche_daily_stablecoin_metrics_breakdown.sql b/models/staging/avalanche/agg_avalanche_daily_stablecoin_metrics_breakdown.sql new file mode 100644 index 00000000..56a9bf83 --- /dev/null +++ b/models/staging/avalanche/agg_avalanche_daily_stablecoin_metrics_breakdown.sql @@ -0,0 +1,9 @@ +{{ + config( + materialized="incremental", + unique_key=["date", "contract_address", "from_address"], + snowflake_warehouse="BALANCES_LG_2", + ) +}} + +{{ agg_daily_stablecoin_metrics_breakdown("avalanche") }} diff --git a/models/staging/blast/agg_blast_daily_stablecoin_metrics_breakdown.sql b/models/staging/blast/agg_blast_daily_stablecoin_metrics_breakdown.sql new file mode 100644 index 00000000..fa85c865 --- /dev/null +++ b/models/staging/blast/agg_blast_daily_stablecoin_metrics_breakdown.sql @@ -0,0 +1,9 @@ +{{ + config( + materialized="incremental", + unique_key=["date", "contract_address", "from_address"], + snowflake_warehouse="BALANCES_LG_2", + ) +}} + +{{ agg_daily_stablecoin_metrics_breakdown("blast") }} diff --git a/models/staging/bsc/agg_bsc_daily_stablecoin_metrics_breakdown.sql b/models/staging/bsc/agg_bsc_daily_stablecoin_metrics_breakdown.sql new file mode 100644 index 00000000..06951b30 --- /dev/null +++ b/models/staging/bsc/agg_bsc_daily_stablecoin_metrics_breakdown.sql @@ -0,0 +1,9 @@ +{{ + config( + materialized="incremental", + unique_key=["date", "contract_address", "from_address"], + snowflake_warehouse="BALANCES_LG", + ) +}} + +{{ agg_daily_stablecoin_metrics_breakdown("bsc") }} diff --git a/models/staging/optimism/agg_optimism_daily_stablecoin_metrics_breakdown.sql b/models/staging/optimism/agg_optimism_daily_stablecoin_metrics_breakdown.sql new file mode 100644 index 00000000..e65a842b --- /dev/null +++ b/models/staging/optimism/agg_optimism_daily_stablecoin_metrics_breakdown.sql @@ -0,0 +1,9 @@ +{{ + config( + materialized="incremental", + unique_key=["date", "contract_address", "from_address"], + snowflake_warehouse="BALANCES_LG_2", + ) +}} + +{{ agg_daily_stablecoin_metrics_breakdown("optimism") }} diff --git a/models/staging/polygon/agg_polygon_daily_stablecoin_metrics_breakdown.sql b/models/staging/polygon/agg_polygon_daily_stablecoin_metrics_breakdown.sql new file mode 100644 index 00000000..fe333011 --- /dev/null +++ b/models/staging/polygon/agg_polygon_daily_stablecoin_metrics_breakdown.sql @@ -0,0 +1,9 @@ +{{ + config( + materialized="incremental", + unique_key=["date", "contract_address", "from_address"], + snowflake_warehouse="BALANCES_LG_2", + ) +}} + +{{ agg_daily_stablecoin_metrics_breakdown("polygon") }}