Query editor
-- =====================================================================-- QUERY: cirBTC Ethereum — Daily Trends-- PURPOSE: Daily time series: gross inflow, gross outflow, net flow,-- cumulative TVL, transaction count, active addresses.-- DEPENDS ON: query 7775922 (Base Labeled Transfers)-- NOTE: Always computed over a fixed 30-day lookback (the longest of-- the three dashboard windows) so the chart itself can be-- visually trimmed by the viewer; not driven by {{time_window}}-- since trend charts benefit from showing the full 30d context-- regardless of which KPI window is selected elsewhere.-- =====================================================================with daily as (selectevt_block_date as day,sum(case when is_mint then amount else 0 end) as gross_inflow,sum(case when is_burn then amount else 0 end) as gross_outflow,count(distinct evt_tx_hash) as num_transactionsfrom query_7775922where evt_block_time >= now() - interval '30' daygroup by 1),daily_unique_addr as (select day, count(distinct addr) as active_addressesfrom (select evt_block_date as day, "from" as addr from query_7775922where evt_block_time >= now() - interval '30' dayunionselect evt_block_date as day, "to" as addr from query_7775922where evt_block_time >= now() - interval '30' day) ugroup by 1)selectd.day,d.gross_inflow,d.gross_outflow,d.gross_inflow - d.gross_outflow as net_flow,sum(d.gross_inflow - d.gross_outflow) over (order by d.day) as cumulative_tvl,d.num_transactions,a.active_addressesfrom daily dleft join daily_unique_addr a on a.day = d.dayorder by d.day