Comment on page
📈
Atlendis Gateway
Atlendis has a dedicated GraphQL gateway to expose all relevant states from the protocol's smart contracts. This gateway is hosted on Atlendis' own infrastructure.
Additionally, users can visit the URL in order to access the playground that contains the full schema documentation and a practical way to perform queries.
This practical guide will demonstrate how to query the gateway. It will cover:
- Querying a lender's positions,
- Querying a lender's account history,
- Querying all pools overviews.
To retrieve all user's positions simply filter the
positions overviews
by the relevant lender's addressquery lenderPositions {
positionsOverviews(
lender: "${userAddress}"
chainId: 137
) {
instanceId
status
depositAmount
borrowedAmount
earnings
creationTimestamp
}
}
The account summary and history are directly available through the gateway
query account {
account(
address: "${userAddress}"
chainId: 137
) {
address
lenderSummary {
positionsCount
stakedPositionsCount
}
lenderTransactions {
instanceId
type
amount
rate
transactionHash
}
}
}
All the pools, on Atlendis V1 and V2, are available using the query over the
pools overviews
query poolOverviews {
poolOverviews(chainId: 137) {
instanceId
productType
status
usdTvl
permissioned
token {
name
symbol
}
currentLoan {
rate
repaymentStartDate
repaymentEndDate
}
metadata {
borrower {
name
}
}
}
}
Last modified 3d ago