Atlendis-V1
Search
⌃K
📈

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.

Relevant Endpoints

For the implementation of the subgraph, as well as a full overview of the schema, please refer to:

How to query the subgraph

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

Querying a lender's positions

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
}
}

Querying a specific borrower's weighted average lending rate

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
}
}
}
You can find each poolHash on Atlendis' dApp or query them with the following query:
{
pools {
identifier
hash
}
}