LTirrell2023-05-19 06:27 PM
    Updated 2023-05-23
    with latest_stake_vol as (
    select
    block_timestamp,
    tx_id,
    event_type,
    signers [0] as fee_payer,
    case
    when event_type = 'withdraw' and stake_authority is null then fee_payer
    else stake_authority
    end as stake_authority,

    withdraw_authority,
    stake_account,
    post_tx_staked_balance / pow(10, 9) as net_stake,
    row_number () over (
    partition by stake_account
    order by
    block_timestamp desc
    ) as rn,
    vote_account,
    node_pubkey,
    validator_name,
    validator_rank,
    commission
    from
    solana.core.ez_staking_lp_actions
    -- where
    -- SUCCEEDED = TRUE
    -- and block_timestamp is not null
    -- and event_type not in ('setLockup')
    -- and block_timestamp::date <= '2022-05-22'
    -- ),
    -- base as (
    -- select
    -- stake_authority as staker,
    -- case
    Run a query to Download Data