Query editor
/*This query calculates:- Lido deposits since 2020-11-03 on a daily basis + cumulative- Other projects deposits since 2020-11-03 on a daily basis + cumulative- All projects deposits since 2020-11-03 on a daily basis + cumulativeCalculation details:- Gather all deposit and withdrawal txs with project labels:- Get all deposit txs and assign project labels to them (using dune.lido.result_eth_depositors_labels)- Get all withdrawal txs with project labels to them from dune.lido.result_withdrawals_transactions_assigned_to_projects- Calculate ETH deposits for Lido (daily and cumulative)- Calculate Total ETH deposits for all projects (daily and cumulative)- Finally we get a resulting table with daily and cumulative deposits for Lido, Other Projects and Total.*/-- This CTE generates a sequence of dates FROM '2020-11-03' to the current date, with 1-day intervalwith dates AS (with day_seq AS (SELECT (SEQUENCE(CAST('2020-11-03' AS TIMESTAMP), CAST(NOW() AS TIMESTAMP), INTERVAL '1' day)) AS day)SELECTdays.dayFROM day_seqCROSS JOIN unnest(day) AS days(day))-- List of project addresses FROM materialized view 'dune.lido.result_eth_depositors_labels', project_list AS(SELECTaddress AS project,name--FROM query_2005642FROM dune.lido.result_eth_depositors_labels)-- 'Lido',selected_project AS(SELECT 'Lido' AS name)-- Get all deposit and withdrawal transactions with project labels,all_txns AS(SELECTname,date_trunc('day',time) AS time,amountFROMdune.lido.result_deposits_assigned_to_projectsUNION allSELECTproject AS name,