binhachon24. [Easy] Swap Size Distribution - THOR
Updated 2021-12-05
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
›
⌄
select
swap_size,
sum(frequency) over (
partition by blockchain
order by
swap_size
) * 100 / sum(frequency) over (
partition by blockchain
order by
blockchain
) as frequency,
sum(volume) over (
partition by blockchain
order by
swap_size
) * 100 / sum(volume) over (
partition by blockchain
order by
blockchain
) as volume
from
(
select
blockchain,
round(from_amount_usd,-1) as swap_size,
count(from_amount_usd) as frequency,
sum(from_amount_usd) as volume
from
thorchain.swaps
where
block_timestamp > getdate() - interval '90 days'
group by
blockchain,
swap_size
)
where
Run a query to Download Data