Query editor
with a3 as (select to from (selectto,count(distinct "from") as txsfrom polygon.transactionsgroup by 1order by 2 desclimit 10)),a1 as(selectdate_trunc('month',block_time) as month,to as address,count(distinct "from") as txsfrom polygon.transactionswhere to in (select * from a3)group by 1, 2),a2 as (select address, name, namespacefrom evms.contractswhere blockchain = 'polygon')selecta1.month,CASE WHEN (a2.namespace IS NULL anda3.to in (0x84e5bc3df0df0f543648f250443c6f4077218312, 0xa81ce04168e41a47f68a975d67a00fbef729af9b,0xEA8A67728E817Eb63b3B794AA3b3A89E8cbA475B)) then 'mev bot'when a2.namespace = 'circle' then '$USDC'when a2.namespace = 'tether' then '$USDT'when a2.namespace = 'mahadao' then '$WETH'when a2.namespace = 'maker' then '$DAI'when a2.namespace = 'xen' then '$XEN'WHEN (a2.namespace IS NULL anda3.to = 0x1a1ec25DC08e98e5E93F1104B5e5cdD298707d31) then 'metamask swap'when a2.namespace in ('opensea','opensea_polygon_v2') then 'opensea'when a2.namespace = 'metaforce' then 'others'when a2.namespace IS NULL THEN 'others' ELSE a2.namespace END AS namespace,a1.txsfrom a1left join a2 on a1.address = a2.addressleft join a3 on a1.address = a3.to