with a as(SELECT BLOCK_TIMESTAMP::date as date,
ASSET_NAME as asset_to,
sum(SWAP_FROM_AMOUNT) as sold_amount,
count(DISTINCT SWAPPER) as sold_SWAPPERS
from flipside_prod_db.algorand.swaps s
join flipside_prod_db.algorand.asset a on a.ASSET_ID = s.SWAP_TO_ASSET_ID
where BLOCK_TIMESTAMP::date >= '2022-04-01'
and SWAP_FROM_ASSET_ID in (386195940)
GROUP by 1,2 order by 1),
b as (
select ASSET_TO, sum(SOLD_AMOUNT) from a group by 1
)
select * from b order by 1