-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
23 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{% macro get_contract_deployments(chain) %} | ||
select | ||
'{{chain}}' as chain, | ||
date_trunc(week, block_timestamp) as date, | ||
count(distinct from_address) as contract_deployers, | ||
count(*) as contracts_deployed | ||
from {{chain}}_flipside.core.fact_traces | ||
where type in ('CREATE', 'CREATE2') | ||
and TRACE_STATUS = 'SUCCESS' | ||
{% if is_incremental() %} | ||
and block_timestamp >= (select max(date) from {{ this }}) | ||
{% endif %} | ||
group by date | ||
order by date desc | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,3 @@ | ||
{{ config(materialized="incremental", unique_key="date") }} | ||
{{ config(materialized="incremental", unique_key="date", snowflake_warehouse='ARBITRUM_MD') }} | ||
|
||
select | ||
'arbitrum' as chain, | ||
date_trunc(week, block_timestamp) as date, | ||
count(distinct from_address) as contract_deployers, | ||
count(*) as contracts_deployed | ||
from arbitrum_flipside.core.fact_transactions | ||
where | ||
to_address is null | ||
{% if is_incremental() %} | ||
and block_timestamp >= (select max(date) from {{ this }}) | ||
{% endif %} | ||
group by date | ||
order by date desc | ||
{{get_contract_deployments("arbitrum")}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,3 @@ | ||
{{ config(materialized="incremental", unique_key="date") }} | ||
{{ config(materialized="incremental", unique_key="date", snowflake_warehouse='BASE_MD') }} | ||
|
||
select | ||
'base' as chain, | ||
date_trunc(week, block_timestamp) as date, | ||
count(distinct from_address) as contract_deployers, | ||
count(*) as contracts_deployed | ||
from base_flipside.core.fact_transactions | ||
where | ||
to_address is null | ||
{% if is_incremental() %} | ||
and block_timestamp >= (select max(date) from {{ this }}) | ||
{% endif %} | ||
group by date | ||
order by date desc | ||
{{get_contract_deployments("base")}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,3 @@ | ||
{{ config(materialized="incremental", unique_key="date") }} | ||
{{ config(materialized="incremental", unique_key="date", snowflake_warehouse='ETHEREUM') }} | ||
|
||
select | ||
'ethereum' as chain, | ||
date_trunc(week, block_timestamp) as date, | ||
count(distinct from_address) as contract_deployers, | ||
count(*) as contracts_deployed | ||
from ethereum_flipside.core.fact_transactions | ||
where | ||
to_address is null | ||
{% if is_incremental() %} | ||
and block_timestamp >= (select max(date) from {{ this }}) | ||
{% endif %} | ||
group by date | ||
order by date desc | ||
{{get_contract_deployments("ethereum")}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,3 @@ | ||
{{ config(materialized="incremental", unique_key="date") }} | ||
{{ config(materialized="incremental", unique_key="date", snowflake_warehouse='OPTIMISM_MD') }} | ||
|
||
select | ||
'optimism' as chain, | ||
date_trunc(week, block_timestamp) as date, | ||
count(distinct from_address) as contract_deployers, | ||
count(*) as contracts_deployed | ||
from optimism_flipside.core.fact_transactions | ||
where | ||
to_address is null | ||
{% if is_incremental() %} | ||
and block_timestamp >= (select max(date) from {{ this }}) | ||
{% endif %} | ||
group by date | ||
order by date desc | ||
{{get_contract_deployments("optimism")}} |