Query editor
WITHcohort AS (SELECT from_hex(substr(wallet, 3)) AS addr FROM query_7845579),recent_outflows AS (SELECT t."from" AS addr, t."to" AS counterpartyFROM tokens.transfers tWHERE t."from" IN (SELECT addr FROM cohort)AND t.blockchain = 'ethereum'AND t.block_time >= now() - INTERVAL '90' DAYAND t."to" <> t."from"AND t.amount_usd >= 1.0),agg AS (SELECT addr, count(*) AS n, count(DISTINCT counterparty) AS ndistFROM recent_outflowsGROUP BY addr)SELECTlower('0x' || to_hex(cohort.addr)) AS wallet_address,coalesce(agg.n >= 3 AND agg.ndist = 1, false) AS recent_migration_signal,coalesce(agg.ndist >= 3, false) AS recent_split_funds_signalFROM cohortLEFT JOIN agg ON agg.addr = cohort.addr