boomer77rune vs swap vol
Updated 2022-01-23
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
›
⌄
with native_rune as (select date_trunc('day', block_timestamp) as dt, avg(rune_usd) as native_rune
from thorchain.prices
group by 1),
erc20 as (select date_trunc('day', hour) as dt, avg(price) as erc20_RUNE
from ethereum.token_prices_hourly
where symbol = 'RUNE'
group by 1),
raw as (select distinct tx_id, block_timestamp, to_amount_usd
from thorchain.swaps),
volume as (select date_trunc('day', block_timestamp) as dt, count(tx_id) as tx_count, sum(to_amount_usd) as swap_volume
from raw
group by 1)
select a.dt, a.native_rune, b.erc20_rune, c.tx_count, c.swap_volume
from native_rune a
left outer join erc20 b on a.dt = b.dt
left outer join volume c on a.dt = c.dt
Run a query to Download Data