📈
Atlendis Subgraph
Atlendis uses a single subgraph to expose all relevant state from the protocol's contracts. The subgraphs are hosted as part of The Graph's hosted service.
For the implementation of the subgraph, as well as a full overview of the schema, please refer to:
This practical guide will demonstrate how to query the subgraph from your application. It will cover:
- Querying a lender's positions
- Querying a specific borrower's weightedAverageLendingRate
To retrieve all user's positions simply filter the positions table by the relevant lender's address/
{
positions (where: { lender: "${usersAddress}"}){
id
normalizedOriginalDeposit
rate
creationTimestamp
bondsIssuanceIndex
}
}
The weighted average lending rate of a pool is part of the pool status schema and can be queried by filtering the the Pools table by its hash:
{
pool(id: "poolHash") {
identifier
status {
weightedAverageLendingRate
}
}
}
{
pools {
identifier
hash
}
}
Last modified 3mo ago