binhachon14. [Hard] Revenue Distribution - Daily revenue and total
    Updated 2021-12-25
    with ens_domain_register as (
    select
    distinct
    block_timestamp,
    tx_id,
    event_inputs:cost/1e18 as cost
    from
    ethereum.events_emitted
    where
    event_name in ('NameRegistered')
    and
    contract_address in ('0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85', '0x283af0b28c62c092c9727f1ee09c02ca627eb7f5')
    ),
    ens_domain_renewal as (
    select
    distinct
    block_timestamp,
    tx_id,
    event_inputs:cost/1e18 as cost
    from
    ethereum.events_emitted
    where
    event_name in ('NameRenewed')
    and
    contract_address in ('0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85', '0x283af0b28c62c092c9727f1ee09c02ca627eb7f5')
    ),
    eth_price as (
    select
    date_trunc('day', hour) as blocktime,
    avg(price) as price
    from
    ethereum.token_prices_hourly
    where
    symbol = 'WETH'
    group by blocktime
    ),
    Run a query to Download Data