0xaimanraw 1 sol staker
    Updated 2022-07-05


    with raw as (with se as (select tx_id,instruction:parsed:info:stakeAuthority as staker ,
    instruction:parsed:info:stakeAccount as stake_act
    from solana.core.fact_events

    where event_type='delegate' --and tx_id='3SVGeFnyzg1mpuoQj6mW93Q7CQvEk5EeK8BTqBcG6U8k9UNDhPV9WRY46qoPs1vgYEiQ7pBryxTtCPFJFyLAqcmu'

    order by 2),

    txn as (
    select block_timestamp,

    account_keys[1]:pubkey as stac,
    tx_id, pre_balances[0]/10e8 as SOL_prebal,
    post_balances[0]/10e8 as SOL_postbal,
    SOL_prebal-SOL_postbal as SOl_staked
    from solana.core.fact_transactions
    )

    select txn.block_timestamp,staker, stac,se.tx_id, SOl_staked
    from se inner join txn on se.tx_id=txn.tx_id)



    select count(staker) as n_staker, avg(N_STAKE_TXN) as avg_stake_txn, min(VOL_SOL_STAKED) as min_sol_staked,
    max(VOL_SOL_STAKED) as max_sol_staked,avg(VOL_SOL_STAKED) as avg_sol_staked
    from (select staker, count(tx_id) as n_stake_txn, sum(sol_staked) as vol_sol_staked
    from raw
    group by 1 order by 1)
    limit 1000
    Run a query to Download Data