# globalStakingSummary

### Overview

Returns a user-centric global staking snapshot with three balance types per user. Sorted by staked balance descending. Updated roughly every 10 minutes.

### Request

* **Endpoint**: `POST /info`

```json
{
  "type": "globalStakingSummary"
}
```

### Response Headers

* `x-payload-format: msgpack`

### Data Format

**Format**: MessagePack

**Structure** — a positional array of 4 elements `[i, t, s, a]`:

```json
[
  "20260413_957200000",              // [0] Snapshot ID
  1776010486341,                     // [1] Timestamp (ms)
  [                                  // [2] Staking tuples (parallel with addresses)
    [241305342.63, 0.0, 0.0],
    [18308351.73, 404753.12, 99284.89]
  ],
  [                                  // [3] Addresses (parallel with staking tuples)
    "0x43e9abea1910387c4292bca4b94de81462f8a251",
    "0x393d0b87ed38fc779fd9611144ae649ba6082109"
  ]
]
```

**Staking Tuple Format** — each entry in `s` contains 3 values in order:

```
staked_balance      // HYPE delegated to validators (sum across all validators)
pending_unstake     // HYPE in the 7-day undelegation queue
staking_balance     // HYPE available in staking system (not delegated, not pending)
```

All amounts are in HYPE. The three fields are non-overlapping.

<details>

<summary>Dependencies</summary>

**JavaScript**

* **msgpack**: For decoding (e.g., `@msgpack/msgpack`)

**Python**

* **msgpack**: For decoding (e.g., `msgpack`)

</details>

### Implementation examples

**Note**: Make sure to set **HYDROMANCER\_API\_KEY** in your .env file

{% tabs %}
{% tab title="JavaScript" %}

```javascript
const axios = require('axios');
const { decode } = require('@msgpack/msgpack');
require('dotenv').config();

async function getGlobalStakingSummary() {
    const response = await axios.post(
        `${process.env.HYDROMANCER_API_URL || 'https://api.hydromancer.xyz'}/info`,
        { type: 'globalStakingSummary' },
        {
            headers: {
                'Content-Type': 'application/json',
                'Authorization': `Bearer ${process.env.HYDROMANCER_API_KEY}`
            },
            responseType: 'arraybuffer'
        }
    );

    const [snapshotId, timestamp, stakingTuples, addresses] = decode(response.data);

    console.log(`Snapshot: ${snapshotId}, users: ${addresses.length}`);

    // Example: find top 5 by staked balance
    for (let i = 0; i < Math.min(5, addresses.length); i++) {
        const [staked, pending, available] = stakingTuples[i];
        console.log(`${addresses[i]}: staked=${staked}, pending=${pending}, available=${available}`);
    }
}

getGlobalStakingSummary().catch(console.error);
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import msgpack
import os
from dotenv import load_dotenv

load_dotenv()

def get_global_staking_summary():
    base_url = os.getenv('HYDROMANCER_API_URL', 'https://api.hydromancer.xyz')
    api_key = os.getenv('HYDROMANCER_API_KEY')

    response = requests.post(
        f'{base_url}/info',
        json={'type': 'globalStakingSummary'},
        headers={
            'Content-Type': 'application/json',
            'Authorization': f'Bearer {api_key}'
        }
    )
    response.raise_for_status()

    snapshot_id, timestamp, staking_tuples, addresses = msgpack.unpackb(
        response.content, raw=False
    )

    print(f"Snapshot: {snapshot_id}, users: {len(addresses)}")

    # Example: find top 5 by staked balance
    for i in range(min(5, len(addresses))):
        staked, pending, available = staking_tuples[i]
        print(f"{addresses[i]}: staked={staked}, pending={pending}, available={available}")

if __name__ == '__main__':
    get_global_staking_summary()
```

{% endtab %}
{% endtabs %}

### Rate Limits

* **Points cost**: 1
* **Window**: 5 requests per 10 minutes

### Errors

| Status | Condition                  |
| ------ | -------------------------- |
| 404    | Snapshot not available yet |
| 500    | Server error               |


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hydromancer.xyz/readme/rest-api/staking/globalstakingsummary.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
