Query editor
WITH charge_fee AS (selectevt_block_date,evt_tx_hash,evt_index+2 as evt_index,sum(amount) as charge_feefromprobable_v1_bnb.ctfexchange_evt_feechargedwhere CAST(tokenId AS VARCHAR) = '0'group by 1,2,3unionselectevt_block_date,evt_tx_hash,evt_index+4 as evt_index,sum(amount)feefromprobable_v1_bnb.ctfexchange_evt_feechargedwhere CAST(tokenId AS VARCHAR) = '0'group by 1,2,3unionselectevt_block_date,evt_tx_hash,evt_index+6 as evt_index,sum(amount)feefromprobable_v1_bnb.ctfexchange_evt_feechargedwhere CAST(tokenId AS VARCHAR) = '0'group by 1,2,3),refund_fee AS (selectevt_block_date,evt_tx_hash,evt_index-2 as evt_index,-sum(refund) refud_feefromprobable_v1_bnb.feemodule_evt_feerefundedwhere CAST(id AS VARCHAR) = '0'group by 1,2,3unionselectevt_block_date,evt_tx_hash,evt_index-4 as evt_index,-sum(refund) refud_feefromprobable_v1_bnb.feemodule_evt_feerefundedwhere CAST(id AS VARCHAR) = '0'group by 1,2,3)SELECTquestion,case whentag1 in ('Stock') or tag2 in ('Stock') or tag3 in ('Stock') then 'Stock'when