Query editor
WITH window AS (SELECT NOW() - INTERVAL '{{lookback_days}}' DAY AS since),tx AS (SELECTt.evt_block_time,t."from" AS src,t."to" AS dst,CAST(t.value AS DECIMAL(38,0))/1e6 AS amtFROM erc20_ethereum.evt_Transfer tWHERE t.contract_address = {{token_address}}AND t.evt_block_time >= (SELECT since FROM window)),-- 다수 → 하나 집중 후보 (aggregator)fanin AS (SELECTdst,COUNT(DISTINCT src) AS unique_senders,SUM(amt) AS total_in,MAX(evt_block_time) AS last_in_timeFROM txGROUP BY dstHAVING COUNT(DISTINCT src) >= {{min_senders}}AND SUM(amt) >= {{min_total_in}}),-- 최근 7일 내의 큰 단발성 이동(키 체인지 후보)out_big AS (SELECTsrc, dst,SUM(amt) AS movedFROM txWHERE evt_block_time >= NOW() - INTERVAL '7' DAYGROUP BY src, dstHAVING SUM(amt) >= {{big_move}})SELECT'0x' || lower(to_hex(f.dst)) AS old_addr,'0x' || lower(to_hex(o.dst)) AS new_addr,o.moved AS usdc_moved_recent,'https://etherscan.io/address/0x' || lower(to_hex(f.dst)) AS old_link,'https://etherscan.io/address/0x' || lower(to_hex(o.dst)) AS new_linkFROM fanin fJOIN out_big o ON o.src = f.dstORDER BY o.moved DESCLIMIT 100;