I’m attempting to get the active stake value from cardano-db-sync for a pool at a specific epoch so I know how much stake it had for the next snapshot.
I’m currently using the following query
SELECT SUM(amount) FROM epoch_stake
WHERE epoch_stake.epoch_no = $1 AND pool_id = $2
This query seems to work, but my result is quite a bit off when compared to what cardanoscan.io shows as the active stake for the same pool.
epoch_stake
table gives the stake distribution for a single epoch.