Query editor
WITH eth_etf_flows AS (SELECTtime,issuer,net_flow_usd AS eth_net_flowFROM query_4208557),btc_etf_flows AS (SELECTtime,issuer,amount_usd_net_flow AS btc_net_flowFROM query_4283973),combined_etf AS (SELECTe.time AS date,CONCAT(e.issuer, ' (eth)') AS issuer,e.eth_net_flow,NULL AS btc_net_flowFROM eth_etf_flows eUNION ALLSELECTb.time AS date,CONCAT(b.issuer, ' (btc)') AS issuer,NULL AS eth_net_flow,b.btc_net_flowFROM btc_etf_flows b),btc_oracle AS (SELECTdate_trunc('day', minute) AS date,'btc' AS ticker,AVG(price) AS btc_priceFROM prices.usdWHERE symbol = 'BTC'AND minute >= date('2024-01-01')GROUP BY 1, 2),eth_oracle AS (SELECTdate_trunc('day', minute) AS date,'eth' AS ticker,AVG(price) AS eth_priceFROM prices.usdWHERE symbol = 'ETH'AND minute >= date('2024-08-13')GROUP BY 1, 2)SELECTc.date,c.issuer,c.eth_net_flow,c.btc_net_flow,eo.eth_price,bo.btc_price,eo.eth_price * 120417787 as eth_fdv,bo.btc_price * 21000000 as btc_fdv,(c.eth_net_flow / (eo.eth_price * 120417787)) as eth_vol_share_of_fdv,