binhachonAstroport Rewards Analysis - Reward per block
    Updated 2022-04-19
    with add_transactions as ( --Create new pool
    select
    block_id,
    block_timestamp,
    msg_value:execute_msg:add:lp_token::string as lp_token,
    msg_value:execute_msg:add:alloc_point::float as alloc_point
    from terra.msgs
    where msg_value:contract::string = 'terra1zgrx9jjqrfye8swykfgmd6hpde60j0nszzupp9'
    and msg_value:execute_msg:add is not null
    ),
    set_transactions as ( --Adjust existing pool
    select
    block_id,
    block_timestamp,
    msg_value:execute_msg:set:lp_token::string as lp_token,
    msg_value:execute_msg:set:alloc_point::float as alloc_point
    from terra.msgs
    where msg_value:contract::string = 'terra1zgrx9jjqrfye8swykfgmd6hpde60j0nszzupp9'
    and msg_value:execute_msg:set is not null
    ),
    astro_per_block as ( --Set Astro per block
    select
    block_id,
    block_timestamp,
    msg_value:execute_msg:set_tokens_per_block:amount::float/1e6 as amount
    from terra.msgs
    where msg_value:contract::string = 'terra1zgrx9jjqrfye8swykfgmd6hpde60j0nszzupp9'
    and msg_value:execute_msg:set_tokens_per_block is not null
    union all
    select
    5918639 as block_id,
    '2022-01-02 21:26:02' as block_timestamp,
    8403094::float/1e6 as amount
    ),
    hour_list as (
    select
    Run a query to Download Data