binhachon10. [Hard] New vs. Existing Holders - Monthly chart
    Updated 2021-12-19
    with ens_registration as(
    select
    distinct block_timestamp,
    tx_id,
    origin_address,
    row_number() over (
    partition by origin_address
    order by
    block_timestamp
    ) as rownumber
    from
    ethereum.udm_events
    where
    contract_address = '0x283af0b28c62c092c9727f1ee09c02ca627eb7f5'
    and origin_function_name ilike '%register%'
    )
    select
    date_trunc('month', block_timestamp) as blocktime,
    count(tx_id) as number_of_registrations,
    count_if(rownumber = 1) as address_register_first_domain,
    count(distinct origin_address) - address_register_first_domain as address_register_additional_domain,
    address_register_first_domain / address_register_additional_domain as ratio,
    address_register_first_domain / number_of_registrations as ratio1
    from
    ens_registration
    where
    block_timestamp > '2021-01-01T00:00:00Z'
    group by
    blocktime
    Run a query to Download Data