Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gnosis rolling #481

Merged
merged 3 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions databases.csv
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ FANTOM
FLOW
FLOW_FLIPSIDE
GEODNET
GNOSIS
GNOSIS_FLIPSIDE
HELIUM
IMMUTABLE_X
Expand Down
16 changes: 16 additions & 0 deletions macros/rolling_active_addresses.sql
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,22 @@
lateral flatten(input => outputs)
where from_address is not null
),
{% elif chain == 'gnosis' %}
distinct_dates as (
select
block_timestamp::date as raw_date
from gnosis_flipside.core.fact_transactions
{% if is_incremental() %}
where raw_date > (select dateadd('day', -1, max(date)) from {{ this }})
{% endif %}
),
distinct_dates_for_rolling_active_address as (
select distinct
block_timestamp::date as raw_date
, from_address as from_address
from gnosis_flipside.core.fact_transactions
where from_address is not null
),
{% else %}
distinct_dates as (
select distinct
Expand Down
4 changes: 4 additions & 0 deletions models/projects/gnosis/core/ez_gnosis_metrics.sql
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@ with
, github_data as ({{ get_github_metrics("gnosis") }})
, defillama_data as ({{ get_defillama_metrics("gnosis") }})
, price_data as ({{ get_coingecko_metrics("gnosis") }})
, rolling_metrics as ({{ get_rolling_active_address_metrics("gnosis") }})

select
fundamental_data.date
, 'gnosis' as chain
, txns
, dau
, mau
, wau
, fees
, fees_native
, revenue
Expand All @@ -47,4 +50,5 @@ from fundamental_data
left join github_data using (date)
left join defillama_data using (date)
left join price_data using (date)
left join rolling_metrics using (date)
where fundamental_data.date < to_date(sysdate())
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{
config(
materialized="incremental",
unique_key=["date"],
snowflake_warehouse="GNOSIS",
)
}}

{{ rolling_active_addresses("gnosis") }}
Loading