jackguyCopy of osmo holders
Updated 2022-10-15
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
›
⌄
WITH tab1 as (
SELECT
receiver,
min(block_timestamp) min_in,
sum(amount) as sum_in
FROM osmosis.core.fact_transfers
LEFT outer JOIN osmosis.core.dim_labels
ON currency = address
WHERE (project_name LIKE 'wBNB'
OR currency = CONCAT('u', lower('wBNB')))
AND receiver LIKE '%osmo%'
GROUP BY 1
), tab2 as (
SELECT
SENDER,
max(block_timestamp) max_out,
sum(amount) as sum_out
FROM osmosis.core.fact_transfers
LEFT outer JOIN osmosis.core.dim_labels
ON currency = address
WHERE (project_name LIKE '{{t'
OR currency = CONCAT('u', lower('wBNB')))
AND receiver LIKE '%osmo%'
GROUP BY 1
), tab3 as (
SELECT
*,
sum_in - sum_out as net_tokens
from tab1
LEFT outer JOIN tab2
ON sender = receiver
), tab4 as (
SELECT
*,
sum(new_u) over (ORDER BY min_in) as sum_num_u
FROM (
Run a query to Download Data