Afonso_DiazGrouping transactions (stake)
    Updated 2025-05-13
    with

    pricet as (
    select
    hour::date as date,
    avg(price) as price_usd
    from
    near.price.ez_prices_hourly
    where
    token_address = 'wrap.near'
    group by 1
    ),

    main as (
    select
    tx_hash,
    block_timestamp,
    action_data:deposit/1e24 as amount,
    amount * price_usd as amount_usd,
    receipt_signer_id as user,
    'Stake' as action
    from
    near.core.ez_actions
    join
    pricet on block_timestamp::date = date
    where
    action_data:method_name = 'deposit_and_stake'
    and receipt_receiver_id = 'shitzu.pool.near'
    and receipt_succeeded
    and tx_succeeded

    union all

    select
    tx_hash,
    block_timestamp,
    Last run: 30 days ago
    TYPE
    TRANSACTIONS
    1
    $10 - $50316
    2
    $10,000 - $100,00021
    3
    $100 - $500183
    4
    $1000 - $500080
    5
    $50 - $100133
    6
    $500 - $100060
    7
    $5000 - $10,00030
    8
    Above $100,0006
    9
    Below $10433
    9
    187B
    11s