mlhTop 10 destination after bridging to Optimism via HOP, based on count of transactions
Updated 2022-10-25Copy 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 base_hop_bridge as (
select
t.tx_hash,
t.origin_from_address as user_addr,
t.block_timestamp,
'ETH' as symbol,
amount_usd as volume
from ethereum.core.ez_eth_transfers t join ethereum.core.fact_event_logs e on t.tx_hash = e.tx_hash
where
t.block_timestamp::date >= '2022-01-01' and
event_inputs:chainId = '10' and
e.contract_address in ('0xb8901acb165ed027e32754e0ffe830802919727f','0x3666f603cc164936c1b87e207f36beba4ac5f18a','0x3e4a3a4796d16c0cd582c382691998f7c06420b6',
'0x3d4cc8a61c7528fd86c55cfe061a78dcba48edd1','0x22b1cbb8d98a01a3b71d034bb899775a76eb1cc2') and
tx_status = 'SUCCESS'
union all
select
t.tx_hash,
t.origin_from_address as user_addr,
t.block_timestamp,
symbol,
amount_usd as volume
from ethereum.core.ez_token_transfers t join ethereum.core.fact_event_logs e on t.tx_hash = e.tx_hash
where
t.block_timestamp::date >= '2022-01-01' and
event_inputs:chainId = '10' and
e.contract_address in ('0xb8901acb165ed027e32754e0ffe830802919727f','0x3666f603cc164936c1b87e207f36beba4ac5f18a','0x3e4a3a4796d16c0cd582c382691998f7c06420b6',
'0x3d4cc8a61c7528fd86c55cfe061a78dcba48edd1','0x22b1cbb8d98a01a3b71d034bb899775a76eb1cc2') and
tx_status = 'SUCCESS'
),
first_tx as (
select
e.block_timestamp,
e.tx_hash,
e.origin_to_address
from base_hop_bridge b join optimism.core.fact_event_logs e on b.user_addr = e.origin_from_address and e.block_timestamp > b.block_timestamp
qualify row_number() over (partition by user_addr order by e.block_timestamp asc) = 1
Run a query to Download Data