cypherETH merge stats
    Updated 2022-09-24
    with unique_miners as (select
    date_trunc('day', block_timestamp) as date,
    count(distinct(miner)) as unique_miners
    from ethereum.core.fact_blocks
    where date >= current_date() - {{days}}
    group by date),

    total_n_tx as (select
    date_trunc('day', block_timestamp) as date,
    sum(tx_count) as total_transactions
    from ethereum.core.fact_blocks
    where date >= current_date() - {{days}}
    group by date),


    daily_avg_tps as (select
    date_trunc('day', block_timestamp) as date,
    sum(tx_count)/86400 as avg_tps
    from ethereum.core.fact_blocks
    where date >= current_date() - {{days}}
    group by date),

    fees as (select
    date_trunc('day', block_timestamp) as date,
    avg(tx_fee) as avg_tx_fee
    from ethereum.core.fact_transactions
    where date >= current_date() - {{days}}
    group by date),

    eth_price as (select
    date_trunc('day', hour) as date,
    avg(price) as avg_price
    from ethereum.core.fact_hourly_token_prices
    where date >= current_date() - {{days}}
    and token_address is null
    group by date),
    Run a query to Download Data