SocioCryptoLuna CS
Updated 2023-07-03
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
›
⌄
WITH flow_out as (
SELECT sender,
sum(AMOUNT) as amnt
FROM terra.core.ez_transfers
WHERE CURRENCY='uluna'
AND tx_succeeded = true
AND amount is not NULL
GROUP by sender),
flow_in as (
SELECT receiver,
sum(AMOUNT) as amnt
FROM terra.core.ez_transfers
WHERE CURRENCY='uluna'
AND tx_succeeded = true
AND amount is not NULL
GROUP BY receiver
)
SELECT sum(balance) as circulating_supply
FROM(
SELECT sender as "Wallet Address", (zeroifnull(b.amnt)-zeroifnull(a.amnt))/pow(10,6) AS balance
FROM flow_out a
LEFT JOIN flow_in b
ON a.sender=b.receiver
)
WHERE balance > 0
Run a query to Download Data