HDKL4
Updated 2023-06-12
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
›
⌄
select
count(distinct Merchant) as Shareholders
from
(
SELECT
case
when Merchant = '0x53f389d96fb4ce5e' then 'Donation purse'
when Merchant = '0xbfb26bb8adf90399' then 'SLOPPY-FLOW Pool'
when Merchant = '0xc6cfb151ff031094' then 'SLOPPY-USDC Pool'
else Merchant
end as Merchant,
volume_deposited,
volume_withdrawn,
volume_deposited - volume_withdrawn as holdings
from
(
SELECT
ifnull(x.purse, y.purse) as Merchant,
ifnull(volume_in, 0) as volume_deposited,
ifnull(volume_out, 0) as volume_withdrawn
from
(
select
event_data:to as purse,
sum(event_data:amount) as volume_in
from
flow.core.fact_events
where
event_contract = 'A.53f389d96fb4ce5e.SloppyStakes'
and event_type = 'TokensDeposited'
group by
1
) x
left join (
select
event_data:
Run a query to Download Data