Query editor
with total as (select*FROM(SELECT*,ROW_NUMBER() OVER (PARTITION BY tx_hash ORDER BY block_time) AS numberingFROM dex.tradesWHERE tx_to in (select address from dune.hashed_official.result_wallet_router)AND amount_usd IS NOT NULL --need to avoid numbering tx entries as '1' when amount_usd values is null)WHERE numbering = 1)selectdate_trunc('month', block_time) as dt,name,count(distinct tx_from) as wau,count(*) as cnt,sum(amount_usd) as amount_usdfrom total tleft join dune.hashed_official.result_wallet_router wr on wr.address = t.tx_togroup by 1, 2order by 1 desc