Query editor
with k as (select-- distinct substring(to_hex(t."data"), 25) blocked_user,distinct varbinary_substring(data,13,20) blocked_user,t.tx_from,t.block_number,t.tx_hashFROM ethereum.logs twheret.block_time between timestamp'2025-06-01 00:00' and timestamp '2025-06-30 23:59'--когда работаешь с ивентами (логами) - фильтрация по топик0 обязательна.and topic0 = 0x42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dcand t.contract_address = 0xdac17f958d2ee523a2206206994597c13d831ec7-- and t.tx_to = 0xc6cde7c39eb2f0f0095f41570af89efc2c1ea828 <= этого не надо, оно избыточно конкретно тут.-- Таким образом ты можешь попасть в ситуацию, что мультисиг (0xc6cde7c39eb2f0f0095f41570af89efc2c1ea828) поменяли на что-то другое,-- и вызывали блокировку через какой-то другой управляющий контракт. тебе ж пофиг, как конкретно был вызван метод блокировки.)selectdistinct k.*,first_value(t1.balance) over (partition by t1.address order by t1.block_number desc) last_balfrom kleft join tokens_ethereum.balances t1 on(t1.blockchain='ethereum' andt1.token_address = 0xdac17f958d2ee523a2206206994597c13d831ec7 andt1.block_time between timestamp'2025-06-01 00:00' and timestamp '2025-06-30 23:59' andt1.address = k.blocked_user and t1.block_number <= k.block_number)order by 2,3,1