πŸ“ˆ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.

Relevant Endpoints

The GraphQL gateway is exposed on the following URL: https://atlendis.herokuapp.com/graphql.

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.

How to query the gateway

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.

Querying a lender's positions

To retrieve all user's positions simply filter the positions overviews by the relevant lender's address

query lenderPositions {
  positionsOverviews(
    lender: "${userAddress}"
    chainId: 137
  ) {
    instanceId
    status
    depositAmount
    borrowedAmount
    earnings
    creationTimestamp
  }
}

Querying a lender's account history

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

Querying all pools overviews

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 updated