Query editor
with holders as (selectday, token_balance, token_balance_owner, last_value(token_balance) over (partition by token_balance_owner order by day asc rows between unbounded preceding and unbounded following) as last_balancefromsolana_utils.daily_balanceswheretoken_mint_address = 'AN4KfBxJ7VBZ4ijai2kn5F6CUfoi2ZEoD1jT52rJpump'order byday asc), distinct_holders as (selectdistinct token_balance_owner as trader_idfromholderswherelast_balance > 0), distinct_holder_count as (select count(*) as total_holdersfrom distinct_holders), seller as (selectdistinct trader_idfromdex_solana.tradeswheretoken_sold_mint_address = 'AN4KfBxJ7VBZ4ijai2kn5F6CUfoi2ZEoD1jT52rJpump'and date_trunc('day', block_time) <= current_dateand project != 'pumpdotfun'), diamond_hands as (selectcount(*) as no_of_diamond_handsfrom (select *from distinct_holderswhere trader_id not in ('1nc1nerator11111111111111111111111111111111')exceptselect * from seller)), dh_non_dh as (selectdh.no_of_diamond_hands as "Diamond Hand", dhc.total_holders - dh.no_of_diamond_hands as "Non Diamond Hand"fromdiamond_hands as dhcross join (select * from distinct_holder_count) dhc)select'Diamond Hands' AS label,"Diamond Hand" AS value