fantaUntitled Query
    Updated 2022-02-17
    select
    date_trunc('day',block_timestamp) as block_day,
    date_trunc('hour',block_timestamp) as block_hour,
    case when tx_id = 'MLEwmjdX4MDg3Q6d6EFiwBuRy5nHBL5u3nuwMQ1DYtszbAkMaVAt1sd2Frxi2m22snTZrNm8wk2mpfrAJup72Hh' then 'me'
    else 'everyone else' end as staker,
    -- these three aren't involved in grouping or aggregating, let's remove them:
    --instruction:programId as programid,
    --inner_instruction:instructions[0]:parsed:info:source as source,
    --inner_instruction:instructions[0]:parsed:info:amount / 1e9 as amount,
    count(*) as stake_count
    from solana.events
    where date_trunc('day', block_timestamp) = '2022-01-21 00:00:00.000'
    -- on Solana we *always* add a small date range for query efficiency!
    --AND tx_id = 'ngF3HJPi3g7WwkEXU7L4d8gRuggtLTq9cJ31tLXvhxqyet73oX23iaZiqL3cMv9o573xa4gjKqotrksB7N6unf1'
    and instruction:programId = 'MarBmsSgKXdrN1egZf5sqe1TMai9K1rChYNDJgjq7aD'
    And inner_instruction:instructions[0]:parsed:info:source = '7GgPYjS5Dza89wV6FpZ23kUJRG5vbQ1GM25ezspYFSoE'
    and succeeded = TRUE
    group by block_day, block_hour, staker;

    Run a query to Download Data