sarathwho got flow7
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 depositt as (
select event_data:to as flowuser,
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'
group by 1),
withdrawt as (
select event_data:from as flowuser,
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'
group by 1),
maintable as (
select t1.flowuser,
contract_name,
sum (deposit_volume - withdraw_volume) as Balance
from depositt t1 join withdrawt t2 on t1.flowuser = t2.flowuser
full outer join flow.core.dim_contract_labels t3 on t1.flowuser = t3.account_address
where t1.flowuser != 'null'
group by 1,2),
finalt as (
select count (distinct flowuser) as Total_Holders,
sum (balance) as Total_Flow_Balance
from maintable),
depositt1 as (
select event_data:to as flowuser,
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'
Run a query to Download Data