Query editor
withprices as ( --THIS COMMON TABLE EXPRESSION IS USED TO GET DAILY PRICES OF THE TOKENselectDATE(hour) as dt, contract_address, AVG(price) as pricefrom dex_solana.price_hourwhere contract_address = '2zMMhcVQEXDtdE6vsFS7S7D5oUodfJHE8vd1gnBouauv'and DATE(hour) >= DATE '2025-10-01'group byDATE(hour), contract_address)selectblock_date, 'buy_amount' as tx_type, SUM(tr.token_bought_amount * pr.price) as Daily_volume, 'no_of_buyers' as buyers_and_sellers, COUNT(distinct trader_id) as Traders, 'buy_txns' as tx, COUNT(token_bought_mint_address) as Transactionsfrom dex_solana.trades as trinner join prices as pr on tr.token_bought_mint_address = pr.contract_addressand pr.dt = tr.block_datewhere token_bought_mint_address = '2zMMhcVQEXDtdE6vsFS7S7D5oUodfJHE8vd1gnBouauv'and tr.block_date >= DATE '2025-10-01'group byblock_dateunionselectblock_date, 'sell_amount' as tx_type, SUM(tr.token_sold_amount * pr.price) as volume, 'no_of_sellers' as buyers_and_sellers, COUNT(distinct trader_id) as Traders, 'sell_txns' as tx, COUNT(token_sold_mint_address) as Transactionsfrom dex_solana.trades as trinner join prices as pr on tr.token_sold_mint_address = pr.contract_addressand pr.dt = tr.block_datewhere token_sold_mint_address = '2zMMhcVQEXDtdE6vsFS7S7D5oUodfJHE8vd1gnBouauv'and tr.block_date >= DATE '2025-10-01'group byblock_dateorder byblock_date