mogarchyMonthly Volume
Updated 2022-07-25Copy 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
›
⌄
with botters as (select
date_trunc('hour', block_timestamp) as hour,
from_address,
count(distinct(tx_id)) as count_swap
from thorchain.swaps
group by 1,2
having count_swap >= 50),
base as (select
date_trunc('month', block_timestamp) as month,
pool_name,
split(pool_name, '-')[0] as pool_names,
split(pool_name, '.')[0] as chain_names,
case
when from_address in (select from_address from botters) then 'Botters'
else 'Typical_swapper'
end as type_swapper,
sum(to_amount_usd) as swap_volume,
count(distinct(tx_id)) as count_swap,
count(distinct(from_address)) as count_swappers
from thorchain.swaps
where month >= '2022-01-01'
group by 1,2,5)
select month,
type_swapper,
sum(swap_volume) as swap_volume,
sum(count_swap) as count_swap,
sum(count_swappers) as count_swappers
from base
group by 1,2
order by 3 desc
Run a query to Download Data