Query editor
/*This query calculates the cumulative amount of wstETH that has been bridget to L2 solutions via various bridges over the past three months.*/-- sets the wstETH token addressWITHtokens (address) AS (values(0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0) --wstETH),-- a sequence of dates from November 3, 2020, to the current datedates AS (withday_seq AS (SELECT(sequence(cast('2020-11-03' AS DATE),cast(date_trunc('day', NOW()) AS DATE),interval '1' day)) day)SELECTdays.dayFROMday_seqCROSS JOIN unnest (day) AS days (day)),-- sets the bridge addresses with name from query_2415558 ('LSTs Holders')bridges AS (SELECTaddress,nameFROMquery_4273491),-- creates a Cartesian product of the dates and bridgesdates_cross_bridges AS (SELECT*FROMdatesLEFT JOIN bridges ON 1 = 1),-- calculate the daily outflow of the wstETH token from the bridges.outflow_daily AS (SELECTdate_trunc('day', evt_block_time) AS time,t."FROM" AS bridge,cast(0 AS DOUBLE) AS in_amount,SUM(cast(value AS DOUBLE)) / 1e18 AS out_amountFROMerc20_ethereum.evt_Transfer tWHEREt."FROM" in (SELECT address FROM bridges)AND contract_address in (SELECT address FROM tokens)GROUP BY 1, 2