0-MIDMonthly Distribution of Flow Balance by Flow Holders
Updated 2022-11-29
999
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 act1 as (
with tab1 as (
select
EVENT_DATA:to as user
,sum (EVENT_DATA:amount) as Deposit_Volume
from flow.core.fact_events
where EVENT_CONTRACT = 'A.1654653399040a61.FlowToken'
and EVENT_TYPE = 'TokensDeposited'
and TX_SUCCEEDED = 'TRUE'
and BLOCK_TIMESTAMP<='2022-01-01'
group by 1),
tab2 as (
select
EVENT_DATA:from as user,
sum (EVENT_DATA:amount) as Withdraw_Volume
from flow.core.fact_events
where EVENT_CONTRACT='A.1654653399040a61.FlowToken'
and EVENT_TYPE='TokensWithdrawn'
and TX_SUCCEEDED = 'TRUE'
and BLOCK_TIMESTAMP<='2022-01-01'
group by 1)
select tab2.user
,sum (deposit_volume - withdraw_volume) as flow_Balance
from tab1
full outer join tab2
on tab1.user = tab2.user
where tab2.user<>'null'
group by 1),
-----------------------------------------------------------
act2 as (
with tab1 as (
select
EVENT_DATA:to as user
,sum (EVENT_DATA:amount) as Deposit_Volume
from flow.core.fact_events
where EVENT_CONTRACT = 'A.1654653399040a61.FlowToken'
Run a query to Download Data