Query editor
with inflows as (selectdate_trunc('minute', tt.evt_block_time) as time, "from" as sending_wallet, cast(tt.value as double) /pow(10, COALESCE(tk.decimals, 18)) as token_value, cast(tt.value as double) /pow(10, COALESCE(tk.decimals, 18)) * price as token_value_usd, COALESCE(tk.symbol, cast(tk.contract_address as varchar)) as symbol, get_href(get_chain_explorer_tx_hash('ethereum', cast(tt.evt_tx_hash as varchar)), cast(tt.evt_tx_hash as varchar)) as tx_hashfromerc20_ethereum.evt_Transfer ttleft join tokens.erc20 as tk on tk.contract_address = tt.contract_address and tk.blockchain = 'ethereum'left join prices.usd as p on p.contract_address = tt.contract_addressand date_trunc('minute', p.minute) = date_trunc('minute', tt.evt_block_time)and tk.blockchain = 'ethereum'where to = {{3. Wallet Address}}and tt.evt_block_time >= cast('{{1. Start date}}' as timestamp)and tt.evt_block_time <= cast('{{2. End date}}' as timestamp)UNION ALLselectdate_trunc('minute', et.block_time) as time, "from" as sending_wallet, cast(et.value as double) /pow(10, 18) as token_value, cast(et.value as double) /pow(10, 18) * price as token_value_usd, 'ETH' as symbol, get_href(get_chain_explorer_tx_hash('ethereum', cast(et.hash as varchar)), cast(et.hash as varchar)) as tx_hashfrom ethereum.transactions as etleft join prices.usd as p on date_trunc('minute', et.block_time) = date_trunc('minute', p.minute) and p.symbol = 'ETH' and p.contract_address is NULLwhere to = {{3. Wallet Address}}and et.block_time >= cast('{{1. Start date}}' as timestamp)and et.block_time <= cast('{{2. End date}}' as timestamp)order by time desc)select * frominflowsorder by time desc