Pmisha-bmlMdxbot.percent
Updated 2022-04-28
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
25
26
27
28
29
30
›
⌄
with bot_s as (
select date_trunc('minute',block_timestamp) as min,
trader,
count(tx_id) as used
from terra.swaps
where block_timestamp::date >= current_date - 30
group by 1, 2
having used >= 20
),
bots as (
select
'BOTS' as user_type,
count(tx_id) as swaps
from terra.swaps
where block_timestamp::date > current_date - 30
and trader in (select distinct trader from bot_s)
group by 1
),
ord_users as (
select
'Average users' as user_type,
count(tx_id) as swaps
from terra.swaps
where block_timestamp::date > current_date - 30
and trader not in (select distinct trader from bot_s)
group by 1
)
select * from bots
union all
select * from ord_users
Run a query to Download Data