with whale_list as (
select
address
from algorand.account
where account_closed = 'FALSE'
and balance > 5600
),
swapper as (
select
swap_from_asset_id,
count(*) as number_of_swaps
from algorand.swaps
where swapper in (select address from whale_list)
and block_timestamp >= '2022-01-01'
group by 1
)
select
swapper.*,
case when swap_from_asset_id = 0 then 'ALGO' else algorand.asset.asset_name end as name
from swapper
left join algorand.asset on (swap_from_asset_id = asset_id)