Query editor
withstake_accounts as (--stake_accounts added to jito stake poolSELECTaccount_arguments[6] as stake--account_arguments[7] as vote_accountFROM solana.instruction_calls cWHERE executing_account = 'SPoo1Ku8WFXoNDMHPsrGSTSG1Y47rzgn41SLUNakuHy'AND contains(account_arguments, '6iQKfEyhr3bZMotVkW6beNZz5CPAkiwvgV2CTje9pVSS') --JitoSOL authorityAND bytearray_substring(data, 1, 1) = 0x01 --add validatorAND tx_success), mev_fees as (--mev "tips" are paid to jito then distributed through this merkle "claim", we filter for just claims paid out to jito staked stake_accounts (delegated)SELECTdate_trunc('week',call_block_time) as week, sum(amount/pow(10,9)) as mev_rewardsFROM jito_tip_distribution_solana.jito_tip_distribution_call_claim cWHERE account_claimant IN (SELECT stake FROM stake_accounts) --account arg 3, example https://solscan.io/tx/K5XGoWSWV3Nxbnw3YYdYZpt7va7R45Dhf5CqByui8MfqmUeTQJnwbWKGRZEKtKhMjqTNNjRfuVVsjjT4unpFtPYgroup by 1), stake_fees as (SELECTdate_trunc('week',block_time) week, sum(lamports/pow(10,9)) as rewardsFROM solana.rewards --validator reward paid out every epoch, these are just staking rewards. fees/votes are paid to the delegated stake_accounts and not the stake pool.WHERE recipient IN (SELECT stake FROM stake_accounts)AND reward_type = 'Staking'GROUP BY 1)--fees earned by jito staked stake_accounts (delegated)SELECTsf.week, mf.mev_rewards as mev_rewards_week, sf.rewards as stake_rewards_week, sum(mf.mev_rewards) over (order by sf.week asc) as mev_rewards_total, sum(sf.rewards) over (order by sf.week asc) as stake_rewards_totalFROM stake_fees sfLEFT JOIN mev_fees mf ON sf.week = mf.week