Sbhn_NPGoGoPool - Avax Deposited over Time copy
    Updated 2025-06-18
    --reference : cloudr3n
    with price as (
    select hour::date as datee,
    symbol,
    avg(price) as usdprice
    from avalanche.price.ez_prices_hourly
    where symbol = 'WAVAX'
    group by 1,2
    ),


    base as (
    SELECT
    block_timestamp,
    iff(event_name='Deposit','Deposit','Withdraw') as type,
    case when event_name='Deposit' then decoded_log:assets::integer*pow(10,-18)
    when event_name='Withdraw' then decoded_log:assets::integer*(-1)*pow(10,-18)
    else 0
    end as amount,
    case when event_name='Deposit' then decoded_log:shares::integer*pow(10,-18)
    when event_name='Withdraw' then decoded_log:shares::integer*(-1)*pow(10,-18)
    else 0 end as shares,
    contract_address
    FROM
    avalanche.core.ez_decoded_event_logs
    WHERE
    contract_address=lower('0xA25EaF2906FA1a3a13EdAc9B9657108Af7B703e3')


    )

    select
    date_trunc('month',block_timestamp) as date,
    type,
    sum(amount*usdprice) as avax,
    sum(avax) over (order by date asc) cumuAvaxDeposited,
    Last run: about 2 months ago
    DATE
    TYPE
    AVAX
    CUMUAVAXDEPOSITED
    GGAVAX
    CUMUGGAVAXMINTED
    1
    2023-12-01 00:00:00.000Withdraw-1925787.81549253470946.11286959-48680.982991675239054.807052628
    2
    2024-05-01 00:00:00.000Withdraw-1130830.74071869751234.71083298-29486.231609818433223.860759799
    3
    2023-05-01 00:00:00.000Withdraw-33217.860312765448359.459075408-2147.54939425426027.220831939
    4
    2023-11-01 00:00:00.000Withdraw-168394.8870930512618801.15134633-8557.47646543186488.781584237
    5
    2025-01-01 00:00:00.000Deposit40683271.645063910016557.7854749969463.856699671519991.707403105
    6
    2025-02-01 00:00:00.000Deposit22878220.652584617822136.2778186734624.723649528732953.69676046
    7
    2025-05-01 00:00:00.000Deposit18604564.437275717964449.6714806730174.814903677767453.224958738
    8
    2024-03-01 00:00:00.000Withdraw-4103873.838686525252626.24506393-80318.561059528309039.598041954
    9
    2023-07-01 00:00:00.000Deposit107165.628880553647383.6722756078285.24129307441938.319050678
    10
    2024-02-01 00:00:00.000Deposit3010240.533124087574237.2955806678019.379974018355492.602130148
    11
    2024-02-01 00:00:00.000Withdraw-2817401.430631217574237.29558066-70574.358722665355492.602130148
    12
    2024-09-01 00:00:00.000Deposit27863896.796281830576276.047802966218.691112151121487.54755904
    13
    2023-09-01 00:00:00.000Withdraw-978816.6849965622054405.37794981-102625.647743138162225.177266491
    14
    2023-10-01 00:00:00.000Deposit114162.1898998722024546.0547883412129.457141722159004.129818353
    15
    2024-08-01 00:00:00.000Withdraw-9459199.6874581111329610.388378-394531.644132865481084.123723697
    16
    2025-04-01 00:00:00.000Deposit25418873.135806719242248.07630981170513.70747935822285.397205804
    17
    2023-11-01 00:00:00.000Deposit762649.9836510442618801.1513463336042.128231313186488.781584237
    18
    2024-09-01 00:00:00.000Withdraw-8617231.1368577130576276.047802-325815.2672768051121487.54755904
    19
    2025-03-01 00:00:00.000Deposit13509288.15755315041916.6329374595599.938006771601556.30567948
    20
    2024-06-01 00:00:00.000Withdraw-3049135.7531021212036819.1255453-103081.477521028517124.988148444
    54
    6KB
    15s