with top_5_pools_by_tvl as
(SELECT pool_name, sum(net_amt)/pow(10,6) as tvl_in_M from
(select *, case when direction = 'IN' then amount_usd else amount_usd*(-1) end as net_amt from ethereum.dex_swaps
where platform like '%uniswap%' and amount_usd < pow(10,7))
GROUP by 1
order by 2 desc
limit 5)
SELECT * from top_5_pools_by_tvl