<p>Data captured by the snapshot is stored on-chain as a part of the ledger state, so all fully synchronized cardano-node instances have access to it. So, for example, when you run the <strong>cardano-cli query stake-distribution --mainnet --out-file stakeDist.out</strong> command the cardano-cli queries and outputs the current active stake data for each pool.</p>

CC BY-SA 4.0
2022-10-28T20:09:52.580Z
I think this answer is (partly) wrong: ledger state is not stored on-chain and nor are the stake snapshots that are part of it. Ledger state is kept in memory by the nodes and it is a result of folding (reducing) the blockchain.
Cigarette Smoking Man
CC BY-SA 4.0
2023-12-13T21:16:30.887Z
Just a minor correction. These snapshots are part of ledger state and are not actually stored on the blockchain (They are too big. There is a new snapshot every 5 days and over 1 million stake addresses.). The are part of ledger state that can be recreated by replaying the block chain from genesis.
Erik de Castro Lopo
CC BY-SA 4.0
2021-06-10T11:22:39.533Z
2021-06-10T11:22:39.533Z
Homer J
<p>From my understanding, the active stake is calculated as a sum of all coins that were delegated to a particular pool. You can take a look <a href="https://input-output-hk.github.io/ouroboros-network/shelley-spec-ledger/src/Shelley.Spec.Ledger.Rewards.html#reward" rel="nofollow noreferrer">here</a>.
<a href="https://i.sstatic.net/8T538.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/8T538.png" alt="enter image description here" /></a></p>
<p><a href="https://i.sstatic.net/LuJpv.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/LuJpv.png" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2021-06-10T05:12:48.443Z
So is this part of the nodes? Or is this shelly-spec-ledger part of some other system running in parallel? And if it's part of the nodes, which nodes are running this code? And who initiates the transactions/reward payouts?
eddex
CC BY-SA 4.0
2021-06-09T21:06:10.087Z
2021-06-09T21:06:10.087Z
Yanis Urbis
<p>This question is related to my previous question: <a href="https://cardano.stackexchange.com/q/1975/1142">When are the snapshots for the active stake in an epoch taken?</a></p>
<p>The active stake of a pool is used to calculate the rewards. What kind of system calculates the active stake of a stake pool? Is this done by the Cardano nodes or by the stake pools themselves or some other part of the Cardano ecosystem?</p>

<stake-pool><staking>
How is the active stake of a stake pool calculated?
# How is the active stake of a stake pool calculated?

(Asked by: username_0 on 2021-06-09)

This question is related to my previous question: [When are the snapshots for the active stake in an epoch taken?](https://cardano.stackexchange.com/q/1975/1142)

The active stake of a pool is used to calculate the rewards. What kind of system calculates the active stake of a stake pool? Is this done by the Cardano nodes or by the stake pools themselves or some other part of the Cardano ecosystem?

**Tags:** stake-pool, staking

---

## 2 answers

### Answer by username_1 on 2021-06-10. Score: 2 | Accepted answer

Data captured by the snapshot is stored on-chain as a part of the ledger state, so all fully synchronized cardano-node instances have access to it. So, for example, when you run the **cardano-cli query stake-distribution --mainnet --out-file stakeDist.out** command the cardano-cli queries and outputs the current active stake data for each pool.

> **Comments:**
> **username_2**: I think this answer is (partly) wrong: ledger state is not stored on-chain and nor are the stake snapshots that are part of it. Ledger state is kept in memory by the nodes and it is a result of folding (reducing) the blockchain.  
> **username_3**: Just a minor correction. These snapshots are part of ledger state and are not actually stored on the blockchain (They are too big. There is a new snapshot every 5 days and over 1 million stake addresses.). The are part of ledger state that can be recreated by replaying the block chain from genesis.  

---

### Answer by username_4 on 2021-06-09. Score: 1

From my understanding, the active stake is calculated as a sum of all coins that were delegated to a particular pool. You can take a look [here](https://input-output-hk.github.io/ouroboros-network/shelley-spec-ledger/src/Shelley.Spec.Ledger.Rewards.html#reward).
[![enter image description here](https://i.sstatic.net/8T538.png)](https://i.sstatic.net/8T538.png)

[![enter image description here](https://i.sstatic.net/LuJpv.png)](https://i.sstatic.net/LuJpv.png)

> **Comments:**
> **username_0**: So is this part of the nodes? Or is this shelly-spec-ledger part of some other system running in parallel? And if it's part of the nodes, which nodes are running this code? And who initiates the transactions/reward payouts?  

---

