Query editor
-- new walletsWITH_wallet_code_hash as (select '/rX/aCDi/w2Ug+fg1iyBfYRniftK5YDIeIZtlZ2r1cA=' as code_hash, 'wallet_v4r2' as wallet union all --select 'IINLe3KxEhR+Gy+0V7hOdNGjDwT3N9T2KmaOlVLSty8=' as code_hash, 'wallet_v5r1' as wallet union all --select 'thBBpYp5gLlG6PueGY48kE0keZ/6NldOpCUcQaVm9YE=' as code_hash, 'wallet_v3r1' as wallet union all --select 'hNr6RJ+Ypph3ibojI1gHK8D3bcRSQAKl0JGLmnXS1Zk=' as code_hash, 'wallet_v3r2' as wallet union all --select '89fKU0k97trCizgZhqhJQDy6w9LFhHea8IEGWvCsS5M=' as code_hash, 'wallet_v5_beta' as wallet union all --select '/pUw0yQ4Uwg+8u8LTCkIwKv2+hwx6iQ6rKpb+MfXU/E=' as code_hash, 'wallet_v2r2' as wallet union all --select 'ZN1UgFUixb6KnbWc6gEFzPDQh4bKeb64y3nogKjXMi0=' as code_hash, 'wallet_v4r1' as wallet union all --select 'MZrVLsmoWWIPil2Ww2CJ5nw29OOTAdBQ224VCXAZzpE=' as code_hash, 'wallet_v5_beta' as wallet union all --select 'WHzHie/xyE9G7DeX5F/ICaFP9a4k8eDHpqmcydyQYf8=' as code_hash, 'wallet_v1r3' as wallet union all --select 'XJpeaMEI4YchoHxC+ZVr+zmtd+xtYktgxXbsiO7mUyk=' as code_hash, 'wallet_v2r1' as wallet union all --select 'oM/CxIruFqJx8s/AtzgtgXVs7LEBfQd/qqs7tgL2how=' as code_hash, 'wallet_v1r1' as wallet union all --select '1JAvzJ+tdGmPqONTIgpo2g3PcuMryy657gQhfBfTBiw=' as code_hash, 'wallet_v1r2' as wallet -- union all ---- select 'EayteVWEQJDyg78ji8FEmHH3g+fMCXlAjT9IWUg+hSU=' as code_hash, 'wallet_highload_v3r1' as wallet union all ---- select 'ID3U81ittJmTEpqpJcrDmRa2ig5PeNJujywraer6Vnk=' as code_hash, 'wallet_highload_v2r2' as wallet union all ---- select 'lJTRzI7fEvBWcaGpugmSEJbrUIEeGSTsZcPGKfu4CBI=' as code_hash, 'wallet_highload_v2' as wallet --)-- , _wallet_addresses_exact AS (-- SELECT DISTINCT wt.account, wch.wallet-- FROM ton.transactions wt-- INNER JOIN _wallet_code_hash wch-- ON wch.code_hash = wt.account_state_code_hash_after-- WHERE 1=1-- AND block_date > date('2021-12-31')-- )-- , _first_seen as (-- SELECT-- m.source AS address-- , DATE_TRUNC('year', MIN(m.block_time)) AS first_seen-- FROM ton.messages m-- INNER JOIN ton.transactions t-- ON t.hash = m.tx_hash-- INNER JOIN _wallet_addresses_exact was-- ON was.account = m.source-- WHERE 1=1-- AND m.direction = 'in'-- AND m.bounced = false-- GROUP BY 1-- ), _FIRST_SEEN AS (SELECTT.account AS source,DATE_TRUNC('year', MIN(T.block_time)) AS first_seenFROM ton.transactions AS TINNER JOIN _wallet_code_hash wchON wch.code_hash = T.account_state_code_hash_afterWHERE T.aborted = FALSEGROUP BY 1)SELECTfirst_seen,COUNT(1) AS number_of_walletsFROM _FIRST_SEENGROUP BY 1