I want to get pool(private pool) reward for specific epoch.
I searched blockfrost.io apis, can't find reward api.
How can I get reward by api? Or other solution will be fine like graphql.
Cardano Stack Exchange is a question and answer site for users and developers of the Cardano cryptocurrency ecosystem. It only takes a minute to sign up.
Sign up to join this communityYou need to look at the specific pool's history using the pools/{pool_id}/history
endpoint.
[
{
"epoch": 233,
"blocks": 22,
"active_stake": "20485965693569",
"active_size": 1.2345,
"delegators_count": 115,
"rewards": "206936253674159",
"fees": "1290968354"
}
]
See docs.blockfrost.io.
db-sync
.
Dec 1, 2022 at 21:57
As the main dev on db-sync
I can tell you how to get it there.
In the simplest manner possible (with randomly chosen pool and epoch):
# select id, view from pool_hash where view =
'pool19u64770wqp6s95gkajc8udheske5e6ljmpq33awxk326zjaza0q' ;
id | view
----+----------------------------------------------------------
13 | pool19u64770wqp6s95gkajc8udheske5e6ljmpq33awxk326zjaza0q
(1 row)
# select sum (amount) / 1000000 as ada_reward from reward where earned_epoch = 354
and pool_id = 16 and type = 'member' ;
ada_reward
--------------------
13856.795160000000
(1 row)
This could be made into a single query with a join
of the two tables.