pietrektxdefi staking net change
    Updated 2024-02-05
    WITH deposits AS (select to_date(block_timestamp) as day, sum(amount) as amount, sum(amount_usd) as amount_usd from ethereum.core.ez_token_transfers
    where CONTRACT_ADDRESS = '0x72b886d09c117654ab7da13a14d603001de0b777' and TO_ADDRESS = '0x1dfd9029d89f87c8c63ed8ef2be1b5393b2348ef' group by day),
    withdrawals AS(select to_date(block_timestamp) as day, sum(-amount) as amount, sum(-amount_usd) as amount_usd from ethereum.core.ez_token_transfers
    where CONTRACT_ADDRESS = '0x72b886d09c117654ab7da13a14d603001de0b777' and from_ADDRESS = '0x1dfd9029d89f87c8c63ed8ef2be1b5393b2348ef' group by day),

    unioned AS (
    SELECT day, amount, amount_usd FROM deposits
    UNION
    SELECT day, amount, amount_usd FROM withdrawals
    ),

    grouped AS (SELECT day, sum(amount) as amount, sum(amount_usd) as amount_usd FROM unioned GROUP BY day)

    SELECT *, SUM(amount) OVER(ORDER BY day) as amount_cumulative FROM grouped ORDER BY day DESC
    Last run: about 1 year ago
    DAY
    AMOUNT
    AMOUNT_USD
    AMOUNT_CUMULATIVE
    1
    2024-02-03 00:00:00.000-18247.711346423-2156.33204980711541313.875455
    2
    2024-01-30 00:00:00.000-3216.563473928-489.96946429311559561.5868014
    3
    2024-01-27 00:00:00.000-12850.403270707-1879.32551256611562778.1502753
    4
    2024-01-26 00:00:00.000-1663.178409876-233.30151985611575628.553546
    5
    2024-01-21 00:00:00.000-5107.123902727-693.68493802511577291.7319559
    6
    2024-01-17 00:00:00.000-886.866722319-127.71412921411582398.8558586
    7
    2024-01-15 00:00:00.000-1003.658555406-151.72406747911583285.722581
    8
    2024-01-10 00:00:00.000-79343.58751337-13382.08947000511584289.3811364
    9
    2024-01-09 00:00:00.000-14282.932456627-2348.88537422211663632.9686497
    10
    2024-01-08 00:00:00.000-2798.479459995-457.81444877811677915.9011064
    11
    2024-01-04 00:00:00.000-56066.832636037-9494.45078808211680714.3805664
    12
    2024-01-03 00:00:00.000-759.506459461-149.37821143411736781.2132024
    13
    2024-01-02 00:00:00.000-5319.123204567-1024.84437071511737540.7196619
    14
    2024-01-01 00:00:00.000-5446.187861199-1014.93597951411742859.8428664
    15
    2023-12-31 00:00:00.000-2519.243099227-460.46359888411748306.0307276
    16
    2023-12-30 00:00:00.000-2059.727871323-356.63570173611750825.2738269
    17
    2023-12-29 00:00:00.000-578081.231125984-95566.57686378911752885.0016982
    18
    2023-12-28 00:00:00.000-3228.170211886-566.98837350312330966.2328242
    19
    2023-12-27 00:00:00.000-1964.491100881-341.75590762312334194.403036
    20
    2023-12-26 00:00:00.000-2254.444914819-365.94781076812336158.8941369
    ...
    645
    48KB
    13s