raho2023-02-09 03:47 PM
    Updated 2023-02-09
    with allsup as (
    select
    current_bal,
    contract_address,
    date_trunc('day', last_activity_block_timestamp) as date,
    symbol,
    token_name,
    user_address
    from ethereum.core.ez_current_balances
    where symbol = 'ENS'
    order by date desc
    ),

    combined as(
    select
    sum(current_bal) as circulating_supply,
    date
    from allsup
    group by 2
    )

    select
    date,
    circulating_supply,
    circulating_supply * 0.01 as quorum
    from combined
    where date > cast(getdate() as date) - 1