Query editor
with prices_usd as (SELECTminute,AVG(price) as priceFROM prices.usdWHERE blockchain = 'ethereum'and contract_address = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2GROUP BY 1),zora as (SELECTblock_time,tx_hash,bytearray_ltrim(topic1) as address,'zora' as chain,'creator reward' as action_type,(bytearray_to_uint256(substr(data, 1 + 32 * 3, 32)) / 1e18) as raw_amount0 -- mint referral amount -- mint referral amountFROM zora.logswhere topic0 = 0x90e8cce6b15b450d1e56e9ef986d1cd376838a90944336c02886ca12b9e6ebd7 -- deposit for zora protocol rewards topic-- and tx_hash = 0x7311894059d2f532ad635056832fa64c6a217617bcb288a2548d7bbf9d12c327UNION ALLSELECTblock_time,tx_hash,bytearray_ltrim(topic2) as address,'zora' as chain,'create referral reward' as action_type,(bytearray_to_uint256(substr(data, 1 + 32 * 4, 32)) / 1e18) as raw_amount0 -- mint referral amount -- mint referral amountFROM zora.logswhere topic0 = 0x90e8cce6b15b450d1e56e9ef986d1cd376838a90944336c02886ca12b9e6ebd7 -- deposit for zora protocol rewards topic-- and tx_hash = 0x7311894059d2f532ad635056832fa64c6a217617bcb288a2548d7bbf9d12c327UNION ALLSELECTblock_time,tx_hash,bytearray_ltrim(topic3) as address,'zora' as chain,'mint referral reward' as action_type,(bytearray_to_uint256(substr(data, 1 + 32 * 5, 32)) / 1e18) as raw_amount0 -- mint referral amountFROM zora.logswhere topic0 = 0x90e8cce6b15b450d1e56e9ef986d1cd376838a90944336c02886ca12b9e6ebd7 -- deposit for zora protocol rewards topic-- and tx_hash = 0x7311894059d2f532ad635056832fa64c6a217617bcb288a2548d7bbf9d12c327UNION ALLSELECTblock_time,tx_hash,(bytearray_ltrim(substr(data, 1 + 32 * 0, 32))) as address,'zora' as chain,'first mint reward' as action_type,(bytearray_to_uint256(substr(data, 1 + 32 * 6, 32)) / 1e18) as raw_amount0 -- mint referral amountFROM zora.logswhere topic0 = 0x90e8cce6b15b450d1e56e9ef986d1cd376838a90944336c02886ca12b9e6ebd7 -- deposit for zora protocol rewards topic