Skip to main content

How to query Iris Core data with the API?

You can query Iris Core data with the GraphQL API. Queries run against the GraphQL Playground. A few conventions carry through every example:
  • Examples read from the Ethereum mainnet staging fork (VNet, chainId: 9991); an integration moves to another network by changing the chainId.
  • By default the API returns only the first 50 results; pass limit (up to 1000) and page with cursors for more.
  • Addresses are lowercase hex, and filters are exact-match.
  • BigInt values are returned as strings; rates and LLTVs are WAD (1e18), amounts are in the token’s own decimals.
  • Plural query names are generated from table names: blmParamss, marketDatas, and whitelistEntrys are not typos.

Discovery and Listing

Loans List

A loan is identified by its pod, the isolated clone address holding that borrower’s position. (chainId, pod) is the primary key everywhere in this API.
Loan rows are immutable: they record the quote as accepted when the loan is opened. Everything that moves lives on position.

Position Metrics

Collateral, Debt & Bond

position is one-to-one with loan on (chainId, pod) and holds everything mutable.
bond and bondRequirement are in the debt token’s decimals, collateral in the collateral token’s; a closed loan keeps its row with debt: "0".

Fixed vs Floating Legs

Legs are as of lastUpdate, not as of now.

Bond Health

A bond is unhealthy when bond < bondRequirement, or when ceil((floatingLeg - fixedLeg) × 1e18 / bond) exceeds bondLltv. See Bond Mechanics.

Loan Status

Status is not a column: it is derived at read time from debt, maturity, and overduePeriod.
With now in unix seconds: Only closed is expressible as a filter. Fetch the live set with positions(where: { debt_gt: "0" }) and classify client-side, comparing now against the indexed block timestamp from _meta { status }.

Position Tracking

Borrower All Loans Position

Everything a borrower needs on one screen: terms, live balances, and both USD legs.

Borrower Account Overview

Loans, claimable balances, and delegated managers in one request.

Solver Book

A solver’s whole exposure: loans underwritten, bond posted against bond required, and unclaimed earnings.

Bond

BLMs List

A bond liquidity manager (BLM) sets how much bond a solver must post.
A BLM with whitelist rows is a WhitelistBlm; one with none is a plain Blm.

Bond Curve Parameters

Curves are keyed per debt token, so a single BLM prices USDC and USDT loans independently.
position.bondRequirement is computed once at loan open as debt × (slope × duration / 86400 + intercept) / 1e18; see Bond Mechanics.

Solver Whitelist

Rows persist with isWhitelisted: false after a removal, so always filter on the flag.

Enabled Bond LLTVs

The set of bond LLTVs governance permits a quote to use.

Venue & Settlement

Venue Adapters

Every position sits in exactly one venue, addressed by venueId and served by an adapter contract.
loan.venueBitmap is the set of venues the loan may move within (bit n set = venue n allowed); position.venueId is where it is right now.

Enabled Market Data

data is keccak256 of a venue-market blob; hash the blob you hold to check whether it is enabled.

Refinance & Rebase State

Refinancing moves a position between venues, re-snapshotting the venue indices and the market blob.
position.data is the raw blob for the current venue (0x when the venue takes no parameters), the pre-image whose hash appears in marketDatas.

Protocol Configuration

Owner, Fee & Fee Recipient

One singleton row per chain.
config.fee is the live protocol fee; loan.fee is the value snapshotted when that loan was opened.

Authorization

Borrowers can authorize a manager to act on their positions.
Rows persist with isAuthorized: false after revocation, so filter on the flag.

Claimable Balances

Credited earnings (solver interest, protocol fees, collateral surplus) that have not yet been claimed.
One row per (chainId, token, account); claims decrement rather than delete, so a zero amount means fully claimed.

Token Metadata

Token metadata is resolved off-chain for every token the protocol references. USD prices are sourced from DefiLlama.

Token List

Tokens that don’t answer a metadata call are stored with UNKNOWN placeholders rather than omitted.

Prices

priceUsd is refreshed every 5 minutes, is nullable, and is a Float; parse it as a number, not a BigInt.

Token Relations

Any token address field expands in place, which removes the second round trip.
The relation replaces the raw string, so request { address } if you need the hex.

Historical Data

The API serves current state only: every row reflects the latest indexed block, with no event log, snapshot table, or timeseries. For now, read the contract event logs directly, or index them yourself; historical timeseries data will be added to the API in a future release.

Paging, Ordering & Filtering

Every plural query accepts the same arguments: where, orderBy, orderDirection, limit, and cursor paging via after / before with pageInfo.
Each column exposes suffixed operators, combined with AND by default: AND and OR take lists of filters and nest:
Three notes: limit above the 1000 cap fails with a masked INTERNAL_SERVER_ERROR (“Unexpected error.”); where cannot traverse relations, so cross-entity conditions are a second query plus a client-side join; prefer cursors over offset for full scans, since offset can skip or repeat rows if a write lands mid-scan.