SandeshUntitled Query
Updated 2023-04-13Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
›
⌄
with last_out as
(
select * from terra.core.ez_transfers
where currency='uluna'
qualify(row_number() over (partition by sender order by block_timestamp desc)) = 1
),
last_in as
(
select * from terra.core.ez_transfers
where currency='uluna'
qualify(row_number() over (partition by RECEIVER order by block_timestamp desc)) = 1
),
comb as
(
select lin.* from last_in lin right join last_out lout
on lin.RECEIVER=lout.sender and lin.block_timestamp>lout.block_timestamp
)
select sum(amount)/1e6 as t from comb
Run a query to Download Data