Skip to content

Commit

Permalink
Stablecoin V2: Create Arbitrum Lineage, incremental `stablecoin_metri…
Browse files Browse the repository at this point in the history
…cs` (#313)
  • Loading branch information
SebMelendez01 authored Jul 18, 2024
1 parent bbc2a1e commit 3f480bf
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 1 deletion.
12 changes: 12 additions & 0 deletions macros/stablecoins/stablecoin_metrics.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
{% endif %}
, unique_id
from {{ ref("fact_" ~ chain ~ "_stablecoin_balances")}}
{% if is_incremental() %}
where date > (select dateadd('day', -3, max(date)) from {{ this }})
{% endif %}
)
, all_metrics as (
select
Expand All @@ -27,6 +30,9 @@
, stablecoin_daily_txns
, unique_id
from {{ ref("fact_" ~ chain ~ "_stablecoin_metrics_all")}}
{% if is_incremental() %}
where date > (select dateadd('day', -3, max(date)) from {{ this }})
{% endif %}
)
, artemis_metrics as (
select
Expand All @@ -38,6 +44,9 @@
, stablecoin_daily_txns as artemis_stablecoin_daily_txns
, unique_id
from {{ ref("fact_" ~ chain ~ "_stablecoin_metrics_artemis")}}
{% if is_incremental() %}
where date > (select dateadd('day', -3, max(date)) from {{ this }})
{% endif %}
)
, p2p_metrics as (
select
Expand All @@ -49,6 +58,9 @@
, stablecoin_daily_txns as p2p_stablecoin_daily_txns
, unique_id
from {{ ref("fact_" ~ chain ~ "_stablecoin_metrics_p2p")}}
{% if is_incremental() %}
where date > (select dateadd('day', -3, max(date)) from {{ this }})
{% endif %}
)
, chain_stablecoin_metrics as (
select
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{
config(
materialized="incremental",
unique_key="unique_id",
database="arbitrum",
schema="core",
alias="ez_stablecoin_metrics_by_address",
snowflake_warehouse="STABLECOIN_V2_LG_2",
)
}}


{{stablecoin_metrics("arbitrum")}}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{
config(
materialized="table",
materialized="incremental",
unique_key="unique_id",
database="base",
schema="core",
Expand Down
10 changes: 10 additions & 0 deletions models/staging/arbitrum/fact_arbitrum_stablecoin_balances.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{
config(
materialized="incremental",
unique_key="unique_id",
snowflake_warehouse="STABLECOIN_V2_LG_2",
)
}}


{{stablecoin_balances("arbitrum")}}
10 changes: 10 additions & 0 deletions models/staging/arbitrum/fact_arbitrum_stablecoin_metrics_all.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{
config(
materialized="table",
unique_key="unique_id",
snowflake_warehouse="STABLECOIN_V2_LG_2",
)
}}


{{stablecoin_metrics_all("arbitrum")}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{
config(
materialized="table",
unique_key="unique_id",
snowflake_warehouse="STABLECOIN_V2_LG_2",
)
}}


{{stablecoin_metrics_p2p("arbitrum")}}
10 changes: 10 additions & 0 deletions models/staging/arbitrum/fact_arbitrum_stablecoin_metrics_p2p.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{
config(
materialized="table",
unique_key="unique_id",
snowflake_warehouse="STABLECOIN_V2_LG_2",
)
}}


{{stablecoin_metrics_p2p("arbitrum")}}

0 comments on commit 3f480bf

Please sign in to comment.