select
token_in,
count(distinct(tx_hash)) as swaps_count,
sum(amount_out) as total_amount,
count(distinct (trader)) as swappers_count
from near.core.ez_dex_swaps
where platform = 'v2.ref-finance.near'
and token_out in ('USDC', 'USDT', 'DAI')
and token_in not in ('USDC', 'USDT', 'DAI')
and block_timestamp >= current_date - interval '3 month'
group by 1
order by 1 desc
limit 10