Query editor
WITHlsts as (SELECT*FROM query_3711279), slsts as (--single validator lsts. Comes from a binary that fp lee runs.SELECT * FROM query_3708918), program_accounts as (SELECTdistinctstake_account_raw as address, authorityFROM dune.dune.result_solana_stake_accounts_authoritiesWHERE authority IN (SELECT w_authority FROM lsts)and latest = 1UNION ALLSELECTreserve as address, w_authority as authorityFROM lsts), stake_accounts as (SELECT account_stakeAccount as stake FROM stake_program_solana.stake_call_InitializeUNIONSELECT account_stakeAccount as stake FROM stake_program_solana.stake_call_InitializeCheckedUNIONSELECT case when action = 'withdraw' then source --if withdraw, then stake account is the withdraw account.else destination --if merge or split, then both are stake accounts.end as stakeFROM staking_solana.stake_actionsUNIONSELECTreserve as addressFROM lsts), seven_day_b as (SELECT*FROM (SELECTaddress, sol_balance as seven_day_balance, row_number() over (partition by address order by day desc) as latest_balFROM solana_utils.daily_balancesWHERE address IN (SELECT stake FROM stake_accounts)AND token_mint_address is nullAND day is not nullAND day <= now() - interval '7' day)WHERE latest_bal = 1), thirty_day_b as (