Query editor
WITHtrades AS (SELECT*,date_trunc('day', block_time) AS block_dateFROM/* Trades */query_4086080),openInterestChanges AS (SELECT*,date_trunc('day', block_time) AS block_dateFROM/* Open Interest Changes */query_4086137),tradingActivity AS (SELECTblock_date,market,marketType,SUM(sizeDelta) AS volumeUSD,SUM(COALESCE(fee, 0) + COALESCE(fundingFee, 0) + COALESCE(borrowFee, 0)) AS totalFeesUSD,COUNT(DISTINCT (trades.user)) AS numberOfUsers,COUNT(DISTINCT (tx_hash)) AS numberOfTrades,-- FeesSUM(fee) AS feesUSD,SUM(fundingFee) AS fundingFeesUSD,SUM(borrowFee) AS borrowFeesUSDFROMtradesGROUP BYblock_date,market,marketType),openInterest AS (SELECTblock_date,market,marketType,SUM(amount) AS openInterestDeltaUSD,SUM(SUM(amount)) OVER (PARTITION BYmarketORDER BYblock_date ASC) AS openInterestUSDFROMopenInterestChangesGROUP BYblock_date,market,marketType)SELECTtradingActivity.block_date,