Query editor
WITH ev AS (SELECT 'USDT-Ethereum' AS token_chain, evt_block_date AS day, CAST(amount AS decimal(38,0)) AS amt FROM tether_ethereum.tether_usd_evt_issueUNION ALL SELECT 'USDT-Ethereum', evt_block_date, -CAST(amount AS decimal(38,0)) FROM tether_ethereum.tether_usd_evt_redeemUNION ALL SELECT 'USDT-Ethereum', evt_block_date, -CAST(_balance AS decimal(38,0)) FROM tether_ethereum.tether_usd_evt_destroyedblackfundsUNION ALL SELECT 'USDC-Ethereum', evt_block_date, CAST(amount AS decimal(38,0)) FROM circle_ethereum.usdc_evt_mintUNION ALL SELECT 'USDC-Ethereum', evt_block_date, -CAST(amount AS decimal(38,0)) FROM circle_ethereum.usdc_evt_burnUNION ALL SELECT 'USDT-Tron', evt_block_date, CAST(amount AS decimal(38,0)) FROM tether_tron.tether_usd_evt_issueUNION ALL SELECT 'USDT-Tron', evt_block_date, -CAST(amount AS decimal(38,0)) FROM tether_tron.tether_usd_evt_redeemUNION ALL SELECT 'USDT-Tron', evt_block_date, -CAST(_balance AS decimal(38,0)) FROM tether_tron.tether_usd_evt_destroyedblackfunds)SELECTd.asof_date,e.token_chain,CAST(SUM(CASE WHEN e.day <= d.asof_date THEN e.amt ELSE 0 END) / 1e6 AS double) AS supply_asof,CAST(SUM(CASE WHEN e.day = d.asof_date THEN e.amt ELSE 0 END) / 1e6 AS double) AS net_mint_on_dayFROM ev eCROSS JOIN UNNEST(ARRAY[DATE '2024-08-15', DATE '2025-06-15', DATE '2026-03-15']) AS d(asof_date)GROUP BY d.asof_date, e.token_chainORDER BY d.asof_date, e.token_chain