c2ctrader02 - Bots and success rate
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
31
32
33
34
35
36
›
⌄
with bots_TX_SUC as(
select date_trunc('hour',block_timestamp) time,TX_FROM trader,count(*) count
from terra.transactions WHERE BLOCK_TIMESTAMP<=CURRENT_DATE-59 AND tx_status ilike 'SUCCEEDED'
group by time,tx_from
having count(*)>=120
order by count desc
),
--***************************************************************************
bots_suc_in_min as (select time,sum(count) bots_tx_success from bots_tx_suc group by time),
--***************************************************************************
bots_TX_fail as (
select date_trunc('hour',block_timestamp) time,TX_FROM trader,count(*) count
from terra.transactions WHERE BLOCK_TIMESTAMP<=CURRENT_DATE-59 AND tx_status ilike 'failed'
group by time,tx_from
having count(*)>=120
order by count desc
),
--*******************************************************************************
bots_fail_in_min as (select time,sum(count) bot_tx_failed from bots_tx_fail group by time),
--*******************************************************************************
users_TX_SUC as (
select date_trunc('hour',block_timestamp) time,TX_FROM trader,count(*) count
from terra.transactions WHERE BLOCK_TIMESTAMP<=CURRENT_DATE-59 AND tx_status ilike 'SUCCEEDED'
group by time,TX_FROM
having count(*)<120
order by count desc
),
--*********************************************
users_suc_in_min as (select time,sum(count) user_tx_success from users_TX_SUC group by time),
--*****************************************
users_TX_fail as (
select date_trunc('hour',block_timestamp) time,TX_FROM trader,count(*) count
from terra.transactions WHERE BLOCK_TIMESTAMP<=CURRENT_DATE-59 AND tx_status ilike 'failed'
group by time,TX_FROM
having count(*)<120
order by count desc
Run a query to Download Data