with
pool as (
select pool_address,pool_name
from ethereum.dex_liquidity_pools
where (token0 = '0xdac17f958d2ee523a2206206994597c13d831ec7'or token1 ='0xdac17f958d2ee523a2206206994597c13d831ec7')
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