zhizhi1348-BdTpUhStakes & Unstakes Ratios & Numbers (Solana)
    Updated 2022-11-16
    SELECT
    CASE
    WHEN action LIKE '%deposit%' THEN 'Stake'
    WHEN action LIKE '%withdraw' THEN 'Unstake'
    END AS action,
    SUM(amount/1e9) AS amount,
    AVG(amount/1e9) AS avg_amount,
    COUNT(DISTINCT tx_id) tx_count,
    COUNT(DISTINCT address) user_count
    FROM
    solana.core.fact_stake_pool_actions
    WHERE
    succeeded = 'TRUE'
    AND
    block_timestamp BETWEEN '2022-11-07' AND '2022-11-14'
    AND
    action LIKE '%deposit%'
    OR
    action LIKE '%withdraw'
    GROUP BY 1
    Run a query to Download Data