CryptoIcicleNear-10.NEAR Distribution - Top 10 Balances over time
    Updated 2022-09-08
    -- Grand Prize
    -- 34.091 NEAR (A score of 11 or 12 earns you a Grand Prize title)
    -- Payout
    -- 22.727 NEAR
    -- Score Multiplier
    -- 0-7 : 0%
    -- 8 : 50%
    -- 9 : 75%
    -- 10 : 100%
    -- 11 : 125%
    -- 12 : 150%
    -- Payout Network Near
    -- Level Intermediate
    -- Difficulty Hard
    -- Q10.Calculate the distribution of $NEAR holdings by address.
    -- In terms of charts, feel free to create a histogram or whichever visual you think works best!

    -- SQL Credit: https://app.flipsidecrypto.com/velocity/queries/b5965dc9-827a-4466-8ccc-c5e5d0d24aa9

    WITH balances as (
    -- +INFLOW
    SELECT
    block_timestamp::date as date,
    TX_RECEIVER as wallet,
    SUM(deposit / pow(10, 24)) as val
    FROM near.core.fact_transfers
    WHERE STATUS = 'TRUE'
    GROUP BY 1,2
    -- -OUTFLOW
    UNION ALL
    SELECT
    block_timestamp::date as date,
    TX_SIGNER as wallet,
    -1 * SUM(deposit / pow(10, 24)) as val
    FROM near.core.fact_transfers
    WHERE STATUS = 'TRUE'
    Run a query to Download Data