with
pool as (
select pool_address,pool_name
from ethereum.dex_liquidity_pools
where (token0 = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'or token1 ='0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48')
and platform ilike '%uniswap%'
),
swap as (
select sum(d.amount_usd),date_trunc('day',d.block_timestamp)as date,count(distinct d.from_address),count(distinct d.tx_id)
from pool inner join ethereum.dex_swaps as d
on (pool.pool_address)=(d.pool_address)
where block_timestamp >'2022-01-01'
group by 2
)
select * from swap