Metrics
Learn about the Metrics object type, how to query metric data, and handle historical values.
Metrics
The Metrics object represents a specialized structure that connects to multiple object types including Assets, Reward Options, Providers, and Validators. It stores timestamp-associated numeric data queryable as current values or time series.
There can be 100s of unique metrics per asset, provider, validator, or rewardOption. The API filters low-value metrics by default; you must specify showAll: true to retrieve all metrics, though this runs the risk of consuming too many credits.
Metrics Object Fields
| Field | Type | Description |
|---|---|---|
id | ID! | Unique identifier |
asset | Asset | Associated asset |
provider | Provider | Associated provider |
rewardOption | RewardOption | Associated reward option |
validator | Validator | Associated validator |
label | String | Human-readable label |
metricKey | String | Metric identifier key |
tooltip | String | Tooltip description |
unit | String | Unit of measurement |
precision | Int | Decimal precision |
defaultValue | Float! | Current/default value |
editableMin | Float | Minimum editable value |
editableMax | Float | Maximum editable value |
editableInterval | Float | Edit interval |
variation | JSON | Variation data |
changePercentages | JSON | Percentage changes (24h, 7d, 30d, 90d, 1y) |
changeAbsolutes | JSON | Absolute changes (24h, 7d, 30d, 90d, 1y) |
rewardOptionKeys | JSON | Reward option keys |
isEditable | Boolean | Whether metric is editable |
createdAt | Date | Creation timestamp |
standard | Boolean | Standard metric flag |
approvedLatest | Boolean | Latest approval status |
approvedHistorical | Boolean | Historical approval status |
Interval Behavior
When using the interval argument without available data, the API backfills with the last available data point by default. You can set backfillInterval to false to return null values instead.
Sample Queries
Global Marketcap
To retrieve global metrics, set all entity filters to null:
{
metrics(
where: {
asset: null
provider: null
rewardOption: null
validator: null
metricKeys: ["marketcap"]
}
limit: 1
) {
defaultValue
changeAbsolutes
changePercentages
createdAt
}
}Historical Reward Option Metrics
Query metrics for specific Reward Options, Assets, Providers, or Validators:
{
rewardOptions(
where: {
inputAsset: { symbols: ["ETH"] }
typeKeys: ["solo-staking", "pos"]
}
limit: 10
) {
metrics(
where: { metricKeys: ["reward_rate"], createdAt_lt: "2023-01-30" }
limit: 10
) {
metricKey
defaultValue
changePercentages
createdAt
}
}
}changeAbsolutesis the absolute change in the metric value within the last 24h, 7d, 30d, 90d, or 1y.changePercentagesis the percentage change in the metric value within the same timeframes.
Related Types
- Assets — Staking assets
- Providers — Staking providers
- Validators — Validator nodes
- Reward Options — Staking mechanisms