Updated 10 hours ago
    with

    main as (
    select
    tx_hash,
    block_timestamp,
    receipt_signer_id as user,
    action_data:deposit / 1e24 as amount,
    'Stake' as event_name
    from
    near.core.ez_actions
    where
    receipt_succeeded
    and action_data:method_name = 'deposit'
    and receipt_receiver_id = 'storage.herewallet.near'

    union all

    select
    tx_hash,
    block_timestamp,
    receipt_signer_id as user,
    action_data:args:amount::bigint / 1e24 as amount,
    'Unstake' as event_name
    from
    near.core.ez_actions
    where
    receipt_succeeded
    and action_data:method_name = 'withdraw'
    and receipt_receiver_id = 'storage.herewallet.near'
    )

    select
    count(distinct tx_hash) as transactions,
    count(distinct user) as users,
    sum(iff(event_name = 'Stake', amount, -amount)) as netflow_volume,
    Last run: about 10 hours ago
    TRANSACTIONS
    USERS
    NETFLOW_VOLUME
    DAILY_AVERAGE_TRANSACTIONS
    DAILY_AVERAGE_USERS
    1
    465601670921003318.12324302563.68159881.225182
    1
    54B
    466s