with
main as (
select
tx_hash,
block_timestamp,
origin_from_address as user,
symbol_in,
symbol_out,
token_in,
token_out,
amount_in,
amount_out
from ethereum.defi.ez_dex_swaps
where platform ilike 'uniswap%'
),
token_last_activity as (
select
token_in as token,
max(block_timestamp) as last_activity_date
from main
group by token_in
union
select
token_out as token,
max(block_timestamp) as last_activity_date
from main
group by token_out
),
active_inactive_tokens as (
select
token,