farid-c9j0VMDaily number of Transactions executed by Real Users vs Arbitrageurs
Updated 2022-12-14Copy 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
28
29
30
31
32
33
34
35
36
›
⌄
--/credit Rayyyk
with arbi 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),
table_1 as (select date_trunc('week', block_timestamp) as week,
count(distinct(tx_id)) as real_tx,
sum(real_tx) over (order by week) as cumu_real_tx,
count(distinct(trader)) as real_user
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)
group by 1),
table_2 as (select date_trunc('week', block_timestamp) as week,
count(distinct(tx_id)) as arbi_tx,
sum(arbi_tx) over (order by week) as cumu_arbi_tx,
count(distinct(trader)) as 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 arbi)
group by 1)
select a.week,
real_tx,
arbi_tx,
Run a query to Download Data