GYSR documentation
Search…
Subgraph
The GYSR subgraph
GYSR has built and launched a subgraph which indexes a variety of information about our platform. This includes data about tokens (price, name, type, etc.), users (positions, activity, etc.), Pools (configuration, APR, TVL, etc.) and more.
You can find the subgraph source code here.
You can experiment with queries and view entities on the subgraph's playground page:

Entities

Pool
An entity created for each Pool launched on the GYSR protocol
Token
An entity created for each token used as a staking or reward token in a GYSR Pool
User
An entity created for each wallet address that has interacted with a Pool
Position
An entity created for each position a user has in a Pool. This can be comprised of one or several stakes, as a user can have multiple stakes in one Pool.
Stake
An entity created for each stake a user has in a Pool
Platform
An entity created for aggregate stats on the GYSR protocol like TVL
Transaction
An entity created for each transaction on a Pool, including Stake, Unstake, and Claim
Funding
An entity created for each funding on a Pool
PoolDayData
An entity created as a "snapshot" of a Pool's stats on a given day

Examples

Get top 10 Pools with highest TVL

1
{
2
pools(first: 10, orderBy: tvl, orderDirection: desc) {
3
id
4
tvl
5
apr
6
stakingToken {
7
symbol
8
alias
9
}
10
rewardToken {
11
symbol
12
alias
13
}
14
}
15
}
Copied!

Get fundings for a specific Pool

Note: replace the id with the Pool you want to query
1
{
2
pool(id: "0x6c1ffdecc6520571d2c41087726611938a9ae99f") {
3
fundings {
4
originalAmount
5
start
6
end
7
}
8
}
9
}
Copied!

Get transactions for a specific Pool

Note: replace pool id with the Pool you want to query
1
{
2
transactions( where: { pool: "0x6c1ffdecc6520571d2c41087726611938a9ae99f"}) {
3
type
4
timestamp
5
amount
6
earnings
7
gysrSpent
8
}
9
}
Copied!

Get daily snapshots for a Pool over a time range

This example gets snapshots from the week of 11/9/20 - 11/15/20 UTC
1
{
2
poolDayDatas(where: { poolAddress: "0x6c1ffdecc6520571d2c41087726611938a9ae99f", date_gte: 1604966400, date_lte: 1605484800}) {
3
date
4
totalStaked
5
totalGysrSpent
6
totalUsers
7
tvl
8
volume
9
}
10
}
Copied!

Get a user's positions

Note: replace the id with the wallet address you want to query
1
{
2
user(id: "") {
3
earned
4
positions {
5
pool {
6
id
7
}
8
shares
9
}
10
}
11
}
Copied!

Get global stats for GYSR protocol (on the respective chain)

1
{
2
platform(id: "0x0000000000000000000000000000000000000000") {
3
tvl
4
users
5
operations
6
gysrSpent
7
pools
8
volume
9
}
10
}
Copied!
Copy link