6

Rewards and security deposit/bond are released at the same time.

How to find out a baker's balance (not the staking balance) at the start of any previous cycle? As in the amount available for bond at the start of the cycle (leftover balance from previous cycle plus rewards/bond released on this cycle)?

If I am getting this right, in order to find this out I need to know:

A) On which block of the new cycle are they released?

B) How to get the balance of the baker's account on that block?

UPDATE: per Groxan's answer below, here is the code in bash.

1 Answer 1

4

Frozen rewards and deposits are released in the last block of the cycle. So, that is what you need:

var cycle = 80; //cycle that you need
var level = cycle * 4096; // level of the last block in the prev cycle

var balance = get('/chains/main/blocks/{level}/context/contracts/{address}/balance');

See an example...

5
  • So the rewards/bond that are supposed to be released for cycle 80 are delivered on the last block of cycle 80? In effect this makes released rewards/bond for 80 only be available for use in 81. Do I have this right?
    – Gaia
    Mar 21, 2019 at 1:13
  • And do you have a link for what you state in the documentation? thx!
    – Gaia
    Mar 21, 2019 at 1:16
  • @Gaia Unfortunately, there are no good official docs in Tezos which could describes in details how it works. You have to use a reverse-engineering methods =)
    – Groxan
    Mar 21, 2019 at 11:29
  • 2
    @Gaia, At the end of cycle N (in other words, right before the cycle N+1), rewards and deposits from cycle N-5 become unfrozen. Look at this: mainnet.tezrpc.me/chains/main/blocks/360448/metadata. This is the last block of cycle 87 and contains balance updates with the "kind": "freezer" and "level": 82. It means that in the first block of cycle 88 you will have rewards and deposits from cycle 82, and last five cycles (83, 84, 85, 86, 87) will be frozen. Is that clear?
    – Groxan
    Mar 21, 2019 at 11:30
  • 1
    clear, yep. in other words, rewards for cycle N are released at the end of cycle N+5 and become available at cycle N+6
    – Gaia
    Mar 21, 2019 at 17:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.