Query editor
-- Replace everything in 0x79dacb99A8698052a9898E81Fdf883c29efb93cb-- with your token's address (ACOLYT).-- Replace everything in 0xee9808eee64586db307a995ddccb27769875e8b5-- with your staking pool address if it differs.WITH token_balances AS (SELECT-- tokens sold-SUM(CAST(value AS double) / 1e18) AS amount,"from" AS addressFROM erc20_base.evt_transfer aWHERE a.contract_address = 0x79dacb99A8698052a9898E81Fdf883c29efb93cbGROUP BY 2UNION ALLSELECT-- tokens boughtSUM(CAST(value AS double) / 1e18) AS amount,a.to AS addressFROM erc20_base.evt_transfer aWHERE a.contract_address = 0x79dacb99A8698052a9898E81Fdf883c29efb93cbGROUP BY 2),token_holders AS (SELECTaddress,SUM(amount) AS balanceFROM token_balancesGROUP BY 1),token_trades AS (SELECTt.tx_from,t.token_bought_address,t.token_sold_address,t.amount_usd,CASEWHEN t.token_bought_address = 0x79dacb99A8698052a9898E81Fdf883c29efb93cbTHEN t.token_bought_amountELSE 0END AS token_bought_amount,CASEWHEN t.token_sold_address = 0x79dacb99A8698052a9898E81Fdf883c29efb93cbTHEN t.token_sold_amountELSE 0END AS token_sold_amount,t.block_time,-- NOTE: There's no "to" or "to_address" column in the schema image;-- "tx_to" is the likely recipient column.t.tx_to AS tx_to,h.balanceFROM dex.trades tINNER JOIN token_holders hON t.tx_from = h.addressWHERE