Develop APIs that provide detailed reward data for Ethereum validators.
Provide data on rewards paid to the validators broken down for each of their duties:
attestation_rewards
block_rewards
sync_committee_rewards
Query:
$ curl --data "[\"8663\", \"0xb0bd225a6202effca9986e8c3ed50b4f29f8b3154ef21337843d945877aadd6c9bf40ff39393f329cfb243e1dfde23ee\"]" -H "Content-Type:application/json" "http://localhost:5052/eth/v1/beacon/rewards/attestations/179550" | jq
Output:
{
"execution_optimistic": false,
"data": {
"ideal_rewards": [
{
"effective_balance": "0",
"head": "0",
"target": "0",
"source": "0"
},
// omitted
{
"effective_balance": "32",
"head": "3360",
"target": "6314",
"source": "3478"
}
],
"total_rewards": [
{
"validator_index": "8663",
"head": "3360",
"target": 6314,
"source": 3478
},
{
"validator_index": "27563",
"head": "3360",
"target": 6314,
"source": 3478
}
]
}
}
Query:
$ curl -H "Content-Type:application/json" "http://localhost:5052/eth/v1/beacon/rewards/blocks/5745617" | jq
Output:
{
"execution_optimistic": false,
"data": {
"proposer_index": "32632",
"total": "31843976",
"attestations": "30723010",
"sync_aggregate": "1120966",
"proposer_slashings": "0",
"attester_slashings": "0"
}
}
Query:
$ curl --data "[\"8663\", \"0xb0bd225a6202effca9986e8c3ed50b4f29f8b3154ef21337843d945877aadd6c9bf40ff39393f329cfb243e1dfde23ee\"]" -H "Content-Type:application/json" "http://localhost:5052/eth/v1/beacon/rewards/sync_committee/5745617" | jq
Output:
{
...
"data": [
{
"validator_index": "8663",
"reward": 15637
},
{
"validator_index": "27563",
"reward": 15637
}
]
}