maybeyonasthorchain_fee_xmas
Updated 2021-12-24
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 swap_from as (
select
block_timestamp,
tx_id,
from_address as address,
liq_fee_rune as fee
from thorchain.swaps
),
swap_to as (
select
block_timestamp,
tx_id,
to_address,
liq_fee_rune as fee
from thorchain.swaps
),
swaps as (
select * from swap_from
where block_timestamp > current_date - interval '30 days'
union all
select * from swap_to
where block_timestamp > current_date - interval '30 days'
),
last_30 as (
select
address,
count(tx_id) as swaps,
sum(fee) as fee_vol
from swaps
group by 1
),
all_swaps as (
select sum(liq_fee_rune) as total_fee from thorchain.swaps
where block_timestamp > current_date - interval '30 days'
)
Run a query to Download Data