MadiTop Events after Bridging
    Updated 2022-10-22
    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_bridge 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