> ## Documentation Index
> Fetch the complete documentation index at: https://docs.allium.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Income

> Fetch the total consensus income and balances of Beacon Chain Validators at a daily interval.

The `beacon.validator.income` table provides a daily snapshot of the consensus & execution layer income (MEV rewards) of active validators.
There is one unique income record per active validator per day. For each validator, there will be an entry until the validator is fully withdrawn.

### Consensus Layer Income

Validators on Beacon Chain earn consensus layer income from the following [sources](https://kb.beaconcha.in/rewards-and-penalties):

* rewards (attestation, block proposing, sync committee rewards)
* penalties (attester slashing, proposer slashing)

We index every consensus rewards data present, including attestation rewards data (`beacon.raw.total_rewards`) which is \~ 230 billion records for every single active validator. The daily consensus layer income received by each validator is calculated by summing the total attestation rewards (from beacon.raw\.total\_rewards), sync committee rewards (from beacon.raw\.sync\_committee\_rewards) and slot proposing rewards (from beacon.raw\.block\_rewards). Slashing penalties are not included in the consensus layer income. The income can be negative if the validator received penalties.

For granular consensus income data, please query `beacon.validator.consensus_income` model - this table provides slot-level consensus income from attestations, block proposing and sync committee reward paritcipation.

### Execution Layer Income

Execution Layer Income of the validator is dependent on whether there is proposer-builder separation (PBS).

* **PBS Blocks**: These are blocks where the builder sends an MEV payout to the **Proposer Fee Recipient (block proposer),** which typically happens in the last transaction of a block.

* **Non-PBS Blocks**: For blocks that do not have build -> proposer MEV payout, the execution layer income will be the total builder **priority fee reward** from transactions + the\*\* total direct ETH transferred\*\* to block builders.

<Info>
  **Assumptions**

  * the proposer fee recipient (MEV Reward) on the Execution Layer is the same entity as the Validator that is proposing the block on the Consensus Layer.
</Info>

i.e. in the following example, Validator = 711548 proposed this block and would be the recipient of MEV Rewards. Note that the withdrawal address of the validator can be different from the proposer fee recipient.

<Frame>
  <img src="https://mintcdn.com/allium-e770e2b7/M3SuvBIUs-0g-3vo/images/image-historical-evm-beacon-validator-income-1.png?fit=max&auto=format&n=M3SuvBIUs-0g-3vo&q=85&s=22ba19279d59fbef01ffb1db941ae5ae" width="1656" height="936" data-path="images/image-historical-evm-beacon-validator-income-1.png" />
</Frame>

Block Proposed by 711548, receiving 0.0407 ETH in MEV rewards: [https://etherscan.io/block/17667807#mevinfo](https://etherscan.io/block/17667807#mevinfo)

<Info>
  **Execution Income Pre-Merge**

  Before the Ethereum merge, there was no execution (L1) income for validators because validators on the Beacon Chain did not propose blocks. Block proposals and transaction execution were managed by miners on the Ethereum mainnet (proof-of-work chain).

  Post-merge, Ethereum switched to proof-of-stake, where Beacon Chain validators propose blocks built by block builders on the execution chain. Execution income, including MEV rewards, is mapped from these blocks to validators.
</Info>

### Sample Query

Finding daily income of active validators by ETH1 `withdrawal_address` specified in withdrawal credentials.

```sql theme={null}
select
    date(slot_timestamp) as date,
    count(distinct validator_index) as validators, -- active validators
    sum(total_income) as total_income -- daily total income
from beacon.validator.income
where withdrawal_address = '0x210b3cb99fa1de0a64085fa80e18c22fe4722a1b' -- Kraken Withdrawal
group by 1
order by 1 desc
```

<Frame>
  <img src="https://mintcdn.com/allium-e770e2b7/M3SuvBIUs-0g-3vo/images/image-historical-evm-beacon-validator-income-2.png?fit=max&auto=format&n=M3SuvBIUs-0g-3vo&q=85&s=dc5cb76f93003c402a345a6a202b2293" width="1802" height="1106" data-path="images/image-historical-evm-beacon-validator-income-2.png" />
</Frame>

[https://app.allium.so/s/I50cFs9M](https://app.allium.so/s/I50cFs9M)

### Table Columns

Unique Key: `slot_timestamp` (daily) + `validator_index`

| Column Name                  | Description                                                                                         | Example                                    |
| ---------------------------- | --------------------------------------------------------------------------------------------------- | ------------------------------------------ |
| slot\_number                 | Slot number of the balance snapshot.                                                                | 6,411,598                                  |
| slot\_timestamp              | Slot timestamp of balance snapshot.                                                                 | 2023-05-10 23:59:59                        |
| validator\_index             | Unique index of the validator.                                                                      | 459,015                                    |
| total\_income                | Total income = consensus + execution income.                                                        | 0.002814952                                |
| consensus\_income            | Consensus layer (Beacon Chain) income.                                                              | 0.002814952                                |
| execution\_income            | Execution layer income, if validator proposed the block and the builder sent MEV rewards.           | 0                                          |
| execution\_income\_pbs       | PBS blocks income — MEV payout transfer from block builder to proposer fee recipient.               | 0                                          |
| execution\_income\_non\_pbs  | Non-PBS blocks income — assuming no MEV payout in those blocks.                                     | 0                                          |
| income\_7d                   | 7-day validator income up to the current slot\_timestamp.                                           | 0.019833533                                |
| income\_30d                  | 30-day validator income up to the current slot\_timestamp.                                          | 0.084810516                                |
| income\_90d                  | 90-day validator income up to the current slot\_timestamp.                                          | 1.94E-01                                   |
| apr\_7d                      | Estimated APR based on last 7 days: `APR_7D = income_7d / sum_effective_balance_7d / 365.25 * 100`. | 3.234016932                                |
| apr\_30d                     | Estimated APR based on last 30 days.                                                                | 3.226775101                                |
| apr\_90d                     | Estimated APR based on last 90 days.                                                                | 4.439010365                                |
| current\_balance             | Validator balance at current date timestamp.                                                        | 32.00094938                                |
| previous\_balance            | Validator balance at the previous date timestamp.                                                   | 32.01058424                                |
| withdrawal\_amount           | Total ETH withdrawn for the validator on the current date (0 if none).                              | 0.012449812                                |
| deposit\_amount              | Total ETH deposited for the validator on the current date (0 if none).                              | 0                                          |
| status                       | Current validator status. Only active validators included.                                          | active\_ongoing                            |
| is\_slashed                  | Whether the validator was slashed (no longer active).                                               | FALSE                                      |
| pubkey                       | Validator’s BLS public key (48 bytes, hex-encoded with 0x prefix).                                  | 0x9373298f9650...                          |
| withdrawal\_prefix           | First byte of the withdrawal credential (0x00 or 0x01).                                             | 0x01                                       |
| withdrawal\_address          | ETH1 withdrawal address, applicable for 0x01 withdrawal credentials.                                | 0x94e69f03d5d02acbab4b22747a064103fb6b6be0 |
| current\_effective\_balance  | Effective staked balance at current date.                                                           | 32                                         |
| previous\_effective\_balance | Effective staked balance at previous date.                                                          | 32                                         |
| unique\_id                   | Unique ID for the income entry.                                                                     | date-2023-05-10\_validator\_index-459015   |
| slot\_change                 | Slot difference from previous date to current date.                                                 | 7,200                                      |
