maybeyonasthor_asset_move_in
Updated 2021-10-23
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 in_thor as(
select
block_timestamp,
from_asset,
from_amount,
from_amount_usd,
'in' as direction
from thorchain.swaps
where from_asset != 'THOR.RUNE'
),
out_thor as(
select
block_timestamp,
from_asset,
to_amount,
to_amount_usd,
'out' as direction
from thorchain.swaps
where from_asset = 'THOR.RUNE'
),
in_out as(
select * from in_thor
union all
select * from out_thor
)
select
to_char(block_timestamp, 'yyyy-mm-dd') as date,
from_asset,
direction,
sum(from_amount) as token,
sum(from_amount_usd) as token_usd
from in_out
where direction = 'in'
group by 1,2,3
Run a query to Download Data