nsa2000Untitled Query
    Updated 2022-09-29
    with ethereum_transactions as (
    select
    block_timestamp,
    block_number,
    tx_hash,
    from_address,
    eth_value,
    tx_fee,
    gas_used
    from ethereum.core.fact_transactions
    where status = 'SUCCESS'
    and block_timestamp::date >= '2022-09-06'
    and block_timestamp::date <= '2022-09-24'
    )

    select
    block_timestamp::date as "Days",
    case
    when block_timestamp::date >= '2022-09-01' and block_timestamp::date <= '2022-09-15' and block_number < 15537394 then 'Before Merge'
    else 'After Merge'
    end as "Time Frame",
    count(distinct tx_hash) as "Number of Transactions",
    count(distinct from_address) as "Number of Unique User",
    sum(eth_value) as "Amount of ETH Transferred",
    sum(tx_fee) as "Amount of Fee Spent"
    from ethereum_transactions
    group by "Days", "Time Frame"
    order by "Days"