binhachonUntitled Query
Updated 2022-01-30
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 node_status as (
select
distinct from_address as node_address
from thorchain.bond_events
where bond_type = 'bond_paid'
),
node_swap_volume as (
select
date_trunc('week', block_timestamp) as blocktime,
sum(case when from_asset = 'THOR.RUNE' then from_amount else -to_amount end) as volume
from thorchain.swaps
where from_address in (select node_address from node_status)
and (from_asset = 'THOR.RUNE' or to_asset = 'THOR.RUNE')
group by blocktime
),
node_transfers as (
select
date_trunc('week', block_timestamp) as blocktime,
sum(amount_e8)/1e8 as volume
from thorchain.transfer_events
where to_address in (select node_address from node_status)
and asset = 'THOR.RUNE'
group by blocktime --to_address, asset
),
node_transfers_address as (
select
distinct to_address
from thorchain.transfer_events
where from_address in (select node_address from node_status)
and asset = 'THOR.RUNE'
),
node_transfers_address_1 as (
select
distinct to_address
from thorchain.transfer_events
where from_address in (select to_address from node_transfers_address)
Run a query to Download Data