Query editor
WITH constants AS (SELECT0x0000000000000000000000000000000000000000 AS nullAddress,0xe72b141df173b999ae7c1adcbf60cc9833ce56a8 AS ethplus), mb AS (SELECTDATE_TRUNC('hour', evt_block_time) AS time,SUM(CASEWHEN "from" = nullAddressTHEN TRY_CAST(value AS DOUBLE) / 1e18WHEN "to" = nullAddressTHEN -TRY_CAST(value AS DOUBLE) / 1e18ELSE 0END) AS transferFROM erc20_ethereum.evt_Transfer, constantsWHEREcontract_address = ethplus /* token contract address */GROUP BY1), mb_sum AS (SELECTtime,SUM(transfer) OVER (ORDER BY time) AS valueFROM mb), eth_prices AS (SELECTDATE_TRUNC('hour', minute) AS time,price AS token_priceFROM prices.usdWHEREcontract_address = FROM_HEX(LOWER('C02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2')))SELECTmb_sum.time,mb_sum.value AS "Token Transfer Volume",eth_prices.token_price,mb_sum.value * eth_prices.token_price AS "Market Cap ($)",(mb_sum.value * eth_prices.token_price) / 1e6 AS "Market Cap ($ M)"FROMmb_sumJOINeth_prices ON mb_sum.time = eth_prices.timeORDER BYmb_sum.time DESC;