LTirrellinvestigate
    Updated 2023-05-07
    -- select
    -- stake_account,
    -- sum(post_tx_staked_balance / pow(10,9)) as total

    -- FROM
    -- -- solana.core.fact_transfers
    -- solana.core.ez_staking_lp_actions
    -- where
    -- -- tx_to = '9hknftBZAQL4f48tWfk3bUEV5YSLcYYtDRqNmpNnhCWG'
    -- signers[0] = 'KchK7WTjPzq9QL5aCwnV1dLsT8rFjruS1Zfzamxus9G'
    -- and SUCCEEDED = TRUE and block_timestamp is not null
    -- group by stake_account
    -- order by total desc
    -- order by block_timestamp desc

    -- SELECT
    -- *

    -- -- distinct event_type
    -- from solana.core.fact_staking_lp_actions
    -- where event_type is null or event_type = ''
    -- limit 100
    with x as (
    select
    block_timestamp,
    event_type,
    tx_id,
    signers[0] as staker,
    stake_account,
    post_tx_staked_balance/pow(10,9) as net_stake,
    row_number () over (partition by staker, stake_account order by block_timestamp desc) as rn

    from
    solana.core.ez_staking_lp_actions
    where
    SUCCEEDED = TRUE
    Run a query to Download Data