alleria4. [Easy] Total volume swapped by pool and over time Native Coins
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
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
WITH all_swap_volume as (
SELECT
day,
pool_name,
swap_volume_rune,
swap_volume_rune_usd
FROM thorchain.daily_pool_stats
ORDER BY day ASC
),
BTC_cumulative as (
SELECT
day,
SUM(swap_volume_rune) OVER (ORDER BY day) as cumulative_rune_volume_BTC,
SUM(swap_volume_rune_usd) OVER (ORDER BY day) as cumulative_USD_volume_BTC
FROM all_swap_volume
WHERE pool_name = 'BTC.BTC'
),
LTC_cumulative as (
SELECT
day,
SUM(swap_volume_rune) OVER (ORDER BY day) as cumulative_rune_volume_LTC,
SUM(swap_volume_rune_usd) OVER (ORDER BY day) as cumulative_USD_volume_LTC
FROM all_swap_volume
WHERE pool_name = 'LTC.LTC'
),
BCH_cumulative as (
SELECT
day,
SUM(swap_volume_rune) OVER (ORDER BY day) as cumulative_rune_volume_BCH,
SUM(swap_volume_rune_usd) OVER (ORDER BY day) as cumulative_USD_volume_BCH
FROM all_swap_volume
WHERE pool_name = 'BCH.BCH'
),
Run a query to Download Data