Links

Subgraph

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

Useful entities

  • TrancheInfos: 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
{
trancheInfos(orderBy:"timeStamp", orderDirection:"desc") {
id
apr
Tranche {
id
}
timeStamp
blockNumber
totalSupply
virtualPrice
}
}
For more info about GraphQL API, check TheGraph Documentation.