> ## Documentation Index
> Fetch the complete documentation index at: https://docs.yield.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# SKILL

> Read Yield.xyz positions, balances, pending actions, and action history for one or many wallet addresses. Use when the user wants to see their staking or yield balances, rewards, unstaking progress, or a portfolio across networks.

# Check portfolio

Read balances with two endpoints: `POST /v1/yields/balances` for many addresses, networks, and yields in one call, and `POST /v1/yields/{yieldId}/balances` for one address on one yield.

## When to use

* Check a staking or lending balance
* Show a portfolio across networks
* Check earned rewards or claimable funds
* Monitor unstaking progress
* List past actions for an address

## Authentication and host

Send the project API key in the `x-api-key` header.

```
https://api.yield.xyz/v1
```

## Step 1: Aggregate balances

`POST /v1/yields/balances`. The body is `{ "queries": [ ... ] }` with 1 to 25 queries. There is no top-level `address`.

| Query field | Required | Notes |
| - | - | - |
| `address` | yes | Wallet address to read. |
| `network` | yes | Network of the address. |
| `yieldId` | no | Explicit query for this yield. Must be enabled for the project. Always returned, even with zero balances. |
| `arguments` | no | Protocol-specific input, for example `pAddressBech` and `cAddressBech` for Avalanche. |

```bash theme={null}
curl -X POST "https://api.yield.xyz/v1/yields/balances" \
  -H "x-api-key: $YIELD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "queries": [
      { "yieldId": "ethereum-eth-lido-staking", "address": "0xYOUR_WALLET_ADDRESS", "network": "ethereum" },
      { "address": "0xYOUR_WALLET_ADDRESS", "network": "base" }
    ]
  }'
```

Omitting `yieldId` makes the query a chain scan. It does not read every yield on the network: it reads the enabled yields the address has already used through Yield.xyz actions on that network, plus a small fixed set for networks that need one. Scan results with no balances are dropped. Duplicate `yieldId` and address pairs are merged, and an explicit query wins over a scan.

The response is `{ items, errors }`. Each item is `{ yieldId, balances[], rewardRate? }`. `errors[]` holds `{ yieldId, error }` for yields that failed; a failure on one yield does not fail the call. Report errors and continue with the rest.

## Step 2: Balances for one yield

`POST /v1/yields/{yieldId}/balances` with `{ "address": "0xYOUR_WALLET_ADDRESS" }` and optional `arguments`. The network comes from the yield.

## Step 3: Read the balance entries

Each entry in `balances[]` has `address`, `type`, `amount` (human-readable), `amountRaw`, `amountUsd`, `token`, `isEarning`, `pendingActions[]`, and optionally `validator`, `validators`, `date`, and share fields.

| `type` | Meaning |
| - | - |
| `active` | Deployed and earning, or ready to earn. |
| `entering` | In flight, not yet active. |
| `exiting` | Cooling down or being unstaked. |
| `withdrawable` | Exited and ready to claim. |
| `claimable` | Rewards or profits ready to claim. |
| `locked` | Protocol-constrained, for example vesting. |

`pendingActions[]` lists what can be run next. Execute one with `manage-position`, sending its `type` as `action` and its `passthrough` unchanged.

## Step 4: Action history

`GET /v1/actions` lists actions. Filters: `address`, `yieldId`, `status` or `statuses`, `intent` (`enter`, `exit`, `manage`), `type`, `network`, `yieldTypes`, `offset`, `limit`.

```bash theme={null}
curl "https://api.yield.xyz/v1/actions?address=0xYOUR_WALLET_ADDRESS&intent=enter&limit=20" \
  -H "x-api-key: $YIELD_API_KEY"
```

`STALE` actions (no progress for 30 minutes) are hidden unless one of their transactions was broadcast or you filter by status. `GET /v1/actions/{actionId}` returns one action.

## Portfolio pattern

1. Collect the user's addresses per network.
2. Send up to 25 queries per call; split larger sets.
3. Sum `amountUsd` where present, and group by network, provider, and yield type.
4. List `claimable` and `withdrawable` balances as things to act on, and `exiting` balances as in progress.

## Errors

| Status | Meaning | Action |
| - | - | - |
| 400 | Invalid body, more than 25 queries, or a yield not enabled for the project | Fix the body. |
| 401 | Missing or invalid API key | Check the `x-api-key` header. |
| 429 | Rate limited | Wait for `retry-after` seconds. |
| 500 | Server error | Retry with backoff. |

## Edge cases

* **Empty result:** No items means no positions were found for the queries. Chain scans only find yields used through Yield.xyz; query a `yieldId` explicitly to check others.
* **Address formats:** An EVM address works across EVM networks, but send one query per network. Do not reuse an address across different address formats.
* **Amounts:** `amount` is human-readable; `amountRaw` is the smallest unit.
* **Partial failures:** Handle `errors[]` per yield.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.