select
concat(dayofweekiso(first_block_timestamp),'-',dayname(first_block_timestamp)) dow,
count(distinct proposal) proposal_count
from (
select
proposal,
min(block_timestamp) first_block_timestamp,
max(block_timestamp) last_block_timestamp,
timediff(hour, first_block_timestamp, last_block_timestamp) hours
from solana.core.fact_proposal_votes a
left join solana.core.dim_labels b on a.PROGRAM_NAME = b.address
where succeeded
and governance_platform = 'realms'
and (
address_name in ('mango dao','monkedao','jet dao','solend dao','psy finance','serum')
or address_name ilike '%metaplex%'
or realms_id in ('By2sVGZXwfQq6rAiAM3rNPJ9iQfb5e2QhnF4YjJ4Bip','6orGiJYGXYk9GT2NFoTv2ZMYpA6asMieAqdek4YRH2Dn','7oB84bSuxv9AH1iRdMp5nFLwpQApv8Yo9s1gGmDkHtSP')
)
group by 1
)
group by 1