bachi13. Thorchain - Combinations
Updated 2021-11-03
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
›
⌄
⌄
/*SELECT
date(block_timestamp) AS day,
pool_name,
COUNT(DISTINCT tx_id) AS swap_count,
SUM(volume) AS swap_volume
FROM (
SELECT
tx_id,
block_timestamp,
pool_name,
CASE WHEN to_asset = 'THOR.RUNE' THEN to_e8 ELSE from_e8 END AS volume
FROM thorchain.swap_events
)
GROUP BY 1,2
ORDER BY 1 DESC, 2 ASC*/
--select concat(from_asset, ' ', to_asset) as pair from thorchain.swaps limit 10;
select date_trunc(day, block_timestamp) as date, concat(from_asset, ' ', to_asset) as swap_pair, count(*) as Swap_count, sum(to_amount) as Swap_vol
from thorchain.swaps group by swap_pair, date;
Run a query to Download Data