nitsTransaction pattern of these users?
Updated 2022-02-22
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
›
⌄
with txs as (SELECT *,
CASE when direction = 'IN' then amount_in else amount_out*(-1) end as amt_net,
CASE when direction = 'IN' then amount_usd else amount_usd*(-1) end as amt_usd_net
from ethereum.dex_swaps
where block_timestamp > '2021-01-01' and platform = 'sushiswap')
SELECT date(block_timestamp) as day, sum(amt_usd_net) as total_usd_vol, count(DISTINCT to_address) as unique_addresses, count(*) as total_txs
from txs where to_address in
(SELECT to_address
from
(SELECT to_address, sum(amt_net) as net_amt_today, sum(amt_usd_net)- sum(fee_usd) as amt_usd_net_today, sum(amt_usd_net) as total_without_fee
from
(SELECT * from
(SELECT tx_id as tx,fee_Usd from ethereum.transactions )
inner join txs
on tx_id = tx)
GROUP by 1)
where net_amt_today >= '-0.01' and net_amt_today <= '0.01' AND amt_usd_net_today <= '0')
and amt_usd_net is not NULL
GROUP by 1