diff --git a/models/data_hubs/fact_daily_app_datahub.sql b/models/data_hubs/fact_daily_app_datahub.sql index 059bc182..9ad6f6cd 100644 --- a/models/data_hubs/fact_daily_app_datahub.sql +++ b/models/data_hubs/fact_daily_app_datahub.sql @@ -6,7 +6,6 @@ with relations=[ ref("agg_daily_app_fundamental_usage"), ref("fact_stargate_bridge_volume_gold"), - ref("fact_venus_lending_bsc_gold"), ref("fact_sushiswap_arbitrum_gold"), ref("fact_sushiswap_avalanche_gold"), ref("fact_sushiswap_bsc_gold"), @@ -24,13 +23,9 @@ with ref("fact_pancakeswap_bsc_gold"), ref("fact_pancakeswap_ethereum_gold"), ref("fact_apex_trading_volume_gold"), - ref("fact_seamless_protocol_base_borrows_deposits_gold"), ref("fact_uwu_lend_ethereum_borrows_deposits_gold"), ref("fact_aevo_trading_volume_gold"), - ref("fact_sonne_optimism_borrows_deposits_gold"), - ref("fact_sonne_base_borrows_deposits_gold"), ref("fact_moonwell_base_borrows_deposits_gold"), - ref("fact_benqi_avalanche_borrows_deposits_gold"), ref("fact_quickswap_polygon_gold"), ref("fact_fraxswap_ethereum_gold"), ref("fact_trader_joe_arbitrum_gold"), diff --git a/models/projects/benqi/core/ez_benqi_metrics_by_chain.sql b/models/projects/benqi/core/ez_benqi_metrics_by_chain.sql new file mode 100644 index 00000000..12f4e0ee --- /dev/null +++ b/models/projects/benqi/core/ez_benqi_metrics_by_chain.sql @@ -0,0 +1,29 @@ +{{ + config( + materialized="table", + snowflake_warehouse="BENQI_FINANCE", + database="benqi_finance", + schema="core", + alias="ez_metrics_by_chain", + ) +}} + +with + benqi_by_chain as ( + {{ + dbt_utils.union_relations( + relations=[ + ref("fact_benqi_avalanche_borrows_deposits_gold"), + ], + ) + }} + ) +select + benqi_by_chain.date, + 'benqi' as app, + 'DeFi' as category, + benqi_by_chain.chain, + benqi_by_chain.daily_borrows_usd, + benqi_by_chain.daily_supply_usd +from benqi_by_chain +where benqi_by_chain.date < to_date(sysdate()) \ No newline at end of file diff --git a/models/projects/seamless/core/ez_seamless_metrics_by_chain.sql b/models/projects/seamless/core/ez_seamless_metrics_by_chain.sql new file mode 100644 index 00000000..8e109235 --- /dev/null +++ b/models/projects/seamless/core/ez_seamless_metrics_by_chain.sql @@ -0,0 +1,29 @@ +{{ + config( + materialized="table", + snowflake_warehouse="SEAMLESSPROTOCOL", + database="seamlessprotocol", + schema="core", + alias="ez_metrics_by_chain", + ) +}} + +with + seamless_by_chain as ( + {{ + dbt_utils.union_relations( + relations=[ + ref("fact_seamless_protocol_base_borrows_deposits_gold"), + ], + ) + }} + ) +select + seamless_by_chain.date, + 'seamless' as app, + 'DeFi' as category, + seamless_by_chain.chain, + seamless_by_chain.daily_borrows_usd, + seamless_by_chain.daily_supply_usd +from seamless_by_chain +where seamless_by_chain.date < to_date(sysdate()) \ No newline at end of file diff --git a/models/projects/sonne/core/ez_sonne_metrics_by_chain.sql b/models/projects/sonne/core/ez_sonne_metrics_by_chain.sql new file mode 100644 index 00000000..612fee95 --- /dev/null +++ b/models/projects/sonne/core/ez_sonne_metrics_by_chain.sql @@ -0,0 +1,30 @@ +{{ + config( + materialized="table", + snowflake_warehouse="SONNE_FINANCE", + database="sonne_finance", + schema="core", + alias="ez_metrics_by_chain", + ) +}} + +with + sonne_by_chain as ( + {{ + dbt_utils.union_relations( + relations=[ + ref("fact_sonne_base_borrows_deposits_gold"), + ref("fact_sonne_optimism_borrows_deposits_gold"), + ], + ) + }} + ) +select + sonne_by_chain.date, + 'sonne' as app, + 'DeFi' as category, + sonne_by_chain.chain, + sonne_by_chain.daily_borrows_usd, + sonne_by_chain.daily_supply_usd +from sonne_by_chain +where sonne_by_chain.date < to_date(sysdate()) \ No newline at end of file diff --git a/models/projects/venus/core/ez_venus_metrics_by_chain.sql b/models/projects/venus/core/ez_venus_metrics_by_chain.sql new file mode 100644 index 00000000..6874a106 --- /dev/null +++ b/models/projects/venus/core/ez_venus_metrics_by_chain.sql @@ -0,0 +1,29 @@ +{{ + config( + materialized="table", + snowflake_warehouse="venus", + database="venus", + schema="core", + alias="ez_metrics_by_chain", + ) +}} + +with + venus_by_chain as ( + {{ + dbt_utils.union_relations( + relations=[ + ref("fact_venus_v4_lending_bsc_gold"), + ], + ) + }} + ) +select + venus_by_chain.date, + 'venus' as app, + 'DeFi' as category, + venus_by_chain.chain, + venus_by_chain.daily_borrows_usd, + venus_by_chain.daily_supply_usd +from venus_by_chain +where venus_by_chain.date < to_date(sysdate()) \ No newline at end of file diff --git a/models/staging/benqi/fact_benqi_avalanche_borrows_deposits.sql b/models/staging/benqi/fact_benqi_avalanche_borrows_deposits.sql index 9b7d6f25..8838f10a 100644 --- a/models/staging/benqi/fact_benqi_avalanche_borrows_deposits.sql +++ b/models/staging/benqi/fact_benqi_avalanche_borrows_deposits.sql @@ -1,4 +1,4 @@ -{{ config(materialized="table") }} +{{ config(materialized="table", snowflake_warehouse="BENQI_FINANCE") }} {{ fact_compound_v2_fork_lending( "raw_benqi_avalanche_borrows_deposits", "avalanche", "benqi_finance" diff --git a/models/staging/benqi/fact_benqi_avalanche_borrows_deposits_gold.sql b/models/staging/benqi/fact_benqi_avalanche_borrows_deposits_gold.sql index ba65e7d3..cc6a15ae 100644 --- a/models/staging/benqi/fact_benqi_avalanche_borrows_deposits_gold.sql +++ b/models/staging/benqi/fact_benqi_avalanche_borrows_deposits_gold.sql @@ -1,3 +1,3 @@ -{{ config(materialized="table") }} +{{ config(materialized="table", snowflake_warehouse="BENQI_FINANCE") }} select date, chain, app, category, daily_borrows_usd, daily_supply_usd from {{ ref("fact_benqi_avalanche_borrows_deposits") }} diff --git a/models/staging/seamless/fact_seamless_protocol_base_borrows_deposits.sql b/models/staging/seamless/fact_seamless_protocol_base_borrows_deposits.sql index 5f83acca..23ce725b 100644 --- a/models/staging/seamless/fact_seamless_protocol_base_borrows_deposits.sql +++ b/models/staging/seamless/fact_seamless_protocol_base_borrows_deposits.sql @@ -1,4 +1,4 @@ -{{ config(materialized="table") }} +{{ config(materialized="table", snowflake_warehouse="SEAMLESSPROTOCOL") }} {{ fact_aave_fork_lending( "raw_seamless_protocol_base_borrows_deposits", "base", "seamlessprotocol" diff --git a/models/staging/seamless/fact_seamless_protocol_base_borrows_deposits_gold.sql b/models/staging/seamless/fact_seamless_protocol_base_borrows_deposits_gold.sql index 735efaad..8acbfb2a 100644 --- a/models/staging/seamless/fact_seamless_protocol_base_borrows_deposits_gold.sql +++ b/models/staging/seamless/fact_seamless_protocol_base_borrows_deposits_gold.sql @@ -1,4 +1,4 @@ -{{ config(materialized="table") }} +{{ config(materialized="table", snowflake_warehouse="SEAMLESSPROTOCOL") }} select date, chain, diff --git a/models/staging/sonne/fact_sonne_base_borrows_deposits.sql b/models/staging/sonne/fact_sonne_base_borrows_deposits.sql index ad2462e7..9de07c48 100644 --- a/models/staging/sonne/fact_sonne_base_borrows_deposits.sql +++ b/models/staging/sonne/fact_sonne_base_borrows_deposits.sql @@ -1,4 +1,4 @@ -{{ config(materialized="table") }} +{{ config(materialized="table", snowflake_warehouse="SONNE_FINANCE") }} {{ fact_compound_v2_fork_lending( "raw_sonne_base_borrows_deposits", "base", "sonne_finance" diff --git a/models/staging/sonne/fact_sonne_base_borrows_deposits_gold.sql b/models/staging/sonne/fact_sonne_base_borrows_deposits_gold.sql index 76c43f41..e54184bd 100644 --- a/models/staging/sonne/fact_sonne_base_borrows_deposits_gold.sql +++ b/models/staging/sonne/fact_sonne_base_borrows_deposits_gold.sql @@ -1,3 +1,3 @@ -{{ config(materialized="table") }} +{{ config(materialized="table", snowflake_warehouse="SONNE_FINANCE") }} select date, chain, app, category, daily_borrows_usd, daily_supply_usd from {{ ref("fact_sonne_base_borrows_deposits") }} diff --git a/models/staging/sonne/fact_sonne_optimism_borrows_deposits.sql b/models/staging/sonne/fact_sonne_optimism_borrows_deposits.sql index b228c8ca..07e31da0 100644 --- a/models/staging/sonne/fact_sonne_optimism_borrows_deposits.sql +++ b/models/staging/sonne/fact_sonne_optimism_borrows_deposits.sql @@ -1,4 +1,4 @@ -{{ config(materialized="table") }} +{{ config(materialized="table", snowflake_warehouse="SONNE_FINANCE") }} {{ fact_compound_v2_fork_lending( "raw_sonne_optimism_borrows_deposits", "optimism", "sonne_finance" diff --git a/models/staging/sonne/fact_sonne_optimism_borrows_deposits_gold.sql b/models/staging/sonne/fact_sonne_optimism_borrows_deposits_gold.sql index 61702aa3..7a0dae57 100644 --- a/models/staging/sonne/fact_sonne_optimism_borrows_deposits_gold.sql +++ b/models/staging/sonne/fact_sonne_optimism_borrows_deposits_gold.sql @@ -1,3 +1,3 @@ -{{ config(materialized="table") }} +{{ config(materialized="table", snowflake_warehouse="SONNE_FINANCE") }} select date, chain, app, category, daily_borrows_usd, daily_supply_usd from {{ ref("fact_sonne_optimism_borrows_deposits") }} diff --git a/models/staging/venus/fact_venus_lending_bsc_gold.sql b/models/staging/venus/fact_venus_lending_bsc_gold.sql deleted file mode 100644 index 9c23ec6d..00000000 --- a/models/staging/venus/fact_venus_lending_bsc_gold.sql +++ /dev/null @@ -1,3 +0,0 @@ -{{ config(materialized="table") }} -select date, chain, 'venus' as app, category, daily_borrows_usd, daily_supply_usd -from {{ ref("fact_venus_v4_lending_bsc_gold") }} diff --git a/models/staging/venus/fact_venus_v4_lending_bsc_gold.sql b/models/staging/venus/fact_venus_v4_lending_bsc_gold.sql index 97acbeb9..6c2c1e30 100644 --- a/models/staging/venus/fact_venus_v4_lending_bsc_gold.sql +++ b/models/staging/venus/fact_venus_v4_lending_bsc_gold.sql @@ -1,3 +1,3 @@ -{{ config(materialized="table") }} -select date, chain, app, category, daily_borrows_usd, daily_supply_usd +{{ config(materialized="table", snowflake_warehouse="VENUS") }} +select date, chain, 'venus' as app, category, daily_borrows_usd, daily_supply_usd from {{ ref("fact_venus_v4_lending_bsc") }}