theericstoneActive Address Comps
    Updated 2022-10-03
    with
    activehold as (
    SELECT
    count(distinct(user_address)) as n_active_holders,
    lower('{{token_contract}}') as contract
    FROM
    ethereum.core.ez_balance_deltas
    where block_timestamp > current_date - {{daysago}}
    and contract_address = lower('{{token_contract}}')
    ),
    activeaddys as (
    SELECT
    count(distinct(from_address)) as n_active_addys,
    lower('{{token_contract}}') as contract
    from
    ethereum.core.fact_transactions
    where block_timestamp > current_date - {{daysago}}
    and to_address = lower('{{token_contract}}')
    ),
    projectname as (
    select address_name,
    trim(substr(address_name,1,4)) as short_name,
    lower('{{token_contract}}') as contract
    from ethereum.core.dim_labels
    where address = lower('{{token_contract}}')
    ), voters as (
    SELECT
    count(distinct(voter)) as n_voters,
    lower('{{token_contract}}') as contract,
    (select short_name from projectname) as short_name,
    concat('%',short_name,'%')
    from ethereum.core.ez_snapshot
    where proposal_end_time > current_date - {{daysago}}
    and space_id ilike concat('%',short_name,'%')
    )
    Run a query to Download Data