with one as (
select
date_trunc('hour',block_timestamp) as hour,
count(*) as swaps,
origin_from_address as swapper
from optimism.sushi.ez_swaps
where block_timestamp < current_date - 1
group by 1, 3)
select
hour,
count(swapper),
case
when swaps > 20 then 'BOT'
when swaps < 20 then 'not_bot'
end as bot_finder
from one
group by 1, 3