LTirrell5. Swapping -- all
Updated 2021-11-11
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
›
⌄
SELECT
date(block_timestamp) AS day,
pool_name,
COUNT(DISTINCT tx_id) AS swap_count,
SUM(volume) AS swap_volume,
COUNT(DISTINCT to_address) AS to_addresses,
COUNT(DISTINCT from_address) AS from_addresses,
COUNT(DISTINCT to_address, from_address) as all_addresses
FROM (
SELECT
tx_id,
to_address,
from_address,
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
Run a query to Download Data