Query editor
WITH borrow_events AS (SELECT'Ethereum + Base' AS network_group,block_time,tx_hashFROM ethereum.logsWHERE block_date >= DATE '2026-07-07'AND block_time >= TIMESTAMP '2026-07-07 00:00:00 UTC'AND contract_address = 0xf80eeec09f417fa7fcc4a848ef03af9df2658d7bAND topic0 = 0x13ed6866d4e1ee6da46f845c46d7e54120883d75c5ea9a2dacc1c4ca8984ab80UNION ALLSELECT'Ethereum + Base' AS network_group,block_time,tx_hashFROM base.logsWHERE block_date >= DATE '2026-07-07'AND block_time >= TIMESTAMP '2026-07-07 00:00:00 UTC'AND contract_address = 0x304cc2588850a59ec1e59a998ce883de0e884d23AND topic0 = 0x13ed6866d4e1ee6da46f845c46d7e54120883d75c5ea9a2dacc1c4ca8984ab80UNION ALLSELECT'World Chain' AS network_group,block_time,tx_hashFROM worldchain.logsWHERE block_date >= DATE '2026-07-07'AND block_time >= TIMESTAMP '2026-07-07 00:00:00 UTC'AND contract_address = 0xf36749472ad6da1ccf9ede8ff321654990635ffaAND topic0 = 0x13ed6866d4e1ee6da46f845c46d7e54120883d75c5ea9a2dacc1c4ca8984ab80),weekly AS (SELECTCAST(date_trunc('week', block_time) AS DATE) AS week,network_group,COUNT(*) AS borrowsFROM borrow_eventsGROUP BY 1, 2),totals AS (SELECTCOUNT_IF(network_group = 'Ethereum + Base') AS ethereum_base_since_july_7,COUNT_IF(network_group = 'World Chain') AS world_chain_since_july_7,COUNT(*) AS total_since_july_7,COUNT_IF(network_group = 'Ethereum + Base'AND block_time >= TIMESTAMP '2026-08-21 00:00:00 UTC'AND block_time < TIMESTAMP '2026-09-04 00:00:00 UTC') AS ethereum_base_aug21_sep3,COUNT_IF(network_group = 'World Chain'AND block_time >= TIMESTAMP '2026-08-21 00:00:00 UTC'AND block_time < TIMESTAMP '2026-09-04 00:00:00 UTC') AS world_chain_aug21_sep3,COUNT_IF(block_time >= TIMESTAMP '2026-08-21 00:00:00 UTC'