> For the complete documentation index, see [llms.txt](https://docs.kpk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kpk.io/funds/infrastructure/architecture/onchain-accounting/balance-adapters/polygon-staking.md). Agents can also search and read this documentation through its [MCP server](https://docs.kpk.io/~gitbook/mcp).

# Polygon Staking

Reports an account's Polygon PoS delegation, staked principal and unclaimed rewards, for any configured validator.

One immutable adapter that reports an account's **Polygon PoS delegation** for any configured validator: staked principal and unclaimed rewards, both in **POL**. Validators are governed on the NAV Calculator (per-adapter, `MANAGER`-gated) and passed in as `bytes32` instance coordinates, so adding one is a config transaction.

* **Type:** Meta-adapter
* **protocolSubId:** `keccak256("polygon-staking")`
* **Instance key:** the `ValidatorShare` address, widened to bytes32
* **positionId:** `abi.encode(address(validatorShare))`
* **protocolName():** `"Polygon Staking"` (the product, not the chain)
* **Source:** `PolygonStakingMetaBalanceAdapter.sol`

{% hint style="warning" %}
**This is an Ethereum mainnet adapter, despite the protocol's name.** Polygon PoS staking settles on Ethereum L1 through the `StakeManager` at `0x5e3Ef299fDDf15eAa0432E6e66473ace8c13D908`, which mints one `ValidatorShare` contract per validator. Nothing in this adapter runs on the Polygon chain.
{% endhint %}

## Positions returned

| Leg     | PositionKind | isDebt  | Description                               |
| ------- | ------------ | ------- | ----------------------------------------- |
| Staking | `Staking`    | `false` | The account's delegated principal, in POL |
| Rewards | `Rewards`    | `false` | Unclaimed staking rewards, in POL         |

Both legs share the `positionId` (the validator share address) and are told apart by `positionKind`. Both come from one `getStakeAndRewards(account)` call, which returns principal already in POL, so no exchange-rate conversion applies. Zero legs are dropped.

## Unbonding positions are not reported

{% hint style="danger" %}
**A delegation that is mid-unstake reads as smaller than it is.** When a delegator starts an unstake, the shares leave `getStakeAndRewards` and enter a per-account, nonce-indexed withdrawal queue (`unbondNonces` and `unbonds_new`, valued through `withdrawExchangeRate()`). This adapter does not read that queue, because that means walking an unbounded nonce range per instance per account. The result is an **under-report**, the safe direction. Reading it later would need its own `isLocked = true` leg and a bound on the nonce walk.
{% endhint %}

## Pricing POL

POL is a registered asset priced by a plain Chainlink primary, with no custom feed contract. The feed is `0x7bAC85A8a13A4BcD8abb3eB7d6b4d632c5a57676`, whose `description()` reads **`MATIC / USD`**. The display name is legacy: Chainlink's reference data lists the proxy with `baseAsset: POL`.

Registered at **heartbeat 86400**, the cadence the feed declares; see [Choosing a heartbeat](https://docs.kpk.io/funds/infrastructure/architecture/onchain-accounting/price-feeds.md#rules-every-feed-follows).

## Labels

The breadcrumb is `["Validator", "#<validatorId>"]`, e.g. `["Polygon Staking", "Validator", "#192"]`.

The leaf comes from `validatorId()` rather than the ERC-20 `name()`, which the live share contracts return as an opaque value (`"Delegated POL #c0"` for validator 192). The read is gas-capped and falls back to `"<POL symbol> <share address>"`, so a non-conforming instance degrades the label instead of reverting a display-only view.

## Failure behaviour

A configured instance that is not a readable `ValidatorShare` reverts at `getStakeAndRewards` and is dropped by the meta-adapter's per-instance catch; the account's other positions are unaffected. An instance that runs **out of gas** is not absorbed: the fan-out raises `InstanceGasExhausted`, since an empty leg list would under-report behind a complete-looking answer.

If POL is ever unregistered on the NAV Calculator, the adapter returns no legs rather than reverting.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.kpk.io/funds/infrastructure/architecture/onchain-accounting/balance-adapters/polygon-staking.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
