with maintable as (
select
symbol_out as asset_name,
count (distinct (tx_hash)) as swaps_number,
count (distinct (origin_from_address)) as swappers_number,
sum(amount_in_usd) as total_amount_usd,
avg(amount_in_usd) as average_amount_usd,
median(amount_in_usd) as median_amount_usd
from ethereum.sushi.ez_swaps
where block_timestamp::date between '2022-11-08' and '2022-11-16'
and amount_in_usd > 0
group by symbol_out
)
select * from maintable
order by total_amount_usd desc
limit 10