Query editor
WITHdbc_tokens AS (SELECTaccount_config,account_quote_mint,call_tx_signer,CAST(JSON_EXTRACT_SCALAR(config_parameters, '$.ConfigParameters.collect_fee_mode') AS INT) AS collect_fee_modeFROM meteora_solana.dynamic_bonding_curve_call_create_config),blacklisted_pools AS (SELECTaccount_configFROM query_6006733),swap_events AS (SELECTs.config,s.trade_direction,s.amount_in,s.swap_result,s.evt_block_time,t.account_quote_mint,t.collect_fee_mode,CAST(JSON_EXTRACT_SCALAR(s.swap_result, '$.SwapResult.trading_fee') AS DECIMAL(38,0)) AS trading_fee,CAST(JSON_EXTRACT_SCALAR(s.swap_result, '$.SwapResult.protocol_fee') AS DECIMAL(38,0)) AS protocol_fee,CAST(JSON_EXTRACT_SCALAR(s.swap_result, '$.SwapResult.referral_fee') AS DECIMAL(38,0)) AS referral_fee,CAST(JSON_EXTRACT_SCALAR(s.swap_result, '$.SwapResult.output_amount') AS DECIMAL(38,0)) AS amount_outFROM meteora_solana.dynamic_bonding_curve_evt_evtswap sJOIN dbc_tokens t ON s.config = t.account_configWHERE s.evt_executing_account = 'dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN'AND NOT s.config IN (SELECTaccount_configFROM blacklisted_pools))SELECTDATE(evt_block_time) as date,account_quote_mint as quote_mint,SUM(CASEWHEN trade_direction = 1 THEN COALESCE(amount_in, 0)ELSE COALESCE(amount_out, 0)END) AS total_volume,SUM(CASEWHEN collect_fee_mode = 1 AND trade_direction = 1 THEN 0ELSE COALESCE(trading_fee, 0)END) AS total_trading_fees,SUM(CASEWHEN collect_fee_mode = 1 AND trade_direction = 1 THEN 0ELSE COALESCE(protocol_fee, 0)END) AS total_protocol_fees,SUM(CASEWHEN collect_fee_mode = 1 AND trade_direction = 1 THEN 0