Mrftisimilar-red copy
    Updated 13 hours ago
    -- forked from similar-red @ https://flipsidecrypto.xyz/studio/queries/db98084c-e534-452d-aefe-0d6c6341b4f1

    with usertbl as
    (WITH database AS (
    SELECT
    a.BLOCK_TIMESTAMP,
    a.TX_HASH,
    a.ORIGIN_FROM_ADDRESS AS "Staker",
    b.value AS "$MON Staked",
    CAST(ethereum.public.udf_hex_to_int(data) AS decimal) / 1e18 AS "$sMON Received",
    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 = '0x07aabd925866e8353407e67c1d157836f7ad923e'
    AND a.ORIGIN_TO_ADDRESS = '0x07aabd925866e8353407e67c1d157836f7ad923e'
    AND a.ORIGIN_FUNCTION_SIGNATURE = '0x3a4b66f1'
    AND a.TX_SUCCEEDED = 'TRUE'
    AND a.BLOCK_TIMESTAMP > '2025-02-18 00:00:00.000'
    )

    select
    "Staker",
    sum ("$MON Staked") as "Total $MON Staked",
    count (distinct TX_HASH) as "Stake tx"
    from database
    group by 1
    )

    SELECT
    case
    when "Stake tx" = 1 then 'Tier1: only 1 stake tx'
    when "Stake tx" > 1 and "Stake tx" <= 5 then 'Tier2: 1-5 stake tx'
    when "Stake tx" > 5 and "Stake tx" <= 10 then 'Tier3: 6-10 stake tx'
    when "Stake tx" > 10 and "Stake tx" <= 100 then 'Tier4: 10-100 stake tx'
    Last run: about 13 hours agoAuto-refreshes every 12 hours