shadilNet Synth Amounts - Net Synth(mints - burns) for each asset
Updated 2022-04-29
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 mints as (
SELECT
split(pool_name, '.')[1] as pool_name_tmp,
split(pool_name_tmp, '-')[0] as pool_name_part,
split(pool_name, '.')[0] as network,
concat(pool_name_part, ' - ', network) as pool_name,
count(DISTINCT tx_id) as counter,
sum(from_amount_usd) as volume
from thorchain.swaps
where to_asset like '%/%'
GROUP by pool_name_part, pool_name
),
burns as (
SELECT
split(pool_name, '.')[1] as pool_name_tmp,
split(pool_name_tmp, '-')[0] as pool_name_part,
split(pool_name, '.')[0] as network,
concat(pool_name_part, ' - ', network) as pool_name,
count(DISTINCT tx_id) as counter,
sum(from_amount_usd) * -1 as volume
from thorchain.swaps
where from_asset like '%/%'
GROUP by pool_name_part, pool_name
)
SELECT
pool_name_part,
sum(counter) as counter,
sum(volume) as volume
from (
SELECT * from mints
UNION
SELECT * from burns
)
GROUP by pool_name_part
Run a query to Download Data