Query editor
WITH stable_balances AS (SELECTday,-- Summing the total balance across all tracked stables/chainsSUM(balance) / 1e9 AS total_stable_supply_bFROM stablecoins_multichain.balancesWHERE day >= TIMESTAMP '2023-10-30'AND day <= TIMESTAMP '2026-02-02'GROUP BY 1),btc_price_base AS (-- Using prices.day is significantly faster than averaging prices.minuteSELECTDATE_TRUNC('day', timestamp) AS day,price AS avg_btc_priceFROM prices.dayWHERE symbol = 'BTC'AND (blockchain IS NULL OR blockchain = 'bitcoin')AND timestamp >= TIMESTAMP '2023-10-30'AND timestamp <= TIMESTAMP '2026-02-02')SELECTs.day,ROUND(s.total_stable_supply_b, 2) AS stable_supply_billions,ROUND(b.avg_btc_price, 0) AS btc_price_usdFROM stable_balances sLEFT JOIN btc_price_base b ON s.day = b.dayORDER BY s.day ASC