Query editor
WITH lp_addresses AS (SELECT * FROM query_4703271),combined_logs AS (SELECTblock_time, block_number,la.underlying_address,contract_address,topic0, topic1,topic2, topic3, data,tx_hash, index,block_date,tx_from, tx_to,'arbitrum' as chain_nameFROM arbitrum.logs lJOIN lp_addresses la ON la.chain_name = 'arbitrum'AND l.block_number >= la.start_blockAND l.contract_address = la.lp_address-- 时光机:只统计目标日期及之前的日志WHERE l.block_time <= CAST('{{Target_Date}}' AS TIMESTAMP)UNION ALLSELECTblock_time, block_number,la.underlying_address,contract_address,topic0, topic1,topic2, topic3, data,tx_hash, index,block_date,tx_from, tx_to,'ethereum' as chain_nameFROM ethereum.logs lJOIN lp_addresses la ON la.chain_name = 'ethereum'AND l.block_number >= la.start_blockAND l.contract_address = la.lp_addressWHERE l.block_time <= CAST('{{Target_Date}}' AS TIMESTAMP)UNION ALLSELECTblock_time, block_number,la.underlying_address,contract_address,topic0, topic1,topic2, topic3, data,tx_hash, index,block_date,tx_from, tx_to,'bnb' as chain_nameFROM bnb.logs lJOIN lp_addresses la ON la.chain_name = 'bnb'AND l.block_number >= la.start_blockAND l.contract_address = la.lp_addressWHERE l.block_time <= CAST('{{Target_Date}}' AS TIMESTAMP)UNION ALLSELECTblock_time, block_number,la.underlying_address,contract_address,topic0, topic1,