Skip to main content

Entities & Sample Queries

TWAB Rewards - Entities

Ticket

FieldTypeDescription
idID!Ticket address
accounts[Account!]!Account associated with the ticket
promotions[Promotion!]!Promotion associated with the ticket

Promotion

FieldTypeDescription
idID!Promotion ID
creatorAccount!Account who created the promotion
createdAtBigInt!Timestamp at which the promotion was created
endedAtBigIntTimestamp at which the promotion was ended
destroyedAtBigIntTimestamp at which the promotion was destroyed
startTimestampBigInt!Timestamp at which the promotion starts
numberOfEpochsBigInt!Number of epochs the promotion lasts
epochDurationBigInt!Duration of each epoch in seconds
tokensPerEpochBigInt!Number of tokens to be distributed per epoch
rewardsUnclaimedBigInt!Number of tokens that have not been claimed yet
tokenBytes!Address of the token distributed as rewards
ticketTicketTicket to which the promotion is associated

Account

FieldTypeDescription
idID!Account address
promotions[Promotion!]!Promotions created by the account
claimedPromotions[ClaimedPromotion!]!IDs of promotions that have been claimed by the account
ticketTicketTicket to which the account is associated

ClaimedPromotion

FieldTypeDescription
idID!Composite ID of the account address + promotion ID
promotionIdBigInt!ID of the promotion that was claimed
accountAccount!Account that has claimed the promotion
epochs[BigInt!]Epochs from the promotion that have been claimed by the account
rewardsBigInt!Total amount of rewards that have been claimed by the account
ticketTicketTicket to which the promotion is associated

Sample Queries

Below are some sample queries you can use to gather information from the TWAB Rewards subgraph.

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

Promotion - Query

Description: This query fetches users, their claimed promotions, their associated tickets, and unclaimed rewards.

{
accounts {
claimedPromotions {
promotionId
rewards
epochs
ticket {
id
promotions {
rewardsUnclaimed
}
}
}
}
}