mb1124daily st'uns
    Updated 2022-11-09
    SELECT date_trunc('day',BLOCK_TIMESTAMP) AS day,
    CASE
    WHEN ACTION='Stake' THEN 'Stake'
    WHEN ACTION='Unstake' THEN 'Unstake'
    END AS actions,
    COUNT(DISTINCT TX_SIGNER) AS singers_count,
    COUNT(DISTINCT POOL_ADDRESS) AS validators_count,
    sum(validators_count) over(partition BY actions ORDER BY day) AS cum_validator,
    sum(singers_count) over(partition BY actions ORDER BY day) AS cum_signers,
    sum(STAKE_AMOUNT / POW(10,24)) AS volume
    FROM near.core.dim_staking_actions
    WHERE ACTION='Stake' OR ACTION='Unstake'
    GROUP BY 1,2


    Run a query to Download Data