PapasotGovernance period 1 distribution metrics
    Updated 2022-06-10
    with
    dates as (
    SELECT
    block_id,
    block_timestamp
    from algorand.block where block_timestamp :: date <= '2022-01-05' --and block_id<'18462698'
    )
    select
    --trunc(block_timestamp,'day') as date,
    sum (tx_message :txn :amt/1e6) as rewards,
    count(distinct tx_id) as n_payments,
    datediff(hour,min(x.block_timestamp), max(x.block_timestamp))+1 as hours_of_distribution,
    sum (tx_message :txn :fee/1e6) as fees
    from
    algorand.transactions x, dates y where x.block_id = y.block_id
    and
    --tx_id='YRPSKIHWKQ7AGMA7V6IX3CY7UQJGXWFORFOSP45IH42FJSXSBUYQ' or tx_id='LTHSEXXAYG5QX5ACRJS5KOFVIL6JDPLTVXDYZNMOIRHHBZMPZ63A'
    try_base64_decode_string(tx_message :txn :note) like '%af/gov1:j%' and tx_message :txn :type='pay' and sender ='GULDQIEZ2CUPBSHKXRWUW7X3LCYL44AI5GGSHHOQDGKJAZ2OANZJ43S72U'
    --try_base64_decode_string(tx_message :txn :note) like '%af/gov1:j%'
    --group by 1 order by 1
    Run a query to Download Data