SniperTotal Weekly Real User Count Vs Arbitrageurs Count
Updated 2022-12-14
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 tbl1 as (select date_trunc('week', block_timestamp) as week,
trader,
count(distinct(tx_id)) as swap_count
from osmosis.core.fact_swaps
where tx_status = 'SUCCEEDED'
and (from_currency = 'ibc/3FF92D26B407FD61AE95D975712A7C319CDE28DE4D80BDC9978D935932B991D7'
or to_currency = '3FF92D26B407FD61AE95D975712A7C319CDE28DE4D80BDC9978D935932B991D7')
group by 1,2
having swap_count >= 100),
tbl2 as (select date_trunc('week', block_timestamp) as week,
'Real' as type,
count(distinct(tx_id)) as real_tx,
sum(real_tx) over (order by week) as cum_real_tx,
count(distinct(trader)) as real_user,
sum(real_user) over (order by week) as cum_real
from osmosis.core.fact_swaps
where tx_status = 'SUCCEEDED'
and (from_currency = 'ibc/3FF92D26B407FD61AE95D975712A7C319CDE28DE4D80BDC9978D935932B991D7'
or to_currency = '3FF92D26B407FD61AE95D975712A7C319CDE28DE4D80BDC9978D935932B991D7')
and trader not in (select trader from tbl1)
group by 1,2),
tbl3 as (select date_trunc('week', block_timestamp) as week,
'Arbitrageurs' as type,
count(distinct(tx_id)) as arbitrageurs_tx,
sum(arbitrageurs_tx) over (order by week) as cum_arbitrageurs_tx,
count(distinct(trader)) as arbitrageurs,
sum(arbitrageurs) over (order by week) as cum_arbitrageurs
from osmosis.core.fact_swaps
where tx_status = 'SUCCEEDED'
and (from_currency = 'ibc/3FF92D26B407FD61AE95D975712A7C319CDE28DE4D80BDC9978D935932B991D7'
or to_currency = '3FF92D26B407FD61AE95D975712A7C319CDE28DE4D80BDC9978D935932B991D7')
and trader in (select trader from tbl1)
group by 1,2)
Run a query to Download Data