Skip to content

Commit

Permalink
1inch-U28: optimize main lineage — pre-materialize traces for looped …
Browse files Browse the repository at this point in the history
…queries (duneanalytics#6234)

* push

* push

* Delete oneinch_project_orders_macro.sql

* push

* apply easy dates for CI

* changes

* retrigger ci

* Revert "apply easy dates for CI"

This reverts commit 5b6db9c.

* push

* BREAK CI

* bring back old versions

* Revert "BREAK CI"

This reverts commit d0624ee.

* try block_time join

* Revert "try block_time join"

This reverts commit f92ce3f.

* all tables

* easy dates

* ts

* Revert "easy dates"

This reverts commit 3067d31.

* block_date key + join

* Reapply "easy dates"

This reverts commit 222d858.

* Revert "Reapply "easy dates""

This reverts commit fe5fe2f.
  • Loading branch information
grkhr authored Jun 27, 2024
1 parent e0c5a45 commit e86d27c
Show file tree
Hide file tree
Showing 24 changed files with 922 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% set blockchain = 'arbitrum' %}



{{
config(
schema = 'oneinch_' + blockchain,
alias = 'ar_raw_traces',
partition_by = ['block_date'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')],
unique_key = ['tx_hash', 'trace_address', 'block_date']
)
}}



{{
oneinch_ar_raw_traces_macro(
blockchain = blockchain
)
}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% set blockchain = 'arbitrum' %}



{{
config(
schema = 'oneinch_' + blockchain,
alias = 'lop_raw_traces',
partition_by = ['block_date'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')],
unique_key = ['tx_hash', 'trace_address', 'block_date']
)
}}



{{
oneinch_lop_raw_traces_macro(
blockchain = blockchain
)
}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% set blockchain = 'avalanche_c' %}



{{
config(
schema = 'oneinch_' + blockchain,
alias = 'ar_raw_traces',
partition_by = ['block_date'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')],
unique_key = ['tx_hash', 'trace_address', 'block_date']
)
}}



{{
oneinch_ar_raw_traces_macro(
blockchain = blockchain
)
}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% set blockchain = 'avalanche_c' %}



{{
config(
schema = 'oneinch_' + blockchain,
alias = 'lop_raw_traces',
partition_by = ['block_date'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')],
unique_key = ['tx_hash', 'trace_address', 'block_date']
)
}}



{{
oneinch_lop_raw_traces_macro(
blockchain = blockchain
)
}}
24 changes: 24 additions & 0 deletions dex/models/_projects/oneinch/base/oneinch_base_ar_raw_traces.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% set blockchain = 'base' %}



{{
config(
schema = 'oneinch_' + blockchain,
alias = 'ar_raw_traces',
partition_by = ['block_date'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')],
unique_key = ['tx_hash', 'trace_address', 'block_date']
)
}}



{{
oneinch_ar_raw_traces_macro(
blockchain = blockchain
)
}}
24 changes: 24 additions & 0 deletions dex/models/_projects/oneinch/base/oneinch_base_lop_raw_traces.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% set blockchain = 'base' %}



{{
config(
schema = 'oneinch_' + blockchain,
alias = 'lop_raw_traces',
partition_by = ['block_date'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')],
unique_key = ['tx_hash', 'trace_address', 'block_date']
)
}}



{{
oneinch_lop_raw_traces_macro(
blockchain = blockchain
)
}}
24 changes: 24 additions & 0 deletions dex/models/_projects/oneinch/bnb/oneinch_bnb_ar_raw_traces.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% set blockchain = 'bnb' %}



{{
config(
schema = 'oneinch_' + blockchain,
alias = 'ar_raw_traces',
partition_by = ['block_date'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')],
unique_key = ['tx_hash', 'trace_address', 'block_date']
)
}}



{{
oneinch_ar_raw_traces_macro(
blockchain = blockchain
)
}}
24 changes: 24 additions & 0 deletions dex/models/_projects/oneinch/bnb/oneinch_bnb_lop_raw_traces.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% set blockchain = 'bnb' %}



{{
config(
schema = 'oneinch_' + blockchain,
alias = 'lop_raw_traces',
partition_by = ['block_date'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')],
unique_key = ['tx_hash', 'trace_address', 'block_date']
)
}}



{{
oneinch_lop_raw_traces_macro(
blockchain = blockchain
)
}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% set blockchain = 'ethereum' %}



{{
config(
schema = 'oneinch_' + blockchain,
alias = 'ar_raw_traces',
partition_by = ['block_date'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')],
unique_key = ['tx_hash', 'trace_address', 'block_date']
)
}}



{{
oneinch_ar_raw_traces_macro(
blockchain = blockchain
)
}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% set blockchain = 'ethereum' %}



{{
config(
schema = 'oneinch_' + blockchain,
alias = 'lop_raw_traces',
partition_by = ['block_date'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')],
unique_key = ['tx_hash', 'trace_address', 'block_date']
)
}}



{{
oneinch_lop_raw_traces_macro(
blockchain = blockchain
)
}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% set blockchain = 'fantom' %}



{{
config(
schema = 'oneinch_' + blockchain,
alias = 'ar_raw_traces',
partition_by = ['block_date'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')],
unique_key = ['tx_hash', 'trace_address', 'block_date']
)
}}



{{
oneinch_ar_raw_traces_macro(
blockchain = blockchain
)
}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% set blockchain = 'fantom' %}



{{
config(
schema = 'oneinch_' + blockchain,
alias = 'lop_raw_traces',
partition_by = ['block_date'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')],
unique_key = ['tx_hash', 'trace_address', 'block_date']
)
}}



{{
oneinch_lop_raw_traces_macro(
blockchain = blockchain
)
}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% set blockchain = 'gnosis' %}



{{
config(
schema = 'oneinch_' + blockchain,
alias = 'ar_raw_traces',
partition_by = ['block_date'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')],
unique_key = ['tx_hash', 'trace_address', 'block_date']
)
}}



{{
oneinch_ar_raw_traces_macro(
blockchain = blockchain
)
}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% set blockchain = 'gnosis' %}



{{
config(
schema = 'oneinch_' + blockchain,
alias = 'lop_raw_traces',
partition_by = ['block_date'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')],
unique_key = ['tx_hash', 'trace_address', 'block_date']
)
}}



{{
oneinch_lop_raw_traces_macro(
blockchain = blockchain
)
}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% set blockchain = 'optimism' %}



{{
config(
schema = 'oneinch_' + blockchain,
alias = 'ar_raw_traces',
partition_by = ['block_date'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')],
unique_key = ['tx_hash', 'trace_address', 'block_date']
)
}}



{{
oneinch_ar_raw_traces_macro(
blockchain = blockchain
)
}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% set blockchain = 'optimism' %}



{{
config(
schema = 'oneinch_' + blockchain,
alias = 'lop_raw_traces',
partition_by = ['block_date'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')],
unique_key = ['tx_hash', 'trace_address', 'block_date']
)
}}



{{
oneinch_lop_raw_traces_macro(
blockchain = blockchain
)
}}
Loading

0 comments on commit e86d27c

Please sign in to comment.