Query editor
WITH-- Validator Metadatavalidator_addresses (validator, vote_account, identity_account) AS (VALUES('Helius', 'he1iusunGwqrNtafDtLdhsUQDFvo13z9sUa36PauBtk', 'HEL1USMZKAL2odpNBj2oCjffnFGaYwmbGmyewGv1e2TU')),-- Get Latest Epochmax_epoch AS (SELECT MAX(FLOOR(call_block_slot / 432000) - 1) AS latest_epochFROM jito_tip_distribution_solana.jito_tip_distribution_call_claim),-- Get Stake Accounts Per Epoch When Delegated to Heliuswallet_set AS (SELECT DISTINCTstake_account AS wallet,epochFROM staking_solana.validator_stake_account_epochsWHERE vote_account = (SELECT vote_account FROM validator_addresses)AND epoch BETWEEN(SELECT latest_epoch - 185 FROM max_epoch) AND(SELECT latest_epoch FROM max_epoch)),-- MEV Rewards Datamev_rewards AS (SELECTc.account_claimant AS recipient,FLOOR(c.call_block_slot / 432000) - 1 AS epoch,SUM(c.amount) / 1e9 AS mev_rewards_solFROM jito_tip_distribution_solana.jito_tip_distribution_call_claim cJOIN wallet_set wsON c.account_claimant = ws.walletAND FLOOR(c.call_block_slot / 432000) - 1 = ws.epochGROUP BY c.account_claimant, FLOOR(c.call_block_slot / 432000) - 1),-- Inflation Rewards Datainflation_rewards AS (SELECTr.recipient,FLOOR(r.block_slot / 432000) - 1 AS epoch,SUM(r.lamports / 1e9) AS inflation_rewardFROM solana.rewards rJOIN wallet_set wsON r.recipient = ws.walletAND FLOOR(r.block_slot / 432000) - 1 = ws.epochWHEREr.reward_type IN ('Voting', 'Staking')AND r.lamports > 0GROUP BY r.recipient, FLOOR(r.block_slot / 432000) - 1),-- Stake Balance Datastake_balances AS (SELECTv.stake_account AS recipient,v.epoch,v.sol_balance AS balance_sol