-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zeroex - macro for deduped fills (#7156)
* deduped macro * add eth model via macro * revise ref table name * cast to date * remove/replace old model * update source method * source name * source name * table name * update macro, add base model * update source --------- Co-authored-by: Huang Geyang <[email protected]> Co-authored-by: jeff-dude <[email protected]>
- Loading branch information
1 parent
241e6a3
commit 30b95c5
Showing
7 changed files
with
73 additions
and
129 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
102 changes: 0 additions & 102 deletions
102
dbt_subprojects/dex/models/_projects/zeroex/base/zeroex_base_api_fills_deduped.sql
This file was deleted.
Oops, something went wrong.
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
30 changes: 30 additions & 0 deletions
30
dbt_subprojects/dex/models/_projects/zeroex/base/zeroex_v1_base_deduped_trades.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,30 @@ | ||
{{ config( | ||
schema = 'zeroex_v1_base', | ||
alias = 'deduped_trades', | ||
materialized='incremental', | ||
partition_by = ['block_month'], | ||
unique_key = ['block_date', 'tx_hash', 'evt_index'], | ||
on_schema_change='sync_all_columns', | ||
file_format ='delta', | ||
incremental_strategy='merge', | ||
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] | ||
) | ||
}} | ||
|
||
{% set zeroex_v3_start_date = '2019-12-01' %} | ||
{% set blockchain = 'base' %} | ||
|
||
WITH | ||
deduped_trades as ( | ||
{{ | ||
zeroex_v1_deduped_trades( | ||
blockchain = blockchain, | ||
start_date = zeroex_v3_start_date | ||
|
||
) | ||
}} | ||
|
||
) | ||
select | ||
* | ||
from deduped_trades |
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
30 changes: 30 additions & 0 deletions
30
dbt_subprojects/dex/models/_projects/zeroex/ethereum/zeroex_v1_ethereum_deduped_trades.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,30 @@ | ||
{{ config( | ||
schema = 'zeroex_v1_ethereum', | ||
alias = 'deduped_trades', | ||
materialized='incremental', | ||
partition_by = ['block_month'], | ||
unique_key = ['block_date', 'tx_hash', 'evt_index'], | ||
on_schema_change='sync_all_columns', | ||
file_format ='delta', | ||
incremental_strategy='merge', | ||
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] | ||
) | ||
}} | ||
|
||
{% set zeroex_v3_start_date = '2019-12-01' %} | ||
{% set blockchain = 'ethereum' %} | ||
|
||
WITH | ||
deduped_trades as ( | ||
{{ | ||
zeroex_v1_deduped_trades( | ||
blockchain = blockchain, | ||
start_date = zeroex_v3_start_date | ||
|
||
) | ||
}} | ||
|
||
) | ||
select | ||
* | ||
from deduped_trades |
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