Mrfticompulsory-maroon copy copy
    Updated 2025-03-22
    -- forked from compulsory-maroon copy @ https://flipsidecrypto.xyz/studio/queries/a6ae0f00-60b1-46c1-a5c2-8d4ea5e652f2

    WITH database AS (
    SELECT
    a.BLOCK_TIMESTAMP,
    a.TX_HASH,
    a.ORIGIN_FROM_ADDRESS as "Unstaker",
    CAST(ethereum.public.udf_hex_to_int(data) AS decimal) / 1e18 AS "$sMON Burned",
    b.tx_fee as "Fee ($MON)"
    FROM
    monad.testnet.fact_event_logs a
    join
    monad.testnet.fact_transactions b on a.tx_hash = b.tx_hash

    where a.CONTRACT_ADDRESS = lower ('0x2c9C959516e9AAEdB2C748224a41249202ca8BE7')
    and a.ORIGIN_TO_ADDRESS = lower ('0x2c9C959516e9AAEdB2C748224a41249202ca8BE7')
    and a.ORIGIN_FUNCTION_SIGNATURE = '0x6fed1ea7'
    and a.TX_SUCCEEDED = 'TRUE'
    ),
    first_time_stakers AS (
    SELECT
    "Unstaker",
    MIN(DATE(BLOCK_TIMESTAMP)) AS "First Unstaking Date" -- Get the first staking date for each staker
    FROM database
    GROUP BY 1
    ),
    daily_unique_stakers AS (
    SELECT
    "First Unstaking Date" AS date,
    COUNT("Unstaker") AS "New Unique Unstakers" -- Count new unique stakers per day
    FROM first_time_stakers
    GROUP BY 1
    )
    SELECT
    date,
    Last run: 17 days ago
    DATE
    Cumulative Unique Unstakers
    1
    2025-02-13 00:00:00.0001
    2
    2025-02-18 00:00:00.0005
    3
    2025-02-19 00:00:00.000174
    4
    2025-02-20 00:00:00.0003458
    5
    2025-02-21 00:00:00.0007214
    6
    2025-02-22 00:00:00.00010758
    7
    2025-02-23 00:00:00.00015472
    8
    2025-02-24 00:00:00.00020946
    9
    2025-02-25 00:00:00.00033674
    10
    2025-02-26 00:00:00.00058634
    11
    2025-02-27 00:00:00.00072588
    12
    2025-02-28 00:00:00.000111101
    13
    2025-03-01 00:00:00.000125537
    14
    2025-03-02 00:00:00.000147657
    15
    2025-03-03 00:00:00.000167015
    16
    2025-03-04 00:00:00.000200531
    17
    2025-03-05 00:00:00.000239622
    18
    2025-03-06 00:00:00.000252081
    19
    2025-03-07 00:00:00.000266421
    20
    2025-03-08 00:00:00.000287393
    34
    1KB
    42s