-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds: models for metal chain (#1576)
* add: metal models * add: metal to contracts directory
- Loading branch information
Showing
10 changed files
with
118 additions
and
0 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
19 changes: 19 additions & 0 deletions
19
warehouse/dbt/models/intermediate/blockchain/int_metal_contract_invocation_events.sql
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,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'" %} | ||
{% endif %} | ||
{{ contract_invocation_events_with_l1("metal", start) }} |
14 changes: 14 additions & 0 deletions
14
warehouse/dbt/models/intermediate/blockchain/int_metal_traces.sql
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,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("METAL", "metal", "traces") }} |
14 changes: 14 additions & 0 deletions
14
warehouse/dbt/models/intermediate/blockchain/int_metal_transactions.sql
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,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("METAL", "metal", "transactions") }} |
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
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
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,13 @@ | ||
sources: | ||
- name: metal | ||
database: opensource-observer | ||
schema: superchain | ||
tables: | ||
- name: blocks | ||
identifier: metal_blocks | ||
|
||
- name: transactions | ||
identifier: metal_transactions | ||
|
||
- name: traces | ||
identifier: metal_traces |
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
14 changes: 14 additions & 0 deletions
14
warehouse/dbt/models/staging/metal/stg_metal__deployers.sql
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,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("metal") }} |
14 changes: 14 additions & 0 deletions
14
warehouse/dbt/models/staging/metal/stg_metal__factories.sql
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,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" | ||
) | ||
}} | ||
{{ factory_deployments("metal") }} |