---
# System prepended metadata

title: Ithaca reward calculation by indexers

---

# Ithaca reward calculation by indexers

We are showing discrepancies between reward calculations, based on ithacanet baker `tz1foXHgRzdYdaLgX6XhpZGxbBv42LZ6ubvE`, during cycle 75.

### tzstats

The command to query tzstats rewards api directly is:

```
curl --silent 'https://api.ithaca.tzstats.com/tables/income.csv?address=tz1foXHgRzdYdaLgX6XhpZGxbBv42LZ6ubvE&cycle=75'| csvlook | less -S
```

Running this query, we get the following values:



| |  |
| -------- | -------- |
| total income | 2222.273 |
| baking income | 658.248 |
| endorsing income| 1204.912|
| accusation income | 320 |
| fees income | 39.112|

Baking income + fee income = 658.248+39.112 = 697.36

### tzkt

Query the rewards with

```
curl --silent https://api.ithacanet.tzkt.io/v1/rewards/split/tz1foXHgRzdYdaLgX6XhpZGxbBv42LZ6ubvE/75 | jq
```

| | |
| -- | -- |
| blockRewards | 1084.634688 |
| endorsementRewards | 1204.912128 |
| blockFees | 39.112428 |
| doubleBakingRewards | 320 |

Block rewards + block fees = 1084.634688+39.112428 = 1123.747116

### RPC

We run TRD on the ithaca branch:

`python src/main.py --dry_run -b ithaca2_actual/ -M 3 -R -3 -P rpc -N ITHACANET`

The RPC scans the blocks and outputs the given results:

| | |
| -- | -- |
| endorsementRewards | 1204.912128 |
| payload production reward and fees | 700.216458 |
| block producer bonus | 426.386281 |
| double baking rewards | **unimplemented yet**

Payload production reward and fees + block producer bonus = 700.216458 + 426.386281 = 1126.602739

## Conclusion

tzkt, tzstats and my method all disagree with the block rewards:

| | TZKT | Tzstats | TRD RPC scan |
| --| -- | -- | -- |
| Block reward + bonus + fee | 1123.747116 | 697.36 | 1126.602739 |

### Appendix: TRD RPC methodology

I query all blocks for which we have a baking right at round <= 2.

I scan all these blocks.

For blocks where we are the author, I add the block producer reward and fees from the metadata.

For blocks where we are the producer, I add the block bonus from the metadata.

The log output lists the stolen blocks, and for each of them, prints out a line if we are the block producer but not payload producer:

