h4wkDistinct Wallets (Optimism Bridge) 2
    Updated 2022-09-11
    -- Q1. How many distinct wallets have deposited or withdrawn ETH to Optimism via the native bridge in the last 60 days?

    with deposit as (
    select
    count(*) as tx_count,
    count(distinct from_address) as unique_address,
    sum(eth_value) as volume_eth,
    'deposit' as type
    from ethereum.core.fact_transactions
    where to_address = '0x99c9fc46f92e8a1c0dec1b1747d010903e884be1'
    -- and block_timestamp::date > CURRENT_DATE - 61 and block_timestamp::date < CURRENT_DATE
    and eth_value > 0
    group by type
    ), withdraw as (
    select
    count(*) as tx_count,
    count(distinct to_address) as unique_address,
    sum(eth_value) as volume_eth,
    'withdraw' as type
    from ethereum.core.fact_traces
    where
    from_address = '0x99c9fc46f92e8a1c0dec1b1747d010903e884be1'
    -- and block_timestamp::date > CURRENT_DATE - 61 and block_timestamp::date < CURRENT_DATE
    and eth_value > 0
    group by type
    )

    select * from deposit
    UNION
    select * from withdraw

    Run a query to Download Data