Skip to main content

Subgraphs

Rheofi leverages The Graph to index on-chain data, making it easy for developers to query protocol state using GraphQL. Subgraphs provide efficient, real-time access to market data, governance events, and user positions without requiring direct contract calls.

Available Subgraphs

The Rheofi Protocol maintains the following subgraphs:

SubgraphNetworkEndpoint

| Liquidity Pools | XRPL Testnet | (subgraph endpoint if available) |

Example Query

Retrieve the top 5 markets by total supply:

{
markets(first: 5, orderBy: totalSupply, orderDirection: desc) {
id
symbol
underlyingSymbol
totalSupply
totalBorrow
supplyRate
borrowRate
collateralFactor
reserveFactor
}
}

Schema Overview

The Rheofi subgraphs expose the following primary entities:

  • Market: Represents a lending/borrowing market with rates, balances, and configuration.
  • Account: A user account including all positions across markets.
  • AccountMarket: A join entity linking an account to a specific market position, including supply and borrow balances.
  • Proposal: A governance proposal with votes, status, and execution details.
  • Vote: An individual vote cast on a proposal.
  • Transaction: A protocol transaction such as supply, borrow, repay, or liquidation.

Usage Tips

  • Use pagination (first and skip parameters) for large result sets.
  • Filter by block number using block: { number: <blockNumber> } to query historical state.
  • Subgraph data may lag behind the chain head by a few blocks. For time-sensitive operations, verify data directly on-chain.
  • Refer to the full schema in the Graph Explorer for all available fields and relationships.

For questions or issues related to subgraph data, visit the Rheofi Developer Forum.