ErsvanTotal staking amount in the last 30 days
    Updated 2023-01-09
    WITH w_events_stake (day,address,amount,tx_id) AS
    (
    SELECT
    DATE_TRUNC('day', block_timestamp) AS day,
    inner_instruction:instructions[array_size(inner_instruction:instructions)-1]:parsed:info:authority AS address,
    inner_instruction:instructions[array_size(inner_instruction:instructions)-1]:parsed:info:amount/1e9 AS amount,
    tx_id
    FROM
    flipside_prod_db.solana.fact_events
    WHERE
    PROGRAM_ID = 'StaKe9nb7aUjXpjpZ45o6uJBsZxj2BWCDBtjk8LCg2v' AND
    inner_instruction:instructions[array_size(inner_instruction:instructions)-1]:parsed:type = 'transfer'
    )
    select sum(amount) as total_volume from w_events_stake
    where day < current_date and day >= current_date - 30
    Run a query to Download Data