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

feat(dbt): adds source and staging models for arb1 events #2197

Merged
merged 6 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
13 changes: 13 additions & 0 deletions warehouse/dbt/models/arbitrum_one_sources.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
sources:
- name: arbitrum_one
database: opensource-observer
schema: arbitrum_one
tables:
- name: transactions
identifier: arbitrum_transactions

- name: blocks
identifier: arbitrum_blocks

- name: traces
identifier: arbitrum_traces
15 changes: 0 additions & 15 deletions warehouse/dbt/models/arbitrum_sources.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
)
}}

{% set networks = ["optimism", "base", "frax", "metal", "mode", "zora"] %}
{% set networks = ["optimism", "base", "frax", "metal", "mode", "zora", "arbitrum_one"] %}

{% set union_queries = [] %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
)
}}

{% set networks = ["optimism", "base", "frax", "metal", "mode", "zora"] %}
{% set networks = ["optimism", "base", "frax", "metal", "mode", "zora", "arbitrum_one"] %}

{% set union_queries = [] %}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{# any from address coming out of a proxy #}

{% set networks = ["optimism", "base", "frax", "metal", "mode", "zora"] %}
{% set networks = ["optimism", "base", "frax", "metal", "mode", "zora", "arbitrum_one"] %}

{% set union_queries = [] %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
)
}}

{% set networks = ["optimism", "base", "frax", "metal", "mode", "zora"] %}
{% set networks = ["optimism", "base", "frax", "metal", "mode", "zora", "arbitrum_one"] %}

{% set union_queries = [] %}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{
config(
materialized='incremental',
partition_by={
"field": "time",
"data_type": "timestamp",
"granularity": "day",
},
unique_id="id",
on_schema_change="append_new_columns",
incremental_strategy="insert_overwrite"
)
}}
{% if is_incremental() %}
{% set start = "TIMESTAMP_SUB(_dbt_max_partition, INTERVAL 1 DAY)" %}
{% else %}
{% set start = "'1970-01-01'" %}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ravenac95 check for gas logic

{% endif %}
{{ contract_invocation_events_with_l1("arbitrum_one", start) }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{
config(
materialized='incremental',
partition_by={
"field": "block_timestamp",
"data_type": "timestamp",
"granularity": "day",
},
unique_id="id",
on_schema_change="append_new_columns",
incremental_strategy="insert_overwrite"
)
}}
{{ filtered_blockchain_events("BASE", "base", "traces") }}
ccerv1 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{
config(
materialized='incremental',
partition_by={
"field": "block_timestamp",
"data_type": "timestamp",
"granularity": "day",
},
unique_id="id",
on_schema_change="append_new_columns",
incremental_strategy="insert_overwrite"
)
}}
{{ filtered_blockchain_events("arbitrum_one", "base", "transactions") }}
ccerv1 marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions warehouse/dbt/models/intermediate/events/int_events.sql
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ all_events as (
select * from {{ ref('int_pgn_contract_invocation_events') }}
union all
select * from {{ ref('int_zora_contract_invocation_events') }}
union all
select * from {{ ref('int_arbitrum_one_contract_invocation_events') }}
)
union all
select
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{
config(
materialized='incremental',
partition_by={
"field": "block_timestamp",
"data_type": "timestamp",
"granularity": "day",
},
unique_id="transaction_hash",
on_schema_change="append_new_columns",
incremental_strategy="insert_overwrite"
)
}}
{{ transactions_with_receipts_deployers("arbitrum_one") }}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
unique_id="transaction_hash",
on_schema_change="append_new_columns",
incremental_strategy="insert_overwrite"
)
)
}}
{{ goog_blockchain_deployers("arbitrum") }}
{{ factory_deployments("arbitrum_one") }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{
config(
materialized='incremental',
partition_by={
"field": "block_timestamp",
"data_type": "timestamp",
"granularity": "day",
},
unique_key="id",
on_schema_change="append_new_columns",
incremental_strategy="insert_overwrite"
)
}}
{% if is_incremental() %}
{% set start = "TIMESTAMP_SUB(_dbt_max_partition, INTERVAL 1 DAY)" %}
{% else %}
{% set start = "'1970-01-01'" %}
{% endif %}
{{ known_proxies("arbitrum_one", start) }}
Loading