Query editor
withtimeline as (select date_trunc('day', time) as dayfrom unnest(sequence(timestamp '2024-08-28',cast(NOW() as timestamp),interval '1' day)) as s(time)), ape_sent as (selecttx_hash, block_time, date_trunc('day', block_time) as day, 'ethereum' as blockchain, bytearray_substring(topic2, 13, 20) as from_address, bytearray_to_uint256(bytearray_ltrim(bytearray_substring(data, 1, 32))) as dst_eid, cast(bytearray_to_int256(bytearray_ltrim(bytearray_substring(data, 33, 32))) as double) / pow(10, 18) as amount_sent, cast(bytearray_to_int256(bytearray_ltrim(bytearray_substring(data, 65, 32))) as double) / pow(10, 18) as amount_receivedfrom ethereum.logswhere block_time >= timestamp '2024-08-28'and contract_address = 0x5182feDE730b31a9CF7f49C5781214B4a99F2370and topic0 = 0x85496b760a4b7f8d66384b9df21b381f5d1b1e79f229a47aaf4c232edc2fe59a -- OFTSentunion allselecttx_hash, block_time, date_trunc('day', block_time) as day, 'arbitrum' as blockchain, bytearray_substring(topic2, 13, 20) as from_address, bytearray_to_uint256(bytearray_ltrim(bytearray_substring(data, 1, 32))) as dst_eid, cast(bytearray_to_int256(bytearray_ltrim(bytearray_substring(data, 33, 32))) as double) / pow(10, 18) as amount_sent, cast(bytearray_to_int256(bytearray_ltrim(bytearray_substring(data, 65, 32))) as double) / pow(10, 18) as amount_receivedfrom arbitrum.logswhere block_time >= timestamp '2024-08-28'and contract_address = 0x7f9FBf9bDd3F4105C478b996B648FE6e828a1e98and topic0 = 0x85496b760a4b7f8d66384b9df21b381f5d1b1e79f229a47aaf4c232edc2fe59a -- OFTSent), ape_received as (selecttx_hash, block_time, date_trunc('day', block_time) as day, 'ethereum' as blockchain, bytearray_substring(topic2, 13, 20) as to_address, bytearray_to_uint256(bytearray_ltrim(bytearray_substring(data, 1, 32))) as src_eid, cast(bytearray_to_int256(bytearray_ltrim(bytearray_substring(data, 33, 32))) as double) / pow(10, 18) as amount_receivedfrom ethereum.logswhere block_time >= timestamp '2024-08-28'and contract_address = 0x5182feDE730b31a9CF7f49C5781214B4a99F2370and topic0 = 0xefed6d3500546b29533b128a29e3a94d70788727f0507505ac12eaf2e578fd9c -- OFTReceivedunion allselect