Query editor
WITH-- ==========================================-- 1. Subquery for Fermi-- ==========================================fermi_swaps AS (SELECT'ethereum' AS blockchain,tx_hash,block_time AS time,'Fermi' AS provider,SUBSTR(topic2, 13, 20) AS token_in_address,SUBSTR(topic3, 13, 20) AS token_out_address,bytearray_to_uint256(SUBSTR(data, 1, 32)) AS amount_in_raw,bytearray_to_uint256(SUBSTR(data, 33, 32)) AS amount_out_rawFROM ethereum.logsWHERE contract_address = 0xb1076fE3AB5e28005C7c323Bac5AC06a680d452eAND topic0 = 0x58d77aee9b6d4a0709dc53a9b14e40fd6283c950843fced71fbb7639f1235ba4),-- ==========================================-- 2. Subquery for Bebop-- ==========================================bebop_swaps AS (SELECT'ethereum' AS blockchain,tx_hash,block_time AS time,'Bebop' AS provider,SUBSTR(topic2, 13, 20) AS token_in_address,SUBSTR(topic3, 13, 20) AS token_out_address,bytearray_to_uint256(SUBSTR(data, 1, 32)) AS amount_in_raw,bytearray_to_uint256(SUBSTR(data, 33, 32)) AS amount_out_rawFROM ethereum.logsWHERE contract_address = 0x160141A205F5dDcf096BA3F48B7eD21EB52c62EAAND topic0 = 0xcd3829a3813dc3cdd188fd3d01dcf3268c16be2fdd2dd21d0665418816e46062),-- ==========================================-- 3. Combine Titan propAMM partner swaps-- ==========================================all_swaps AS (SELECT * FROM fermi_swapsUNION ALLSELECT * FROM bebop_swaps),-- ==========================================-- 4. Daily token prices-- ==========================================daily_prices AS (SELECTblockchain,contract_address,