theericstoneENS Revenue
    Updated 2021-11-09
    with d as
    (select
    date_trunc('hour', block_timestamp) as hour,
    sum(event_inputs:cost / 1e18) as revenue
    from ethereum.events_emitted
    where contract_address = '0x283af0b28c62c092c9727f1ee09c02ca627eb7f5'
    and event_name = 'NameRegistered'
    and block_timestamp >= '2021-11-01'
    group by 1 order by 1),

    p as
    (select hour, price, symbol from ethereum.token_prices_hourly
    where symbol = 'ETH' and hour >= '2021-11-01')

    -- select * from p order by hour
    -- select * from d order by hour
    select
    d.hour,
    d.revenue,
    p.price,
    p.price * d.revenue as revenue_usd
    from d join p on d.hour = p.hour;
    Run a query to Download Data