elsina✅ 2. staking: 2. Daily average
    Updated 2023-04-13
    with info as (
    select
    date_trunc('day', block_timestamp) as "Day",
    action as "Actions",
    count(distinct tx_hash) as "tx count",
    count(distinct tx_signer) as "Unique wallet",
    sum(stake_amount / 1e24) as "Volume",
    avg(stake_amount / 1e24) as "AVG tx volume"
    from near.core.dim_staking_actions
    where "Day" <= current_date - 90
    group by 1, 2
    )

    select
    "Actions",
    avg("tx count") as "AVG tx count",
    avg("Unique wallet") as "AVG unique wallet",
    avg("Volume") as "AVG volume",
    avg("AVG tx volume") as "AVG TX volume"
    from info
    group by 1
    Run a query to Download Data