barbodBots and success rate
Updated 2022-04-27
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 bots as (
select date_trunc('minute',block_timestamp) as min, trader, count(*) as txs
from terra.swaps
where block_timestamp::date >= current_date - 60
group by 1, 2
having txs > 15
),
txs_bots as (
select block_timestamp::date as date,
count(case when tx_status = 'SUCCEEDED' then 1 else null end) as success,
count(case when tx_status = 'FAILED' then 1 else null end) as failed
from terra.msgs
where block_timestamp::date > current_date - 60
and msg_value:trader in (select distinct trader from bots)
group by 1
),
txs_users as (
select block_timestamp::date as date,
count(case when tx_status = 'SUCCEEDED' then 1 else null end) as success,
count(case when tx_status = 'FAILED' then 1 else null end) as failed
from terra.msgs
where block_timestamp::date > current_date - 60
and msg_value:trader not in (select distinct trader from bots)
group by 1
)
select b.date as day, b.success as bots_success, b.failed as bots_failed,
u.success as users_success, u.failed as users_failed
from txs_bots b
join txs_users u on b.date = u.date
order by 1
Run a query to Download Data