ramishoowNear Distribution - Part 3 copy
Updated 2023-02-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
›
⌄
-- forked from 1ccb851e-b39c-4a5e-aca7-cf270ec2da90
with outflows as (
SELECT
distinct tx_signer as wallet
, sum(deposit/1e24) over(partition by wallet ) as total_outflow_value
, count(tx_hash) over(partition by wallet ) as total_outflow_tx_count
-- tx_receiver as receicer
-- *
FROM
near.core.fact_transfers
WHERE
status = 'TRUE'
-- order by block_timestamp
-- limit 1000
) , inflows as (
SELECT
distinct tx_receiver as wallet
, sum(deposit/1e24) over(partition by wallet ) as total_inflow_value
, count(tx_hash) over(partition by wallet ) as total_inflow_tx_count
--
-- *
FROM
near.core.fact_transfers
WHERE
status = 'TRUE'
-- limit 1000
)
, top_10 as (
select
wallet