Skip to main content

Entities & Sample Queries

Prizes Claimed - Entities

Aggregate

Description: A total sum of all prizes claimed on this network

FieldTypeDescription
idString!Aggregate ID
totalClaimedBigInt!Total number of prizes claimed

Account

FieldTypeDescription
idID!Account address
totalClaimedBigInt!Sum of amount claimed on this network
draws[AccountDraws!]!Draws on this network

Draw

FieldTypeDescription
idID!Draw ID
createdAtTimestampBigInt!Time draw was created
totalClaimedBigInt!Sum of amount claimed for this draw
accounts[AccountDraw!]!Draws created on account

AccountDraw

FieldTypeDescription
idString!Account.ID + Draw.ID
accountAccount!User account
drawDraw!Draws created on account
claimedBigInt!Amount claimed by user for this single draw
createdAtTimestampBigInt!Time draw was created

Sample Queries

Below are some sample queries you can use to gather information from the Prizes-Claimed subgraph.

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

Aggregate - Query

Description: This query fetches the total sum of all prizes claimed on this network. It also sorts for the first 20 draws, and their total claimed.

{
aggregates {
id
totalClaimed
}
draws(first: 20, orderBy: id, orderDirection: desc) {
id
totalClaimed
}
}

AccountDraws

Description: This query fetches the balance of the total claimed and their timestamp from user accounts.

{
accountDraws {
account {
id
totalClaimed
draws(first: 20, orderBy: id, orderDirection: desc) {
id
claimed
claimedAtTimestamp
}
}
}
}