Staking Data
Queries

Limit Property

Learn why the limit property is required for all queries and how to use it effectively.

Limit Property

Every level of the query requires a limit value. If you don't define a limit, your query won't work. A limit is required, even if it's obvious the output will only be one element!

Why Limit is Required

The API uses limit properties to enhance speed and efficiency through four mechanisms:

  1. Performance optimization — Restricting returned data volume improves speed, particularly for large datasets, by reducing transmission requirements.

  2. User-controlled data — The limit field enables users to manage data quantity and prevent information overload.

  3. Bandwidth optimization — Mobile and low-bandwidth scenarios benefit from reduced data transmission, improving API performance and user data usage.

  4. Pagination and offset — Combining limit with offset enables pagination, allowing large datasets to be divided into manageable sections.

Example

{
  rewardOptions(
    where: { inputAsset: { symbols: ["ETH"] }, typeKeys: ["pos"] }
    limit: 1
  ) {
    metrics(
      where: { metricKeys: ["reward_rate"], createdAt_lt: "2023-01-01" }
      limit: 5
    ) {
      metricKey
      defaultValue
      changePercentages
      createdAt
    }
  }
}

Try modifying the filter to retrieve the top 5 validators by staked amount. See the Filter Query Results section for more information.

On this page