MadiTop Destination after Bridging
Updated 2022-10-22Copy 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 df as (
select
block_timestamp,
from_address
from ethereum.core.fact_transactions
where to_address = '0x99c9fc46f92e8a1c0dec1b1747d010903e884be1'
and block_timestamp >= current_date - 89
),
df_after_bridge as
(
select a.block_timestamp as block_timestamp,
a.origin_from_address as origin_from_address,
a.tx_hash as tx_hash,
a.event_name as event_name
from optimism.core.fact_event_logs a
join df b
on a.origin_from_address = b.from_address and a.block_timestamp > b.block_timestamp
),
min_timestamp as (
select
min(block_timestamp) as min_timestamp,
origin_from_address
from df_after_bridge
group by origin_from_address
),
first_tx_after_bridging as (
select block_timestamp,
a.origin_from_address,
tx_hash,
event_name
from min_timestamp a
left join df_after_bridge b
on a.min_timestamp = b.block_timestamp
Run a query to Download Data