Query editor
-- created with github.com/ohld/ton-analystWITH _ AS (SELECT 'A list of automated non-real TON wallets used to filter real-user metrics.Detects:- descendants of labelled scripted-activity seeds (2 hops)- descendants of labelled address-poisoning factories (2 hops)- scammer-funded wallets that themselves send repeated dust <= 0.01 TON- low-value numeric-memo spam wallets, including TON DNS impersonation campaignsOutput: unlabeled, non-custodial wallet addresses only.If we labelled some address as sybil/scammer by mistake,please reach out to https://t.me/okhlopkovmade by @okhlopkov'), LABELS AS (SELECT address, category, labelFROM dune.ton_foundation.dataset_labels), SCRIPTED_ACTIVITY_SEEDS AS (-- https://github.com/ton-studio/ton-labels-- Address-poisoning factories first-fund lookalike one-time wallets.-- 2-hop first_tx_sender expansion marks those leaves without listing them in ton-labels.SELECT addressFROM LABELSWHERE category = 'scripted-activity'OR label = 'scammer_address_poisoning'), SCAMMER_AUTOMATION_SEEDS AS (-- Labelled scammer roots. Address-poisoning is also expanded above.SELECT address, labelFROM LABELSWHERE category = 'scammer'), SCRIPTED_ACTIVITY_GEN1 AS (SELECT A.addressFROM ton.accounts AINNER JOIN SCRIPTED_ACTIVITY_SEEDS SON S.address = A.first_tx_senderWHERE 1=1AND cardinality(FILTER(A.interfaces, i->regexp_like(i, 'wallet_.*') )) > 0 -- wallets & highload), SCRIPTED_ACTIVITY_GEN2 AS (SELECT A.addressFROM ton.accounts AINNER JOIN SCRIPTED_ACTIVITY_GEN1 SON S.address = A.first_tx_senderWHERE 1=1AND cardinality(FILTER(A.interfaces, i->regexp_like(i, 'wallet_.*') )) > 0 -- wallets & highload), SCAMMER_FUNDED_WALLET_CANDIDATES AS (SELECTA.address,