PYTs Subgraph
Developers > Perpetual Yield Tranches > PYTs Subgra
Idle uses a subgraph for indexing and organizing data from the Perpetual Yield Tranches IdleCDO smart contract. This subgraph is hosted on The Graph hosted service and can be used to query Idle PYTs data:

Useful entities

  • TrancheInfo: contains the data of each PYTs tranche (type, apr, virtualPrice, totalSupply), updated every hour
  • Tranche: all deployed PYTs tranches (id, type)

Querying PYTs

To obtain the latest TrancheInfos you can use the following query:
1
{
2
trancheInfos(orderBy:"timeStamp", orderDirection:"desc") {
3
id
4
apr
5
Tranche {
6
id
7
}
8
timeStamp
9
blockNumber
10
totalSupply
11
virtualPrice
12
}
13
}
Copied!
For more info about GraphQL API, check TheGraph Documentation.