Query editor
-- Confidential DeFi batch explorer (Ethereum mainnet). Batcher list comes from-- the mainnet registry query (query_7787373) so a redeploy only needs editing-- there. Per-user amounts are FHE ciphertext; "entered" (displayed "Users in")-- counts net participants still in the batch and "quit" counts distinct accounts-- that quit at least once (a quitter who re-joins shows in both). "unique_users"-- is the cumulative count of DISTINCT addresses that have net-joined any batch up-- to and including the row (each wallet counted once; the top/latest row is the-- grand total per batcher). "total unshielded" is the cleartext-- dispatchBatchCallback amount.-- A batch opens when the PREVIOUS batch is dispatched (it then becomes the-- accumulating batch), so opened_at = the dispatch time of batch_id - 1, which-- is also the batch's creation time on-chain.-- min_batch_age is PINNED per batch at creation from the live _minBatchAge, which-- governance can change via setMinBatchAge (MinBatchAgeSet event). We reconstruct-- each batch's pinned value = the most recent MinBatchAgeSet at/before the batch's-- creation time, falling back to the deploy-time value carried by the registry.WITH reg AS (SELECT address, kind, label, deploy_min_batch_age FROM query_7787373),evt AS (SELECT contract_address, topic0, topic1, topic2, data, block_number, index, block_timeFROM ethereum.logsWHERE contract_address IN (SELECT address FROM reg)AND block_time >= TIMESTAMP '2026-06-01'AND topic0 IN (0x5f8ebbb209d7895cbfe5cf5a2dfcaedee39eb27774f2986578a70eb7e43031e8,0xfed44e18a570877ad40a09ae151beefb6eac79cca7bb4d393ce12451298d3e86,0xfc50443e0b60182e19ff754c377e74204041a4c5313f72e29c827aa0c4794e72,0x5586a68ae5708d58e7ce9e8a84d65ab6569a85e6d2e4b514e7f3175da129aad1,0x9df57674fe50a01c8999a0ed6034d6e368eb2e2d1227f4120654a9df29eb6269)),-- Per (batch, account), keep whether the LAST Joined/Quit event was a Joined.-- Joined topic0 = 0x5f8e…31e8, Quit topic0 = 0xfed4…3e86; both carry batchId in-- topic1 and the account in topic2. Order by (block_number, log index) so a-- join→quit→join sequence resolves to the final state. "entered" = accounts still-- in the batch (their last event is a Join).membership AS (SELECT contract_address, bytearray_to_uint256(topic1) AS batch_id,bytearray_substring(topic2, 13, 20) AS account,max_by(topic0 = 0x5f8ebbb209d7895cbfe5cf5a2dfcaedee39eb27774f2986578a70eb7e43031e8,block_number * 1000000 + index) AS still_inFROM evtWHERE topic0 IN (0x5f8ebbb209d7895cbfe5cf5a2dfcaedee39eb27774f2986578a70eb7e43031e8,0xfed44e18a570877ad40a09ae151beefb6eac79cca7bb4d393ce12451298d3e86)GROUP BY 1, 2, 3),joined AS (SELECT contract_address, batch_id, count_if(still_in) AS enteredFROM membership GROUP BY 1, 2),-- Running set of unique users. Each address enters the set at the EARLIEST batch-- where its net Joined/Quit state is a Joined, so a wallet active across many-- batches is counted once and a wallet that only ever net-quit never enters.-- new_users = how many addresses first appear at each batch; the outer query-- turns it into a cumulative count per batcher via a window sum.first_in AS (SELECT contract_address, account, min(batch_id) AS first_batch