Query editor
/* ──────────────────────────────────────────────────────────────1. Contracts Source Mapping───────────────────────────────────────────────────────────── */WITH namespace_contracts AS (SELECT DISTINCTname AS namespace,address AS contract_addressFROM query_4636985WHERE NOT address IS NULL AND NOT name IS NULL),/* ──────────────────────────────────────────────────────────────2a. Standard Activity (External Transactions)Aggregates everything except the specific Kindred address───────────────────────────────────────────────────────────── */standard_daily_stats AS (SELECTDATE_TRUNC('day', t.block_time) AS date,nc.namespace,COUNT(DISTINCT t.hash) AS daily_incoming_txs,COUNT(DISTINCT t."from") AS daily_active_users,SUM(t.gas_used) AS daily_gas_used,SUM(t.gas_used * t.gas_price) / 1e18 AS daily_gas_cost_seiFROM namespace_contracts AS ncJOIN sei.transactions AS tON LOWER(nc.contract_address) = LOWER(CAST(t.to AS VARCHAR))WHEREt.block_time > CURRENT_TIMESTAMP - INTERVAL '3' monthAND nc.namespace <> 'erc4337'AND LOWER(nc.contract_address) <> LOWER('0x7dFE0281c318922953e1e7Ae54F1B77C4096f50F')GROUP BY 1, 2),/* ──────────────────────────────────────────────────────────────2b. Internal Activity (Traces)Specific logic for Kindred to capture internal call volume───────────────────────────────────────────────────────────── */internal_daily_stats AS (SELECTDATE_TRUNC('day', tr.block_time) AS date,'Kindred' AS namespace,COUNT(DISTINCT tr.tx_hash) as daily_incoming_txs,COUNT(DISTINCT tr."from") as daily_active_users,SUM(tr.gas_used) AS daily_gas_used,SUM(tr.gas_used * t.gas_price) / 1e18 AS daily_gas_cost_seiFROM sei.traces AS trJOIN sei.transactions AS tON t.hash = tr.tx_hashAND t.block_time > CURRENT_TIMESTAMP - INTERVAL '3' month -- Performance filterWHEREtr.to = 0x7dFE0281c318922953e1e7Ae54F1B77C4096f50FAND tr.block_time > CURRENT_TIMESTAMP - INTERVAL '3' monthAND tr.type = 'call'AND tr.success = trueAND cardinality(tr.trace_address) > 0GROUP BY 1, 2),/* ──────────────────────────────────────────────────────────────3. Final Consolidated Output