RayyykDOT DOT, Who's There? 2
Updated 2022-12-12Copy Reference Fork
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
›
⌄
with arbi as (select date_trunc('day', block_timestamp) as day,
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)
select 'Real Users',
count(distinct(trader)) as real_user,
count(distinct(tx_id)) as tx_count
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 arbi)
union
select 'Arbitrageurs',
count(distinct(trader)) as real_user,
count(distinct(tx_id)) as tx_count
from osmosis.core.fact_swaps
where tx_status = 'SUCCEEDED'
and (from_currency = 'ibc/3FF92D26B407FD61AE95D975712A7C319CDE28DE4D80BDC9978D935932B991D7'
or to_currency = '3FF92D26B407FD61AE95D975712A7C319CDE28DE4D80BDC9978D935932B991D7')
and trader in (select trader from arbi)
Run a query to Download Data