Skip to content

Commit

Permalink
dex.raw_pools fix optimism legacy (#4890)
Browse files Browse the repository at this point in the history
* Revert "dex.raw_pools: add missing legacy OP pools (#4885)"

This reverts commit ab54594.

* add from mapping
  • Loading branch information
grkhr authored Nov 28, 2023
1 parent e567131 commit fa454bd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 15 deletions.
30 changes: 27 additions & 3 deletions models/dex/dex_raw_pools.sql
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"gnosis",
"fantom",
"optimism",
"optimism_legacy_ovm1",
"arbitrum",
"celo",
"base",
Expand Down Expand Up @@ -111,8 +110,29 @@ pool_created_logs as (
)


-- hardcoded OP legacy pools
, _optimism_ovm1_legacy as (
select
'optimism' as blockchain
, 'uniswap_compatible' as type
, 'v3' as version
, pool
, token0
, token1
, creation_block_time
, creation_block_number
, contract_address
from (
select oldaddress as pool, * from {{ ref('uniswap_optimism_ovm1_pool_mapping') }}
union all
select newaddress as pool, * from {{ ref('uniswap_optimism_ovm1_pool_mapping') }}
)
)



select
replace(blockchain, 'optimism_legacy_ovm1', 'optimism') as blockchain
blockchain
, type
, version
, pool
Expand All @@ -125,4 +145,8 @@ from pool_created_logs
join creation_traces using(blockchain, tx_hash, block_number, block_time, pool)
{% if is_incremental() %}
where {{ incremental_predicate('block_time') }}
{% endif %}
{% endif %}

union all

select * from _optimism_ovm1_legacy
12 changes: 0 additions & 12 deletions models/dex/dex_sources.yml

This file was deleted.

0 comments on commit fa454bd

Please sign in to comment.