phu51. optimism user distribution
    Updated 2023-04-06
    with
    tx_cte as (
    select
    block_timestamp
    , from_address
    , tx_hash
    , row_number() over(partition by from_address order by block_timestamp) rn
    from optimism.core.fact_transactions
    where 1=1
    and status = 'SUCCESS'
    )
    , first_2_tx_cte as (
    select
    tx_hash
    , from_address
    from tx_cte
    where 1=1
    and rn <= 2
    )
    , sushi_tx_cte as (
    select
    tx_hash
    from optimism.sushi.ez_swaps
    union
    select
    tx_hash
    from optimism.core.fact_transactions a
    join optimism.core.dim_labels b on a.to_address = b.address and b.project_name = 'sushiswap'
    )
    , intersect_cte as (
    select
    tx_hash
    from first_2_tx_cte
    Run a query to Download Data