Query editor
with holder_fil AS (SELECTtoken_balance_owner,token_balance,ROW_NUMBER() over (PARTITION BY token_balance_owner ORDER BY block_time DESC) AS rnFROM solana_utils.latest_balancesWHERE token_mint_address = '4vMsoUT2BWatFweudnQM1xedRLfJgJ7hswhcpz4xgBTy'-- LIMIT 25),txns AS (SELECTamount/1e9 AS amount,call_tx_id,'burn' AS typeFROM spl_token_solana.spl_token_call_burnWHERE call_block_time > date'2022-10-31'AND account_mint = '4vMsoUT2BWatFweudnQM1xedRLfJgJ7hswhcpz4xgBTy'UNIONSELECTamount/1e9 AS amount,call_tx_id,'mint' AS typeFROM spl_token_solana.spl_token_call_mintToWHERE call_block_time > date'2022-10-31'AND account_mint = '4vMsoUT2BWatFweudnQM1xedRLfJgJ7hswhcpz4xgBTy')SELECTCOUNT(DISTINCT tx_id) filter (where token_bought_mint_address = '4vMsoUT2BWatFweudnQM1xedRLfJgJ7hswhcpz4xgBTy') AS num_buys,COUNT(DISTINCT tx_id) filter (where token_sold_mint_address = '4vMsoUT2BWatFweudnQM1xedRLfJgJ7hswhcpz4xgBTy') AS num_sells,(SELECT COUNT(token_balance_owner) FROM holder_fil WHERE rn = 1) AS num_address_ever_had_honey,(SELECT COUNT(token_balance_owner) FROM holder_fil WHERE rn = 1 AND token_balance > 0) AS num_holders,SUM(amount_usd) AS trade_volumeFROM dex_solana.tradesWHEREtoken_sold_mint_address = '4vMsoUT2BWatFweudnQM1xedRLfJgJ7hswhcpz4xgBTy'OR token_bought_mint_address = '4vMsoUT2BWatFweudnQM1xedRLfJgJ7hswhcpz4xgBTy'