-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
refactor: adjust fork maps to avoid decoding pipeline #7183
Open
0xBoxer
wants to merge
9
commits into
main
Choose a base branch
from
work-on-automated-dex-trades
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0165bcc
change back to a manual mapping
0xBoxer 2daae41
adjust stuff
0xBoxer bfc14cb
add files for base blockchain
0xBoxer 582f038
fix macro error
0xBoxer 5349a00
fix factory address in macro
0xBoxer afe7cfa
trigger rerun of pipeline with prices
0xBoxer d902e6b
adding existing not identified dexes
0xBoxer c9fd803
ssss
0xBoxer 37d5d3b
sss
0xBoxer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
76 changes: 76 additions & 0 deletions
76
dbt_subprojects/dex/models/automated_trades/base/projects/_schema.yml
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,76 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: dex_base_automated_base_trades | ||
description: "all dex trades on base, mass decoded" | ||
data_tests: | ||
- dbt_utils.unique_combination_of_columns: | ||
combination_of_columns: | ||
- tx_hash | ||
- evt_index | ||
|
||
- name: uniswap_v2_base_decoded_factory_evt | ||
description: > | ||
mass decoding of all forks of uniswap v2 factory contract on base | ||
data_tests: | ||
- dbt_utils.unique_combination_of_columns: | ||
combination_of_columns: | ||
- tx_hash | ||
- index | ||
|
||
- name: uniswap_v2_base_decoded_pool_evt_swap | ||
description: > | ||
mass decoding of all forks of uniswap v2 pool contracts on base | ||
data_tests: | ||
- dbt_utils.unique_combination_of_columns: | ||
combination_of_columns: | ||
- tx_hash | ||
- index | ||
|
||
- name: uniswap_v2_base_automated_base_trades | ||
meta: | ||
blockchain: base | ||
sector: dex | ||
project: uniswap | ||
contributors: 0xboxer | ||
config: | ||
tags: [ 'base', 'dex', 'trades', 'uniswap', 'v2', 'forks' ] | ||
description: "base trades for all forks of uniswap v2 on base" | ||
data_tests: | ||
- dbt_utils.unique_combination_of_columns: | ||
combination_of_columns: | ||
- tx_hash | ||
- evt_index | ||
|
||
- name: uniswap_v3_base_decoded_factory_evt | ||
description: > | ||
mass decoding of all forks of uniswap v3 factory contract on base | ||
data_tests: | ||
- dbt_utils.unique_combination_of_columns: | ||
combination_of_columns: | ||
- tx_hash | ||
- index | ||
|
||
- name: uniswap_v3_base_decoded_pool_evt_swap | ||
description: > | ||
mass decoding of all forks of uniswap v3 pool contracts on base | ||
data_tests: | ||
- dbt_utils.unique_combination_of_columns: | ||
combination_of_columns: | ||
- tx_hash | ||
- index | ||
|
||
- name: uniswap_v3_base_automated_base_trades | ||
meta: | ||
blockchain: base | ||
sector: dex | ||
project: uniswap | ||
contributors: 0xboxer | ||
config: | ||
tags: [ 'base', 'dex', 'trades', 'uniswap', 'v3', 'forks' ] | ||
description: "base trades for all forks of uniswap v3 on base" | ||
data_tests: | ||
- dbt_utils.unique_combination_of_columns: | ||
combination_of_columns: | ||
- tx_hash | ||
- evt_index |
52 changes: 52 additions & 0 deletions
52
dbt_subprojects/dex/models/automated_trades/base/projects/dex_base_automated_base_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,52 @@ | ||
{{ config( | ||
schema = 'dex_base' | ||
, alias = 'automated_base_trades' | ||
, materialized = 'view' | ||
) | ||
}} | ||
|
||
{% set base_models = [ | ||
ref('uniswap_v2_base_automated_base_trades') | ||
, ref('uniswap_v3_base_automated_base_trades') | ||
] %} | ||
|
||
WITH base_union AS ( | ||
SELECT * | ||
FROM ( | ||
{% for base_model in base_models %} | ||
SELECT | ||
blockchain | ||
, project | ||
, project_status | ||
, version | ||
, dex_type | ||
, factory_address | ||
, block_month | ||
, block_date | ||
, block_time | ||
, block_number | ||
, token_bought_amount_raw | ||
, token_sold_amount_raw | ||
, token_bought_address | ||
, token_sold_address | ||
, taker | ||
, maker | ||
, project_contract_address | ||
, tx_hash | ||
, evt_index | ||
FROM | ||
{{ base_model }} | ||
{% if not loop.last %} | ||
UNION ALL | ||
{% endif %} | ||
{% endfor %} | ||
) | ||
) | ||
|
||
{{ | ||
add_tx_columns( | ||
model_cte = 'base_union' | ||
, blockchain = 'base' | ||
, columns = ['from', 'to', 'index'] | ||
) | ||
}} |
20 changes: 20 additions & 0 deletions
20
...x/models/automated_trades/base/projects/uniswap/uniswap_v2_base_automated_base_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,20 @@ | ||
{{ config( | ||
schema = 'uniswap_v2_base', | ||
alias = 'automated_base_trades', | ||
partition_by = ['block_month'], | ||
materialized = 'incremental', | ||
file_format = 'delta', | ||
incremental_strategy = 'merge', | ||
unique_key = ['tx_hash', 'evt_index'], | ||
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] | ||
) | ||
}} | ||
|
||
{{ | ||
uniswap_v2_forks_trades( | ||
blockchain = 'base' | ||
, version = '2' | ||
, Pair_evt_Swap = ref('uniswap_v2_base_decoded_pool_evt_swap') | ||
, Factory_evt_PairCreated = ref('uniswap_v2_base_decoded_factory_evt') | ||
) | ||
}} |
15 changes: 15 additions & 0 deletions
15
...dex/models/automated_trades/base/projects/uniswap/uniswap_v2_base_decoded_factory_evt.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,15 @@ | ||
{{ config( | ||
schema = 'uniswap_v2_base', | ||
alias = 'decoded_factory_evt', | ||
partition_by = ['block_date'], | ||
materialized = 'incremental', | ||
file_format = 'delta', | ||
incremental_strategy = 'merge', | ||
unique_key = ['tx_hash', 'index'], | ||
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] | ||
) | ||
}} | ||
|
||
{{uniswap_v2_factory_event_decoding( | ||
logs = source('base', 'logs') | ||
)}} |
15 changes: 15 additions & 0 deletions
15
...x/models/automated_trades/base/projects/uniswap/uniswap_v2_base_decoded_pool_evt_swap.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,15 @@ | ||
{{ config( | ||
schema = 'uniswap_v2_base', | ||
alias = 'decoded_pool_evt_swap', | ||
partition_by = ['block_date'], | ||
materialized = 'incremental', | ||
file_format = 'delta', | ||
incremental_strategy = 'merge', | ||
unique_key = ['tx_hash', 'index'], | ||
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] | ||
) | ||
}} | ||
|
||
{{uniswap_v2_pool_event_decoding( | ||
logs = source('base', 'logs') | ||
)}} |
20 changes: 20 additions & 0 deletions
20
...x/models/automated_trades/base/projects/uniswap/uniswap_v3_base_automated_base_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,20 @@ | ||
{{ config( | ||
schema = 'uniswap_v3_base', | ||
alias = 'automated_base_trades', | ||
partition_by = ['block_month'], | ||
materialized = 'incremental', | ||
file_format = 'delta', | ||
incremental_strategy = 'merge', | ||
unique_key = ['tx_hash', 'evt_index'], | ||
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] | ||
) | ||
}} | ||
|
||
{{ | ||
uniswap_v3_forks_trades( | ||
blockchain = 'base' | ||
, version = '3' | ||
, Pair_evt_Swap = ref('uniswap_v3_base_decoded_pool_evt_swap') | ||
, Factory_evt_PoolCreated = ref('uniswap_v3_base_decoded_factory_evt') | ||
) | ||
}} |
15 changes: 15 additions & 0 deletions
15
...dex/models/automated_trades/base/projects/uniswap/uniswap_v3_base_decoded_factory_evt.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,15 @@ | ||
{{ config( | ||
schema = 'uniswap_v3_base', | ||
alias = 'decoded_factory_evt', | ||
partition_by = ['block_date'], | ||
materialized = 'incremental', | ||
file_format = 'delta', | ||
incremental_strategy = 'merge', | ||
unique_key = ['tx_hash', 'index'], | ||
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] | ||
) | ||
}} | ||
|
||
{{uniswap_v3_factory_event_decoding( | ||
logs = source('base', 'logs') | ||
)}} |
15 changes: 15 additions & 0 deletions
15
...x/models/automated_trades/base/projects/uniswap/uniswap_v3_base_decoded_pool_evt_swap.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,15 @@ | ||
{{ config( | ||
schema = 'uniswap_v3_base', | ||
alias = 'decoded_pool_evt_swap', | ||
partition_by = ['block_date'], | ||
materialized = 'incremental', | ||
file_format = 'delta', | ||
incremental_strategy = 'merge', | ||
unique_key = ['tx_hash', 'index'], | ||
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')] | ||
) | ||
}} | ||
|
||
{{uniswap_v3_pool_event_decoding( | ||
logs = source('base', 'logs') | ||
)}} |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// These two lines mark if a project address is recorded in the static mapping.