Stake pool operations and maintenance

Stake pool maintenance tutorials

How to obtain stake pool information

After a successful stake pool registration and its further operation, SPOs might be interested in obtaining certain information about their pools’ activity. Information about those pools that are operating on mainnet can be fetched using a pooltool.io, which provides verified stake pool details.

In certain cases, exchanges and stake pool operators, in particular, are looking for in-depth information about their mainnet and testnet pools. To access data that is stored on the Cardano blockchain, we recommend using cardano-node, cardano-db-sync, and a cardano-graphql.

Each of the above integration components can be installed and easily deployed using Docker.

Another available option – which is often useful by exchanges and stake pool operators who wish to test stake pool operations on testnet – is the public Cardano Explorer which also functions based on the cardano-graphql instance.

Below are some queries that you may find useful in obtaining testnet stake pool information. The same query can be used on the mainnet by substituting the relevant URL:

Show the pool ID assigned to the stake address:

curl -X POST -H "Content-Type: application/json" -d '{"query": "query getStake_address($address: StakeAddress!){ activeStake(limit: 1 where: { address: { _eq: $address } }) { address stakePoolId }}","variables":{"address":”$My_stake_address_here"}}' https://explorer.cardano-testnet.iohkdev.io/graphql: | jq

Show the amount of active stake in the staking address:

curl -X POST -H "Content-Type: application/json" -d '{"query": "query get_active_stake($address: StakeAddress!){ activeStake(limit: 1 where: { address: { _eq: $address } }) { address amount }}","variables":{"address":"$My_stake_address_here"}}' https://explorer.cardano-testnet.iohkdev.io/graphql:

Check that pool ID has been registered on the chain:

curl -X POST -H "Content-Type: application/json" -d '{"query": "query getStake_pool($id: StakePoolID!){ stakePools(limit: 1 where: { id: { _eq: $id } }){ id } }","variables":{"id":”$My_Pool_id_here"}}' https://explorer.cardano.org/graphql:

Fetch pool information:

curl -X POST -H "Content-Type: application/json" -d '{"query": "query getStake_pool($id: StakePoolID!){ stakePools(limit: 1 where: { id: { _eq: $id } }){ id pledge fixedCost hash margin metadataHash} }","variables":{"id":"$My_Pool_id_here"}}' https://explorer.cardano-testnet.iohkdev.io/graphql: | jq

Check rewards:

curl -X POST -H "Content-Type: application/json" -d '{"query": "query getStake_address($address: StakeAddress!){ rewards(limit: 10 where: { address: { _eq: $address } }) { amount address } }", "variables":{"address":"$My_stake_address_here"}}' https://explorer.cardano.org/graphql: | jq

Check rewards in more detail:

curl -X POST -H "Content-Type: application/json" -d '{"query": "query getStake_pool($id: StakePoolID!){ stakePools(limit: 1 where: { id: { _eq: $id } }){ id rewards{address amount stakePool{id}} } }","variables":{"id":"$My_Pool_id_here"}}' https://explorer.cardano.org/graphql: | jq

See rewards earned in a certain epoch:

curl -X POST -H "Content-Type: application/json" -d '{"query": "query getStake_address($address: StakeAddress!){ rewards(limit: 1 where: { address: { _eq: $address } }) { amount address earnedIn{blocks{epochNo}} stakePool{id} } }","variables":{"address":"$My_stake_address_here"}}' https://explorer.cardano-testnet.iohkdev.io/graphql: | jq