DeFi_reindsOn-chain stats comparison
    Updated 2022-08-07
    with optimism as (select date_trunc('day', block_timestamp) as date,
    count(distinct from_address) as wallet_count,
    count(distinct tx_hash) as tx_count,
    tx_count/wallet_count as avg_tx_per_wallet
    from optimism.core.fact_transactions
    where block_timestamp::date between '2022-07-01' and '2022-07-31'
    and status = 'SUCCESS'
    group by date),

    ethereum as (select date_trunc('day', block_timestamp) as date,
    count(distinct from_address) as wallet_count,
    count(distinct tx_hash) as tx_count,
    tx_count/wallet_count as avg_tx_per_wallet
    from ethereum.core.fact_transactions
    where block_timestamp::date between '2022-07-01' and '2022-07-31'
    and status = 'SUCCESS'
    group by date),

    arbitrum as (select date_trunc('day', block_timestamp) as date,
    count(distinct from_address) as wallet_count,
    count(distinct tx_hash) as tx_count,
    tx_count/wallet_count as avg_tx_per_wallet
    from arbitrum.core.fact_transactions
    where block_timestamp::date between '2022-07-01' and '2022-07-31'
    and status = 'SUCCESS'
    group by date)

    select 'Optimism' as blockchain, *
    from optimism
    union all
    select 'Ethereum' as blockchain, *
    from ethereum
    union all
    select 'Arbitrum' as blockchain, *
    from arbitrum
    Run a query to Download Data