```
2022-03-30 11:43:14,071 - producer  - INFO - Scanning blocks (0/356).                                                          
2022-03-30 11:43:17,157 - producer  - INFO - Found stolen baking slot at level 307285, round 1.                                                                                                                                                               
2022-03-30 11:43:17,499 - producer  - INFO - Scanning blocks (10/356).                                                                                                                                                                                        
2022-03-30 11:43:18,186 - producer  - INFO - Found stolen baking slot at level 307321, round 2.                                                                
2022-03-30 11:43:20,242 - producer  - INFO - Found stolen baking slot at level 307380, round 1.                                                                
2022-03-30 11:43:20,936 - producer  - INFO - Scanning blocks (20/356).                                                                                                                                                                                        
2022-03-30 11:43:22,989 - producer  - INFO - Found stolen baking slot at level 307511, round 1.                                                                
2022-03-30 11:43:24,019 - producer  - INFO - Found stolen baking slot at level 307544, round 1.                                                                                                                                                               
2022-03-30 11:43:24,364 - producer  - INFO - Scanning blocks (30/356).                                                         
2022-03-30 11:43:27,808 - producer  - INFO - Found stolen baking slot at level 307630, round 1.                                                                
2022-03-30 11:43:27,808 - producer  - INFO - Scanning blocks (40/356).                                                         
2022-03-30 11:43:29,178 - producer  - INFO - Found stolen baking slot at level 307654, round 2.                                                                                                                                                               
2022-03-30 11:43:31,236 - producer  - INFO - Scanning blocks (50/356).                                                                                                                                                                                        
2022-03-30 11:43:34,818 - producer  - INFO - Scanning blocks (60/356).                                                         
2022-03-30 11:43:37,224 - producer  - INFO - Found stolen baking slot at level 308032, round 1.                                                                
2022-03-30 11:43:38,423 - producer  - INFO - Scanning blocks (70/356).                                                         
2022-03-30 11:43:38,958 - producer  - INFO - Found stolen baking slot at level 308056, round 2.                                                                
2022-03-30 11:43:42,333 - producer  - INFO - Found stolen baking slot at level 308157, round 1.                                                                
2022-03-30 11:43:42,333 - producer  - INFO - Scanning blocks (80/356).                                                                                                                                                                                        
2022-03-30 11:43:46,130 - producer  - INFO - Scanning blocks (90/356).                                                         
2022-03-30 11:43:48,869 - producer  - INFO - Found stolen baking slot at level 308341, round 1.                                                                
2022-03-30 11:43:49,557 - producer  - INFO - Scanning blocks (100/356).                                                        
2022-03-30 11:43:50,928 - producer  - INFO - Found stolen baking slot at level 308395, round 1.                                                                                                                                                               
2022-03-30 11:43:53,092 - producer  - INFO - Scanning blocks (110/356).                                                        
2022-03-30 11:43:56,811 - producer  - INFO - Scanning blocks (120/356).                                                        
2022-03-30 11:44:00,259 - producer  - INFO - Scanning blocks (130/356).                                                        
2022-03-30 11:44:03,704 - producer  - INFO - Found stolen baking slot at level 308737, round 1.                                                                
2022-03-30 11:44:03,704 - producer  - WARNING - We are block proposer (tz1foXHgRzdYdaLgX6XhpZGxbBv42LZ6ubvE) but not payload proposer (tz1RMtwyUqVYUEMKgMi49Zu6UfjGCxsHiiU6) for block level 308737, round 1.                                                 
2022-03-30 11:44:03,705 - producer  - INFO - Scanning blocks (140/356).                                                        
2022-03-30 11:44:07,194 - producer  - INFO - Scanning blocks (150/356).                                                        
2022-03-30 11:44:10,673 - producer  - INFO - Scanning blocks (160/356).                                                        
2022-03-30 11:44:14,505 - producer  - INFO - Scanning blocks (170/356).                                                                                                                                                                                       
2022-03-30 11:44:18,015 - producer  - INFO - Scanning blocks (180/356).                                                        
2022-03-30 11:44:20,435 - producer  - INFO - Found stolen baking slot at level 309160, round 1.                                                                                                                                                               
2022-03-30 11:44:21,462 - producer  - INFO - Scanning blocks (190/356).                                                                                                                                                                                       
2022-03-30 11:44:24,902 - producer  - INFO - Scanning blocks (200/356).                                                        
2022-03-30 11:44:28,342 - producer  - INFO - Scanning blocks (210/356).                                                        
2022-03-30 11:44:29,027 - producer  - INFO - Found stolen baking slot at level 309368, round 1.                                                                
2022-03-30 11:44:31,821 - producer  - INFO - Scanning blocks (220/356).                                                        
2022-03-30 11:44:35,654 - producer  - INFO - Scanning blocks (230/356).                                                        
2022-03-30 11:44:39,107 - producer  - INFO - Scanning blocks (240/356).                                                        
2022-03-30 11:44:42,572 - producer  - INFO - Scanning blocks (250/356).                                                                                                                                                                                       
2022-03-30 11:44:44,312 - producer  - INFO - Found stolen baking slot at level 309927, round 1.                                                                                                                                                               
2022-03-30 11:44:46,028 - producer  - INFO - Scanning blocks (260/356).                                                                                                                                                                                       
2022-03-30 11:44:49,482 - producer  - INFO - Scanning blocks (270/356).                                                                                                                                                                                       
2022-03-30 11:44:53,030 - producer  - INFO - Scanning blocks (280/356).        
2022-03-30 11:44:54,748 - producer  - INFO - Found stolen baking slot at level 310239, round 1.                                                                
2022-03-30 11:44:56,780 - producer  - INFO - Scanning blocks (290/356).        
2022-03-30 11:44:59,879 - producer  - INFO - Found stolen baking slot at level 310421, round 1.                                                                
2022-03-30 11:44:59,880 - producer  - WARNING - We are block proposer (tz1foXHgRzdYdaLgX6XhpZGxbBv42LZ6ubvE) but not payload proposer (tz1dqPQn5HXNJ7yjcqBx2w6sozjPXTV1kpfh) for block level 310421, round 1.                                                                                                                 
2022-03-30 11:45:00,220 - producer  - INFO - Scanning blocks (300/356).        
2022-03-30 11:45:03,646 - producer  - INFO - Scanning blocks (310/356).        
2022-03-30 11:45:07,067 - producer  - INFO - Scanning blocks (320/356).        
2022-03-30 11:45:10,515 - producer  - INFO - Scanning blocks (330/356).        
2022-03-30 11:45:14,157 - producer  - INFO - Scanning blocks (340/356).        
2022-03-30 11:45:17,576 - producer  - INFO - Scanning blocks (350/356).        
2022-03-30 11:45:19,650 - producer  - INFO - Total block production reward and fees: 700216458.                                                                
2022-03-30 11:45:19,650 - producer  - INFO - Total block bonus: 426386281.                                                                                     
```