Skip to main content
Version: Next

Hopr All Seasons Subgraph Entities & Sample Queries

StakingParticipation

FieldTypeDescription
idID!Unique identifier for staking particpation
AccountAccount!User account that participates in staking
stakingSeasonStakeSeason!Staking season during which the user participated in staking
actualLockedTokenAmountBigInt!Actual amount of tokens that the user locked
virtualLockedTokenAmountBigInt!Amount of virtual locked tokens that the user has
airdropLockedTokenAmountBigInt!Amount of airdrop locked tokens that the user has
lastSyncTimestampBigInt!Timestamp of the last syncronization
cumulatedRewardsBigInt!Total amount of rewards the user has earned
claimedRewardsBigInt!Amount of rewards the user has claimed
unclaimedRewardsBigInt!Amount of rewards the user has not yet claimed
boostRateBigInt!Boost rate for the user
appliedBoosts[Boost!]!Applied boosts for the user
ignoredBoosts[Boost!]!Ignored boosts for the user

Boost

FieldTypeDescription
idID!Unique identifier for the boost
OwnerAccount!User account that owns the boost
boostTypeIndexBigInt!Index of the boost type
uriString!Universal resource identifier for the boost
boostNumeratorBigInt!Numerator of the boost rate
redeemDeadlineBigInt!Deadline for redeeming the boost

StakeSeason

FieldTypeDescription
idID!Unique identifier for the staking season
seasonNumberBigInt!Season number of the staking season
availableRewardBigInt!Availabe reward for the staking season
totalLockedBigInt!Total number of tokens locked during staking season
totalVirtualBigInt!Total number of virtual tokens during the staking season
totalAirdropBigInt!Total number of airdrop tokens during the staking season
totalCumulatedRewardsBigInt!Total number of cumulated rewards during the staking season
totalClaimedRewardsBigInt!Total number of claimed rewards during the staking season
totalUnclaimedRewardsBigInt!Total number of unclaimed rewards during the staking season
lastSyncTimestampBigInt!Timestamp of the last syncronization
blockedTypeIndexes[BigInt!]!Number of blocked type indexes
stakingParticipation[StakingParticipation!]!The staking participation derived from the field - stakingSeason

Account

FieldTypeDescription
idID!Unique identifier for the account
stakingParticipation[StakingParticipation!]!The staking participation derived from the field - account
ownedBoosts[Boost!]!Boosts owned by the user

Sample Queries

You can build your own queries using a GraphQL Explorer and enter your endpoint to limit the data to exactly what you need.

Each entity has a plural version and a singular version. When querying for a single record response (e.g. account), you will need to supply the id for the entity. When querying for a list of responses (e.g. accounts), you may add filters using the 'where' clause.

Below are some sample queries you can use to gather information from the HOPR contracts.

Get Staking and Boost Info

Retrieve information about staking participations and boosts, including their IDs, associated accounts or owners, staking seasons, actual locked token amounts, boost type indexes, and URIs.

{
stakingParticipations(first: 5) {
id
account {
id
}
stakingSeason {
id
}
actualLockedTokenAmount
}
boosts(first: 5) {
id
owner {
id
}
boostTypeIndex
uri
}
}

Staking Participants

Where the cumulatedRewards field is greater than 1 ETH (which is represented in wei). It returns the id and cumulatedRewards fields for each staking participation, as well as the associated staking season information, including the id, seasonNumber, and various totals related to the staking season.

{
stakingParticipations(
first: 10
where: { cumulatedRewards_gt: 1000000000000000000 }
) {
id
cumulatedRewards
stakingSeason {
id
seasonNumber
totalLocked
totalVirtual
totalAirdrop
totalCumulatedRewards
totalClaimedRewards
totalUnclaimedRewards
}
}
}

Top Stake Season by Total Locked

Retrieves information on the top stake seasons based on the amount of total tokens locked in each season.

{
stakeSeasons(first: 10, orderBy: totalLocked, orderDirection: desc) {
id
seasonNumber
totalLocked
}
}