Query editor
-- This query has been migrated to run on DuneSQL.-- If you need to change back because you’re seeing issues, use the Query History view to restore the previous version.-- If you notice a regression, please email [email protected].WITHtime AS (SELECTDateFROMUNNEST (SEQUENCE(CAST('2021-03-29 00:00' AS TIMESTAMP),CAST(CURRENT_TIMESTAMP AS TIMESTAMP),INTERVAL '1' day)) AS _u (Date)),slp AS (SELECTDATE_TRUNC('day', block_time) AS Date,COALESCE(SUM(CAST(e.value AS INT256) / CAST(1e18 AS DOUBLE)), 0) AS supplyFROMerc20_polygon.evt_Transfer AS eLEFT JOIN polygon."transactions" AS tx ON evt_tx_hash = tx.hashWHERE"contract_address" = 0x1e67124681b402064cd0abe8ed1b5c79d2e02f64 /* BCT/USDC SLP Contract Address */AND e."from" = 0x0000000000000000000000000000000000000000GROUP BY1UNION ALLSELECTDATE_TRUNC('day', block_time) AS Date,COALESCE(SUM(- CAST(e.value AS INT256) / CAST(1e18 AS DOUBLE)), 0) AS supplyFROMerc20_polygon.evt_Transfer AS eLEFT JOIN polygon."transactions" AS tx ON evt_tx_hash = tx.hashWHERE"contract_address" = 0x1e67124681b402064cd0abe8ed1b5c79d2e02f64 /* BCT/USDC SLP Contract Address */AND e."to" = 0x0000000000000000000000000000000000000000GROUP BY1),final AS (SELECTDate AS day,SUM(SUM(supply)) OVER (ORDER BYDate) AS slp_supplyFROM(SELECTDate,slp.supply AS supplyFROMslpUNION ALLSELECTDate,0 AS supply