maybeyonasflip_algo_stats
    Updated 2022-04-08
    with
    bounty_hunters as (
    select
    receiver as hunter,
    sum(amount) as bounty
    from algorand.payment_transaction
    where amount <= 10000
    and sender = 'TLR47MQCEIC6HSSYLXEI7NJIINWJESIT3XROAYC2DUEFMSRQ6HBVJ3ZWLE'
    group by 1
    ),
    total_recieved as (
    select
    receiver as user,
    sum(amount) as algo_recieved
    from algorand.payment_transaction
    group by 1
    ),
    data as (
    select
    block_timestamp,
    hunter,
    balance,
    bounty,
    algo_recieved,
    case when abs(bounty-balance)/bounty <= 0.1 then 'almost equal' else null end as bounty_wallet_bal_type,
    case when abs(bounty-algo_recieved)/bounty <= 0.1 then 'almost equal' else null end as bounty_wallet_algo_type,
    bounty*100/algo_recieved as bounty_percent,
    case when balance < bounty then bounty-balance else 0 end as liquidated,
    liquidated*100/bounty as liq_percent
    from algorand.account a
    join bounty_hunters b on a.address = b.hunter
    join algorand.block bl on bl.block_id = a.created_at
    join total_recieved t on a.address=t.user
    -- where bounty > 10
    )

    Run a query to Download Data