ramishoowNear Distribution - Part 3 copy
    Updated 2023-02-12
    -- 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
    Run a query to Download Data