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

refactor: adjust fork maps to avoid decoding pipeline #7183

Closed
wants to merge 16 commits into from
Prev Previous commit
Next Next commit
adjust stuff
0xBoxer committed Nov 25, 2024
commit 2daae418fb01a329444c3ed688ed05dc4ff9854c
Original file line number Diff line number Diff line change
@@ -75,8 +75,8 @@ WITH evt_swap AS (
)

SELECT base_trades.blockchain
, CASE when dex_map.project_name is not NULL then dex_map.project_name else concat('unknown-uni-v2-', cast(varbinary_substring(factory_address, 1, 5) as varchar)) end as project_name
, CASE when dex_map.project_name is not NULL then 'identified' else 'unidentified' end as project_name_status
, CASE when dex_map.project_name is not NULL then dex_map.project_name else concat('unknown-uni-v2-', cast(varbinary_substring(factory_address, 1, 5) as varchar)) end as project
, CASE when dex_map.project_name is not NULL then true else false end as project_status
, base_trades.version
, base_trades.dex_type
, base_trades.factory_address
Original file line number Diff line number Diff line change
@@ -82,8 +82,8 @@ WITH evt_swap AS (
)

SELECT base_trades.blockchain
, CASE when dex_map.project_name is not NULL then dex_map.project_name else concat('unknown-uni-v3-', cast(varbinary_substring(factory_address, 1, 5) as varchar)) end as project_name
, CASE when dex_map.project_name is not NULL then 'identified' else 'unidentified' end as project_name_status
, CASE when dex_map.project_name is not NULL then dex_map.project_name else concat('unknown-uni-v3-', cast(varbinary_substring(factory_address, 1, 5) as varchar)) end as project
, CASE when dex_map.project_name is not NULL then true else false end as project_status
, base_trades.version
, base_trades.dex_type
, base_trades.factory_address
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@ WITH base_union AS (
SELECT
blockchain
, project
, project_status
, version
, dex_type
, factory_address
Original file line number Diff line number Diff line change
@@ -14,7 +14,6 @@
uniswap_v2_forks_trades(
blockchain = 'arbitrum'
, version = '2'
, project = 'null'
, Pair_evt_Swap = ref('uniswap_v2_arbitrum_decoded_pool_evt_swap')
, Factory_evt_PairCreated = ref('uniswap_v2_arbitrum_decoded_factory_evt')
)
Original file line number Diff line number Diff line change
@@ -14,7 +14,6 @@
uniswap_v3_forks_trades(
blockchain = 'arbitrum'
, version = '3'
, project = 'null'
, Pair_evt_Swap = ref('uniswap_v3_arbitrum_decoded_pool_evt_swap')
, Factory_evt_PoolCreated = ref('uniswap_v3_arbitrum_decoded_factory_evt')
)
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@ with base_union as (
SELECT
blockchain
, project
, project_status
, version
, factory_address
, dex_type
4 changes: 2 additions & 2 deletions dbt_subprojects/dex/models/automated_trades/dex_mapping.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-- this should probably live somewhere else, just for testing purposes for now

{{ config(
schema = 'uniswap_v2_arbitrum',
alias = 'fork_mapping',
schema = 'dex',
alias = 'mapping',
tags = ['static'],
unique_key = ['factory_address', 'blockchain'])
}}
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@ WITH base_union AS (
SELECT
blockchain
, project
, project_status
, version
, dex_type
, factory_address
Original file line number Diff line number Diff line change
@@ -14,7 +14,6 @@
uniswap_v2_forks_trades(
blockchain = 'ethereum'
, version = '2'
, project = 'null'
, Pair_evt_Swap = ref('uniswap_v2_ethereum_decoded_pool_evt_swap')
, Factory_evt_PairCreated = ref('uniswap_v2_ethereum_decoded_factory_evt')
)
Original file line number Diff line number Diff line change
@@ -14,7 +14,6 @@
uniswap_v3_forks_trades(
blockchain = 'ethereum'
, version = '3'
, project = 'null'
, Pair_evt_Swap = ref('uniswap_v3_ethereum_decoded_pool_evt_swap')
, Factory_evt_PoolCreated = ref('uniswap_v3_ethereum_decoded_factory_evt')
)