Afonso_DiazTop Stakers
    Updated 2024-09-24
    with

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

    t as (
    select
    tx_hash,
    block_timestamp,
    'Stake' as action,
    signer_id as user,
    deposit/1e24 as amount
    from near.core.fact_actions_events_function_call
    where receiver_id = 'linear-protocol.near'
    and method_name in ('storage_deposit', 'stake', 'deposit_and_stake')

    union all

    select
    tx_hash,
    block_timestamp,
    action,
    user,
    amount
    from (
    select
    tx_hash,
    block_timestamp,
    'Unstake' as action,
    signer_id as user,
    QueryRunArchived: QueryRun has been archived