> For the complete documentation index, see [llms.txt](https://darksun-2.gitbook.io/darksun-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://darksun-2.gitbook.io/darksun-docs/integrations/overview/validator-metrics.md). Agents can also search and read this documentation through its [MCP server](https://darksun-2.gitbook.io/darksun-docs/~gitbook/mcp).

# validator\_metrics

This guide defines the recommended payload shape for validator-level metrics.

## Purpose

DarkSun uses `validator_metrics` to enrich staking views with:

* rank
* APR
* uptime
* validator-specific performance signals

## Manifest expectation

Example capability declaration:

```json
{
  "key": "validator_metrics",
  "schema": "validator_metrics",
  "version": "1.0",
  "endpoint": "validator_info_api",
  "output": {
    "entityKey": "operatorAddress"
  }
}
```

This means the response should identify the validator using `operatorAddress`.

## Recommended payload

```json
{
  "operatorAddress": "terravaloper1...",
  "rank": 12,
  "apr": 16.4,
  "uptime": 99.92,
  "logoUrl": "https://validatorone.example/logo.png",
  "siteUrl": "https://validatorone.example",
  "identity": "ABCDEF1234567890"
}
```

## Required fields

* the field declared in `output.entityKey`

For the current recommended model, that is:

* `operatorAddress`

## Recommended fields

* `rank`
* `apr`
* `uptime`
* `logoUrl`
* `siteUrl`
* `identity`

## Field meanings

### `rank`

Relative ranking in the validator set or source-specific ranking.

### `apr`

APR estimate for the validator. If you expose it, document how it is computed.

### `uptime`

Validator uptime percentage or equivalent availability metric.

## Common mistakes

### Returning metrics with no validator identifier

DarkSun cannot match metrics to validators if there is no stable key.

### Returning percentages as strings with formatting

Prefer numeric values such as `16.4` over `"16.4%"`.

### Mixing source-specific semantics without documentation

If `rank`, `apr`, or `uptime` are source-specific, explain the methodology in your docs.
