JonasoMOE staking pool (2)
    Updated 2025-02-07
    with

    P as( select price, hour from mantle.price.ez_prices_hourly where token_address = '0x4515a45337f461a11ff0fe8abf3c606ae5dc00c9' order by hour desc limit 1 ),

    X as(
    select 'Mantle' as chain, block_timestamp, 0+amount as balance, from_address as user, to_address as pool, contract_address from mantle.core.ez_token_transfers union all
    select 'Mantle' as chain, block_timestamp, 0-amount as balance, to_address as user, from_address as pool, contract_address from mantle.core.ez_token_transfers ),

    A as(
    select user, min(block_timestamp) as time, sum(balance) as balance
    from X
    where pool = '0xb3938e6ee233e7847a5f17bb843e9bd0aa07e116'
    and contract_address = '0x4515a45337f461a11ff0fe8abf3c606ae5dc00c9'
    and user != '0x0000000000000000000000000000000000000000'
    group by 1),


    B as(
    select date_trunc('month',time) as time, count(distinct user) as holder
    from A
    where balance > 0
    group by 1)

    select time, holder as new_holder,
    sum(holder) over(order by time) - holder as pre_holder,
    sum(holder) over(order by time) as total_holder
    from B
    order by 1 desc






    Last run: about 2 months ago
    TIME
    NEW_HOLDER
    PRE_HOLDER
    TOTAL_HOLDER
    1
    2025-02-01 00:00:00.0009361111312049
    2
    2025-01-01 00:00:00.0006261048711113
    3
    2024-12-01 00:00:00.0006017447010487
    4
    2024-11-01 00:00:00.0008843824470
    5
    2024-10-01 00:00:00.0007843044382
    6
    2024-09-01 00:00:00.0009942054304
    7
    2024-08-01 00:00:00.00011340924205
    8
    2024-07-01 00:00:00.00021838744092
    9
    2024-06-01 00:00:00.0009137833874
    10
    2024-05-01 00:00:00.00027635073783
    11
    2024-04-01 00:00:00.00028632213507
    12
    2024-03-01 00:00:00.00021730043221
    13
    2024-02-01 00:00:00.00031626883004
    14
    2024-01-01 00:00:00.000268802688
    14
    589B
    4s