Updated 2025-02-20
    with

    main as (
    select
    tx_hash,
    block_timestamp,
    origin_from_address as user,
    utils.udf_hex_to_int(data)::bigint / 1e18 as amount,
    iff(topics[1] = '0x0000000000000000000000000000000000000000000000000000000000000000', 'Stake', 'Unstake') as event_name
    from
    monad.testnet.fact_event_logs
    where
    tx_succeeded
    and origin_to_address = '0xb2f82d0f38dc453d596ad40a37799446cc89274a'
    and topics[0] = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'
    and contract_address = lower('0xb2f82D0f38dc453D596Ad40A37799446Cc89274A')
    )

    select
    count(distinct tx_hash) as transactions,
    count(distinct user) as users,
    sum(iff(event_name = 'Stake', 1, -1) * amount) as tvl,
    transactions / count(distinct block_timestamp::date) as daily_average_transactions,
    users / count(distinct block_timestamp::date) as daily_average_users
    from
    main
    Last run: 28 days ago
    TRANSACTIONS
    USERS
    TVL
    DAILY_AVERAGE_TRANSACTIONS
    DAILY_AVERAGE_USERS
    1
    604213909765187.1006222746.4090911777.136364
    1
    52B
    19s