Query editor
with static as (select date_trunc('month', current_timestamp) - interval '8' month as ts_from)----------- ETHEREUM -------------, ethereum_traces as (selecttx_hash, transactions.block_time, start, caller, transactions."from" tx_fromfrom (select * from ethereum.transactionswhere block_time >= (select ts_from from static) and success) as transactionsjoin (select tx_hash, min(trace_address) as start, min_by("from", trace_address) as callerfrom ethereum.traceswhereblock_time >= (select ts_from from static)and "to" in (select address from query_2238512where project = '1inch')and tx_successand successgroup by tx_hash) gr_traces on transactions."hash" = gr_traces.tx_hash), ethereum as (selecttraces.tx_hash, transfers.block_time, traces.start, contract_address, amount, caller, tx_from, 'ethereum' as chainfrom ethereum_traces as tracesjoin (select block_time, tx_hash, casewhen value > uint256 '0' then 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 -- WETHelse toend as contract_address, case substr(input, 1, 4)when 0xa9059cbb then bytearray_to_uint256(substr(input, 37, 32)) -- transferwhen 0x23b872dd then bytearray_to_uint256(substr(input, 69, 32)) -- transferFromelse value -- ETHend as amount, trace_addressfrom ethereum.traceswhere block_time >= (select ts_from from static)and (substr(input, 1, 4) in (0xa9059cbb, 0x23b872dd) or value > uint256 '0')and tx_successand success