mhmCompare swaps on DEXs on Optimism
Updated 2022-08-04Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
with velodrome_bridges as (
select 'velodrome' as dex, *
from optimism.core.fact_transactions
where to_address = '0xa132dab612db5cb9fc9ac426a0cc215a3423f9c9'
and ORIGIN_FUNCTION_SIGNATURE = '0xf41766d8'
), uniswap_bridges as (
select 'uniswap' as dex, *
from optimism.core.fact_transactions
where to_address = '0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45'
and ORIGIN_FUNCTION_SIGNATURE = '0x5ae401dc'
), sushiswap_bridges as (
select 'sushiswap' as dex, *
from optimism.core.fact_transactions
where to_address = '0xbe811a0d44e2553d25d11cb8dc0d3f0d0e6430e6' -- Sushiswap
and ORIGIN_FUNCTION_SIGNATURE in ('0xac9650d8', '0xb96c5c0e', '0x9fa74491', '0x0b0d1b1e')
), bridges as (
select * from velodrome_bridges
union all
select * from uniswap_bridges
union all
select * from sushiswap_bridges
), transfers_tokens as (
select
case
when ORIGIN_FUNCTION_SIGNATURE = '0xf41766d8' then 'Velodrome'
when ORIGIN_FUNCTION_SIGNATURE = '0x5ae401dc' then 'Uniswap'
when ORIGIN_FUNCTION_SIGNATURE in ('0xac9650d8', '0xb96c5c0e', '0x9fa74491', '0x0b0d1b1e') then 'Sushiswap'
end as dex,
block_timestamp,
tx_hash,
ORIGIN_FUNCTION_SIGNATURE,
ORIGIN_FROM_ADDRESS,
ORIGIN_TO_ADDRESS,
CONTRACT_ADDRESS,
FROM_ADDRESS,
TO_ADDRESS,
Run a query to Download Data