Kaskoazul2c - Total holdings and payouts
    Updated 2022-04-10
    with HUNTER as(
    select receiver as wallet_paid,
    sum(amount) as paid_ALGO,
    balance,
    case
    when balance != 0 then paid_ALGO/balance*100
    when balance = 0 then 0
    end as perc
    from algorand.payment_transaction pt
    inner join algorand.account a
    on pt.receiver = a.address
    where sender = 'TLR47MQCEIC6HSSYLXEI7NJIINWJESIT3XROAYC2DUEFMSRQ6HBVJ3ZWLE'
    and amount < 10000
    group by 1, 3
    order by 2 desc
    )

    select sum(paid_ALGO) as total_paid,
    sum(balance) as total_holdings,
    total_paid/total_holdings*100 as perc_paid,
    count(wallet_paid) as hunters,
    avg(paid_ALGO),
    avg(balance)
    from HUNTER

    Run a query to Download Data