0xHaM-dHere vs. Meteor New Users
    Updated 2024-10-27
    -- forked from Here vs. Meteor Over Time @ https://flipsidecrypto.xyz/studio/queries/b1d50bd9-b2b8-445f-8309-096c59b2ca88

    -- forked from Saleh / here_stake_fin_date @ https://flipsidecrypto.xyz/Saleh/q/eBW7JcAQ7KkK/here_stake_fin_date

    with lst_price as (
    select
    date_trunc(hour,HOUR) as price_date,
    avg(CLOSE) as avg_price
    from near.price.fact_prices_ohlc_hourly
    where ASSET_ID='wrapped-near'
    and price_date is not null
    group by 1
    )
    ,lst_stake as (
    select
    block_timestamp::date as date_a,
    tx_hash,
    SIGNER_ID as wallet,
    RECEIVER_ID,
    DEPOSIT/1e24 as amount
    from near.core.fact_actions_events_function_call
    where block_timestamp>='2022-07-13'
    and RECEIVER_ID='storage.herewallet.near'
    and METHOD_NAME in( 'deposit','storage_deposit')
    and RECEIPT_SUCCEEDED=true
    )
    ,lst_unstake_tg as (
    select
    block_timestamp::date as date,
    tx_hash,
    PREDECESSOR_ID as wallet,
    RECEIVER_ID,
    -1*ARGS:amount/1e24 as amount
    from near.core.fact_actions_events_function_call
    where block_timestamp>='2022-07-13'
    QueryRunArchived: QueryRun has been archived